Skip to content

Commit cf98e6d

Browse files
committed
save
1 parent df50955 commit cf98e6d

File tree

10 files changed

+75
-33
lines changed

10 files changed

+75
-33
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Created by army8735 on 2017/9/26.
3+
*/
4+
5+
export default {
6+
"success": true,
7+
"message": "",
8+
"code": 0,
9+
"data": [{
10+
"AuthorID": 2017000000000001,
11+
"AuthorName": "河图",
12+
"Head_url": "http://zhuanquan.xyz/temp/head2017000000000001.jpg",
13+
"FansNumber": 396690
14+
}]
15+
};

mock/api/users/GetLikeWorksList.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Created by army8735 on 2017/9/26.
3+
*/
4+
5+
export default {
6+
"success": true,
7+
"message": "",
8+
"code": 0,
9+
"data": [{
10+
"WorksID": 2015000000000006,
11+
"cover_Pic": "http://zhuanquan.xyz/temp/cover2015000000000006.jpg",
12+
"Title": "燃尽人间色",
13+
"SingerName": null
14+
}]
15+
};

src/component/hotauthor/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
white-space:nowrap;
130130
text-overflow:ellipsis;
131131
overflow:hidden;
132+
white-space:nowrap;
132133
}
133134
}
134135
}

src/index/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<body>
1919
<script>
2020
var $CONFIG = {
21+
isLogin: 'True',
2122
userName: '',
2223
};
2324
</script>

src/index/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ migi.render(
5858
);
5959

6060
migi.render(
61-
<div class="info"></div>,
61+
<div class="info"/>,
6262
document.body
6363
);

src/my/Favor.jsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,22 @@ class Favor extends migi.Component {
1111
return <div class="favor">
1212
<h3>我的收藏</h3>
1313
<b class="line"/>
14-
<div class="fn fn-clear">
14+
<div class="fn fn-clear fn-hide">
1515
<a href="#" class="prev">查看上页</a>
1616
<a href="#" class="next">查看下页</a>
1717
</div>
1818
<ul class="list fn-clear">
1919
{
2020
this.list.map(function(item) {
21-
return <li></li>;
21+
return <li>
22+
<a href={ '/works/' + item.WorksID } class="pic">
23+
<img src={ item.cover_Pic }/>
24+
<div class="ath">{ item.SingerName }</div>
25+
</a>
26+
<a href="#" class="txt">{ item.Title }</a>
27+
</li>;
2228
})
2329
}
24-
<li>
25-
<a href="#" class="pic">
26-
<img src="//tva4.sinaimg.cn/crop.7.1.129.129.180/64319a89gw1f62p9lp7hyj203w03wq2x.jpg"/>
27-
<div class="num">123</div>
28-
<div class="ath">aaa bbb</div>
29-
</a>
30-
<a href="#" class="txt">{ 123 }</a>
31-
</li>
3230
</ul>
3331
</div>;
3432
}

src/my/Follow.jsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,22 @@ class Follow extends migi.Component {
1111
return <div class="follow">
1212
<h3>我的关注</h3>
1313
<b class="line"/>
14-
<div class="fn fn-clear">
14+
<div class="fn fn-clear fn-hide">
1515
<a href="#" class="prev">查看上页</a>
1616
<a href="#" class="next">查看下页</a>
1717
</div>
1818
<ul class="list fn-clear">
1919
{
2020
this.list.map(function(item) {
2121
return <li>
22-
<a href="#" class="pic">
23-
<img src="//tva4.sinaimg.cn/crop.7.1.129.129.180/64319a89gw1f62p9lp7hyj203w03wq2x.jpg"/>
24-
<b class={ `cp-author_type` }/>
25-
<b class={ `cp-author_type` }/>
22+
<a href={ '/author/' + item.AuthorID } class="pic">
23+
<img src={ item.Head_url }/>
2624
</a>
27-
<a href="#" class="txt">{ 123 }</a>
28-
<div class="info">合作1次</div>
25+
<a href="#" class="txt">{ item.AuthorName }</a>
26+
<div class="info">{ item.FansNumber }粉丝</div>
2927
</li>;
3028
})
3129
}
32-
<li>
33-
<a href="#" class="pic">
34-
<img src="//tva4.sinaimg.cn/crop.7.1.129.129.180/64319a89gw1f62p9lp7hyj203w03wq2x.jpg"/>
35-
<b class={ `cp-author_type` }/>
36-
<b class={ `cp-author_type` }/>
37-
</a>
38-
<a href="#" class="txt">{ 123 }</a>
39-
<div class="info">合作1次</div>
40-
</li>
4130
</ul>
4231
</div>;
4332
}

