Authored by zhangxiaoru

资讯首页

... ... @@ -8,9 +8,9 @@
const index = (req, res) => {
// var pageNum = req.query.page || 1;
var pageNum = req.query.page || 1;
res.render('index', {
res.display('index', {
module: 'editorial',
page: 'index',
title: '资讯',
... ... @@ -59,17 +59,31 @@ const index = (req, res) => {
type: '潮品'
}
],
mags: [
msg: [
{
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
msgContent: '鞋款定价回复即可老地方了服务',
time: '2016/05/25 19:36',
liked: true,
like: '8'
},
{
msgLeft: '潮品',
msgTitle: '很到位和范围的恢复文件和的减肥了晚餐费',
img: '',
msgContent: '鞋款定价回复即可老地方了服务',
time: '2016/05/25 19:36',
liked: true,
like: '8'
}
],
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 10, // per_page records' number
totalRows: 100 // total page number
}
]
},
helpers: {
// import component, path depends on your project
... ...
<div class="editorial-index-page">
{{# editorial}}
{{# editorial}}
{{> path-nav}}
<div class="index-content">
<ul class="msg-nav">
{{# msgTypes}}
... ... @@ -14,12 +12,15 @@
</ul>
<div id="msg-list" class="msg-list">
{{# msgs}}
{{# msg}}
{{> msg}}
{{/ msgs}}
{{/ msg}}
</div>
<div class="paging">
{{{ pagination paginationOpts }}}
</div>
</div>
{{/ editorial}}
{{/ editorial}}
</div>
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
<b class="time-word">{{time}}</b>
</span>
<span class="like-comment">
<i class="iconfont like-icon{{#if liked}} liked{{/if}}">&#xe626;</i>
<i class="iconfont like-icon{{#if liked}} liked{{/if}}">&#xe60e;</i>
<b class="like-num">{{like}}</b>
</span>
</div>
... ...
/**
* 资讯首页
* @author: zxr<xiaoru.zhang@yoho.cn>
* @date: 2016/07/05
*/
// var $ = require('yoho-jquery'),
// lazyLoad = require('yoho-jquery-lazyload');
// lazyLoad($('#msg-list img.lazy'));
... ...
... ... @@ -39,6 +39,12 @@
}
}
}
.paging {
margin: 20px auto;
width: 300px;
height: 40px;
}
}
@import "msg";
... ...
... ... @@ -47,7 +47,6 @@
line-height: 24px;
word-wrap: break-word;
margin-top: 10px;
margin-bottom: 10px;
overflow: hidden;
word-wrap: break-word;
text-overflow: ellipsis;
... ... @@ -57,8 +56,8 @@
}
.msg-app {
height: 30px;
line-height: 30px;
height: 45px;
line-height: 45px;
font-size: 14px;
}
... ... @@ -81,6 +80,14 @@
color: #a6a6a6;
cursor: pointer;
font-size: 14px;
.like-icon {
cursor: pointer;
&.liked {
color: #000;
}
}
}
.like-num {
... ...
... ... @@ -8,7 +8,6 @@
/* 模块 */
@import "me/index";
@import "channel/index";
@import "base";
@import "components/index";
... ...