Skip to content

Commit fc38f6b

Browse files
committed
首页加上下面四栏话题
1 parent d17aacc commit fc38f6b

File tree

6 files changed

+406
-10
lines changed

6 files changed

+406
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
- http://localhost:3000/ 访问为使用ejs的nodejs模板,使用angularjs作为数据绑定用,由于这是第一次在复杂项目中使用angularjs,所以没有使用好angularjs,文档非常烂。
7171

72-
- http://localhost:3000/app/app.html 是对前端使用angularjs的一个重新规划,目前正在学习angularjs重构中
72+
- http://localhost:3000/app/app.html#/index 是对前端使用angularjs的一个重新规划,目前正在学习angularjs重构中
7373

7474

7575

public/app/index.html

+6-9
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,18 @@ <h3>发布评论</h3>
5858

5959
<ul class="nav nav-tabs" id="myTab">
6060
<li class="active"><a href="#home" data-toggle="tab">我的关注</a></li>
61-
<li><a href="#stock" data-toggle="tab" ng-click="aboutStockTopic()">我的股票</a></li>
62-
<li><a href="#profile" data-toggle="tab" ng-click="myTopic()">我的评论</a></li>
63-
<li><a href="#messages" data-toggle="tab" ng-click="atTopic()">@我</a></li>
61+
<li><a href="#stock" data-toggle="tab" id="aboutStockTopic">我的股票</a></li>
62+
<li><a href="#profile" data-toggle="tab" id="myTopic">我的评论</a></li>
63+
<li><a href="#messages" data-toggle="tab" id="atTopic">@我</a></li>
6464
</ul>
6565

6666
<div class="tab-content">
6767
<div class="tab-pane active" id="home" ng-include="'app/mode/topic.html'" ng-controller="topic"></div>
68-
<div class="tab-pane" id="stock">
69-
<%- include mode/aboutstocktopic %>
68+
<div class="tab-pane" id="stock" ng-include="'app/mode/aboutstocktopic.html'" ng-controller="aboutstocktopic">
7069
</div>
71-
<div class="tab-pane" id="profile">
72-
<%- include mode/mytopic %>
70+
<div class="tab-pane" id="profile" ng-include="'app/mode/mytopic.html'" ng-controller="mytopic">
7371
</div>
74-
<div class="tab-pane" id="messages">
75-
<%- include mode/atmetopic %>
72+
<div class="tab-pane" id="messages" ng-include="'app/mode/atmetopic.html'" ng-controller="atmetopic">
7673
</div>
7774
</div>
7875

public/app/mode/aboutstocktopic.html

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<ul class="list-group">
2+
3+
<!-- 第一层循环 -->
4+
5+
<li class="myTopiclist" ng-repeat="myTopic in aboutStockTopicList">
6+
<div class="myTopic">
7+
<img width="45" heigth="45" ng-src="{{ '/images/user/small/pic_' + myTopic.name +'.jpg' }}" />
8+
<a ng-href="{{ '/people/' + myTopic.name }}">{{myTopic.name}}</a>: {{myTopic.topic}}
9+
</div>
10+
<div class="forwardTopic" ng-show="{{myTopic.isForward}}">
11+
<span>{{myTopic.forwardObj.name}}</span>
12+
<p>{{myTopic.forwardObj.topic}}({{myTopic.forwardObj.time}})</p>
13+
</div>
14+
<div class="tool">
15+
<div class="tool-time">{{myTopic.time}}</div>
16+
<div class="tool-do">
17+
<span>转发({{myTopic.forward}})</span>
18+
<span ng-click="commentTopic(myTopic,$event)" class="toolComment" data-first="yes">评论(<em>{{myTopic.comment}}</em>)</span>
19+
</div>
20+
</div>
21+
<div class="topicComment" ng-show="myTopic.toCoShow">
22+
<textarea class="topicCommentText" ng-model="myTopic.topicCommentText"></textarea>
23+
<div>
24+
<span><input type="checkbox" ng-model="myTopic.ifForward"/>同时转发到我的微博</span>
25+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="submitComAboutStockTopic($event,myTopic)">评论</button>
26+
</div>
27+
<ul class="topicCommentlist" data-show="0">
28+
29+
<!-- 第二层循环 -->
30+
31+
<li ng-repeat="comment in myTopic.comlist">
32+
<div class="CommentlistCom">
33+
<div class="CommentlistPic"><img width="30" heigth="30" ng-src="{{ '/images/user/small/pic_' + comment.name +'.jpg' }}" /></div>
34+
<p><a ng-href="{{ '/people/' + comment.name }}">{{comment.name}}</a>:{{comment.topic}}({{comment.time}})</p>
35+
<span class="clickRe" ng-click="comRe(comment)">回复</span>
36+
<div style="clear:both"></div>
37+
<div class="commentRe" ng-show="comment.reShow">
38+
<textarea ng-model="comment.commentReText"></textarea>
39+
<div>
40+
<span><input type="checkbox" ng-model="myTopic.ifForwardRe"/>同时转发到我的微博</span>
41+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="comAboutStockRe(comment,myTopic)">评论</button>
42+
</div>
43+
</div>
44+
</div>
45+
</li>
46+
47+
<!-- 第二层循环结束 -->
48+
49+
</ul>
50+
</div>
51+
</li>
52+
53+
<!-- 第一层循环结束 -->
54+
55+
</ul>
56+
<div id="aboutStockTopicMore" ng-show="aboutStockTopicMore" ng-click="getStockTopicMore($event)">加载更多</div>