src/my/My.jsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,31 @@
55
import Profile from './Profile.jsx';
66
import Follow from './Follow.jsx';
77
import Favor from './Favor.jsx';
8-
import BotNav from '../component/botnav/BotNav.jsx';
98

109
class My extends migi.Component {
1110
constructor(...data) {
1211
super(...data);
1312
}
13+
load() {
14+
let self = this;
15+
util.postJSON('api/users/GetLikeAuthorList', function(res) {
16+
if(res.success) {
17+
let data = res.data;
18+
self.ref.follow.list = data;
19+
}
20+
});
21+
util.postJSON('api/users/GetLikeWorksList', function(res) {
22+
if(res.success) {
23+
let data = res.data;
24+
self.ref.favor.list = data;
25+
}
26+
});
27+
}
1428
render() {
1529
return <div class="my">
1630
<Profile/>
31+
<Follow ref="follow"/>
32+
<Favor ref="favor"/>
1733
<a href="#" class="loginout">退出登录</a>
1834
</div>;
1935
}

src/my/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import './my.html';
66
import './index.less';
77

88
import My from './My.jsx';
9+
import BotNav from '../component/botnav/BotNav.jsx';
910

1011
let my = migi.render(
1112
<My/>,
1213
'#page'
1314
);
15+
my.load();
1416

1517
migi.render(
1618
<BotNav/>,

src/my/index.less

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@
107107
}
108108
.list{
109109
margin-top:0.2rem;
110-
padding:0 0.5rem;
110+
margin-right:-0.72rem;
111111
li{
112112
float:left;
113+
margin-right:0.3rem;
113114
width:0.72rem;
114115
text-align:center;
115116
.pic{
@@ -141,6 +142,7 @@
141142
color:#999;
142143
text-overflow:ellipsis;
143144
overflow:hidden;
145+
white-space:nowrap;
144146
}
145147
}
146148
}
@@ -211,16 +213,18 @@
211213
}
212214
.list{
213215
margin-top:0.2rem;
214-
padding:0 0.3rem;
216+
margin-right:-1.44rem;
215217
li{
216218
float:left;
217-
width:1.92rem;
219+
margin-right:0.7rem;
220+
margin-bottom:0.2rem;
221+
width:1.44rem;
218222
font-size:0.12rem;
219223
.pic{
220224
position:relative;
221225
display:block;
222226
width:100%;
223-
height:1.92rem;
227+
height:1.44rem;
224228
border-radius:0.1rem;
225229
color:#fff;
226230
&:hover{
@@ -235,7 +239,7 @@
235239
background:linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 20%, rgba(0,0,0,0.7) 100%);
236240
border-bottom-left-radius:0.1rem;
237241
border-bottom-right-radius:0.1rem;
238-
content:' ';
242+
//content:' ';
239243
z-index:2;
240244
}
241245
img{
@@ -270,6 +274,7 @@
270274
padding:0 0.1rem;
271275
text-overflow:ellipsis;
272276
overflow:hidden;
277+
white-space:nowrap;
273278
}
274279
}
275280
}

0 commit comments

Comments
 (0)