Skip to content

Commit 6643ee5

Browse files
committed
个人页面重构,遇到一个redis的bug,需要修改
1 parent fc38f6b commit 6643ee5

File tree

12 files changed

+431
-71
lines changed

12 files changed

+431
-71
lines changed

models/topic.js

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ topic.myTopic=function(name,size,num,callback){
8181
}
8282

8383
//插入redis判断
84+
//这边redis存储需要详细命名,目前有bug
8485
client.hgetall("myTopic", function (err, res) {
8586
if(err) {
8687
console.log(err);

public/app/app.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</li>
4040

4141
<li ng-show="showPeople">
42-
<a href="app/app.html#/#/people/{{ name }}">个人主页</a>
42+
<a href="app/app.html#/people/{{ name }}">个人主页</a>
4343
</li>
4444

4545
</ul>
@@ -81,5 +81,6 @@
8181
<script src="js/app/header.js"></script>
8282
<script src="js/app/login.js"></script>
8383
<script src="js/app/index.js"></script>
84+
<script src="js/app/people.js"></script>
8485
</body>
8586
</html>

public/app/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h3>新闻</h3>
9090
<li class="list-group-item">Cras justo odio</li>
9191
</ul>
9292

93-
<h3>热门</h3>
93+
<h3>热门股票</h3>
9494
<ul class="list-group" ng-controller='topStock'>
9595
<li class="list-group-item" ng-repeat="list in topList">
9696
<a href="stock/{{ list.uid }}">{{ list.name }}({{ list.top }})</a>
@@ -106,7 +106,7 @@ <h3>推荐</h3>
106106
<li>后台推荐1</li>
107107
</ul>
108108

109-
<h3>推荐用户</h3>
109+
<h3>热门用户</h3>
110110
<ul class="list-group" ng-controller='topUser'>
111111
<li class="list-group-item" ng-repeat="people in peoples">
112112
<a href="people/{{ people.name }}">{{ people.name }}({{ people.top }})</a>

public/app/people.html

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<div class="container " style="padding-top:70px;">
22
<div class="row">
33
<div class="col-md-10 col-md-offset-1">
4-
<h3 id="pageName" pName="<%= people.name %>"><%= people.name %>的信息</h3>
4+
<h3 id="pageName" pName="{{name}}">{{name}}的信息</h3>
55
<div class="col-md-2">
6-
<img src="/images/<%= people.info.pic.big %>" style="width:100%"/>
6+
<img ng-src="{{people.info.pic.big}}" style="width:100%"/>
77
</div>
88
<div class="col-md-8">
9-
<p isWatch="<%= locals.isWatch %>" id="watchP">
10-
<button type="button" class="btn btn-info col-md-offset-4" ng-click="watchPeo()" id="watchOk">关注</button>
11-
<button type="button" class="btn btn-info col-md-offset-4" ng-click="unwatchPeo()" id="watchNo">取消关注</button>
9+
<p isWatch="iswatch" id="watchP" ng-hide="myself">
10+
<button type="button" class="btn btn-info col-md-offset-4" ng-hide="iswatch" ng-click="watchPeo()" id="watchOk">关注</button>
11+
<button type="button" class="btn btn-info col-md-offset-4" ng-show="iswatch" ng-click="unwatchPeo()" id="watchNo">取消关注</button>
1212
</p>
13-
<p>特长:<span><%= people.info.Spec %></span></p>
14-
<p>兴趣:<span><%= people.info.interest %></span></p>
13+
<p>特长:<span> {{people.info.Spec }}</span></p>
14+
<p>兴趣:<span> {{people.info.interest }}</span></p>
1515
</div>
1616

1717
<div class="clearfix"></div>
1818
<h3>我的选择</h3>
19-
<table class="table table-bordered table-hover table-condensed">
19+
<table class="table table-bordered table-hover table-condensed" ng-controller="timeStock">
2020
<thead>
2121
<tr>
2222
<th>股票</th>
@@ -46,13 +46,12 @@ <h3>我的选择</h3>
4646
<ul class="nav nav-tabs" id="myTab">
4747
<li class="active"><a href="#home" data-toggle="tab">话题</a></li>
4848
<li><a href="#profile" data-toggle="tab">Profile</a></li>
49-
<li><a href="#messages" data-toggle="tab" ng-click="watchTab()">关注(<%= people.watch.length %>)</a></li>
50-
<li><a href="#settings" data-toggle="tab" ng-click="fensTab()">粉丝(<%= people.beWatch.length %>)</a></li>
49+
<li><a href="#messages" data-toggle="tab" ng-click="watchTab()">关注({{ people.watch.length }})</a></li>
50+
<li><a href="#settings" data-toggle="tab" ng-click="fensTab()">粉丝({{ people.beWatch.length }})</a></li>
5151
</ul>
5252

5353
<div class="tab-content">
54-
<div class="tab-pane active" id="home">
55-
<%- include mode/mytopic %>
54+
<div class="tab-pane active" id="home" ng-include="'app/mode/mytopic.html'" ng-controller="mytopic">
5655
</div>
5756
<div class="tab-pane" id="profile">
5857
<ul class="list-group">

public/js/app/controllers.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ app.config(function($routeProvider) {
1313
templateUrl: 'app/stock.html'
1414
});
1515
$routeProvider.when('/people/:name', {
16-
templateUrl: 'app/people.html'
16+
templateUrl: 'app/people.html',
17+
controller:peopleCtrl
1718
});
1819
$routeProvider.when('/setting', {
1920
templateUrl: 'app/setting.html',

0 commit comments

Comments
 (0)