public/app/mode/atmetopic.html

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<ul class="list-group">
2+
3+
<!-- 第一层循环 -->
4+
5+
<li class="myTopiclist" ng-repeat="myTopic in atmeTopicList">
6+
<div class="myTopic">
7+
<img width="45" heigth="45" ng-src="{{ '/images/user/small/pic_' + myTopic.name +'.jpg' }}" />
8+
<a ng-href="{{ '/people/' + myTopic.name }}">{{myTopic.name}}</a>: {{myTopic.topic}}
9+
</div>
10+
<div class="forwardTopic" ng-show="{{myTopic.isForward}}">
11+
<span>{{myTopic.forwardObj.name}}</span>
12+
<p>{{myTopic.forwardObj.topic}}({{myTopic.forwardObj.time}})</p>
13+
</div>
14+
<div class="tool">
15+
<div class="tool-time">{{myTopic.time}}</div>
16+
<div class="tool-do">
17+
<span>转发({{myTopic.forward}})</span>
18+
<span ng-click="commentTopic(myTopic,$event)" class="toolComment" data-first="yes">评论(<em>{{myTopic.comment}}</em>)</span>
19+
</div>
20+
</div>
21+
<div class="topicComment" ng-show="myTopic.toCoShow">
22+
<textarea class="topicCommentText" ng-model="myTopic.topicCommentText"></textarea>
23+
<div>
24+
<span><input type="checkbox" ng-model="myTopic.ifForward"/>同时转发到我的微博</span>
25+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="submitComAtmeTopic($event,myTopic)">评论</button>
26+
</div>
27+
<ul class="topicCommentlist" data-show="0">
28+
29+
<!-- 第二层循环 -->
30+
31+
<li ng-repeat="comment in myTopic.comlist">
32+
<div class="CommentlistCom">
33+
<div class="CommentlistPic"><img width="30" heigth="30" ng-src="{{ '/images/user/small/pic_' + comment.name +'.jpg' }}" /></div>
34+
<p><a ng-href="{{ '/people/' + comment.name }}">{{comment.name}}</a>:{{comment.topic}}({{comment.time}})</p>
35+
<span class="clickRe" ng-click="comRe(comment)">回复</span>
36+
<div style="clear:both"></div>
37+
<div class="commentRe" ng-show="comment.reShow">
38+
<textarea ng-model="comment.commentReText"></textarea>
39+
<div>
40+
<span><input type="checkbox" ng-model="myTopic.ifForwardRe"/>同时转发到我的微博</span>
41+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="comAtmeRe(comment,myTopic)">评论</button>
42+
</div>
43+
</div>
44+
</div>
45+
</li>
46+
47+
<!-- 第二层循环结束 -->
48+
49+
</ul>
50+
</div>
51+
</li>
52+
53+
<!-- 第一层循环结束 -->
54+
55+
</ul>
56+
<div id="atmeTopicMore" ng-show="atmeTopicMore" num="1" ng-click="getStockTopicMore($event)">加载更多</div>

public/app/mode/mytopic.html

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<ul class="list-group">
2+
3+
<!-- 第一层循环 -->
4+
5+
<li class="myTopiclist" ng-repeat="myTopic in myTopicList">
6+
<div class="myTopic">{{myTopic.topic}}</div>
7+
<div class="forwardTopic" ng-show="{{myTopic.isForward}}">
8+
<span>{{myTopic.forwardObj.name}}</span>
9+
<p>{{myTopic.forwardObj.topic}}({{myTopic.forwardObj.time}})</p>
10+
</div>
11+
<div class="tool">
12+
<div class="tool-time">{{myTopic.time}}</div>
13+
<div class="tool-do">
14+
<span>转发({{myTopic.forward}})</span>
15+
<span ng-click="commentTopic(myTopic,$event)" class="toolComment" data-first="yes">评论(<em>{{myTopic.comment}}</em>)</span>
16+
</div>
17+
</div>
18+
<div class="topicComment" ng-show="myTopic.toCoShow">
19+
<textarea class="topicCommentText" ng-model="myTopic.topicCommentText"></textarea>
20+
<div>
21+
<span><input type="checkbox" ng-model="myTopic.ifForward"/>同时转发到我的微博</span>
22+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="submitCommentTopic($event,myTopic)">评论</button>
23+
</div>
24+
<ul class="topicCommentlist" data-show="0">
25+
26+
<!-- 第二层循环 -->
27+
28+
<li ng-repeat="comment in myTopic.comlist">
29+
<div class="CommentlistCom">
30+
<div class="CommentlistPic"><img width="30" heigth="30" ng-src="{{ '/images/user/small/pic_' + comment.name +'.jpg' }}" /></div>
31+
<p><a ng-href="{{ '/people/' + comment.name }}">{{comment.name}}</a>:{{comment.topic}}({{comment.time}})</p>
32+
<span class="clickRe" ng-click="comRe(comment)">回复</span>
33+
<div style="clear:both"></div>
34+
<div class="commentRe" ng-show="comment.reShow">
35+
<textarea ng-model="comment.commentReText"></textarea>
36+
<div>
37+
<span><input type="checkbox" ng-model="myTopic.ifForwardRe"/>同时转发到我的微博</span>
38+
<button type="button" class="btn btn-primary navbar-right btn-xs" ng-click="commentRe(comment,myTopic)">评论</button>
39+
</div>
40+
</div>
41+
</div>
42+
</li>
43+
44+
<!-- 第二层循环结束 -->
45+
46+
</ul>
47+
</div>
48+
</li>
49+
50+
<!-- 第一层循环结束 -->
51+
52+
</ul>
53+
<div id="myTopicGetmore" ng-show="myTopicGetmore" num="1" ng-click="getTopicMore($event)">加载更多</div>
54+
<!-- <script src="js/tgy/topic.js"></script> -->

0 commit comments

Comments
 (0)