Authored by 刘传洋

img show

... ... @@ -12,14 +12,32 @@ const _ = require('lodash');
// comment page
exports.index = (req, res, next) => {
let uid = req.user.uid;
/*let uid = req.user.uid;
let isComment = req.query.isComment;
let page = req.query.page || 1;
// 转string值为bool值
isComment = isComment === 'Y';
isComment = isComment === 'Y';*/
res.render('comment', {
comment: {
orders: [{
orderTime: '2016-10-10',
goods: [{
href: '',
thumb: 'http://img10.static.yhbimg.com/goodsimg/2015/08/05/06/016aeb5985c7e186b5c4e43e165311126d.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/70',
name: '阿斯顿发到付',
comments: [{
img: 'http://img10.static.yhbimg.com/goodsimg/2015/08/05/06/016aeb5985c7e186b5c4e43e165311126d.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/70'
}, {
img: 'http://img10.static.yhbimg.com/goodsimg/2015/08/05/06/016aeb5985c7e186b5c4e43e165311126d.jpg?imageMogr2/thumbnail/100x100/extent/100x100/background/d2hpdGU=/position/center/quality/70'
}]
}]
}]
}
});
commentModel.getCommentList(uid, isComment, page /* , limit=10*/)
/*commentModel.getCommentList(uid, isComment, page /!* , limit=10*!/)
.then(data => {
let localData = _.merge(data, {
module: 'home',
... ... @@ -32,7 +50,7 @@ exports.index = (req, res, next) => {
//
// });
})
.catch(next);
.catch(next);*/
};
exports.commentList4Order = (req, res, next) => {
... ...
... ... @@ -156,9 +156,9 @@ exports.getCommentList4Order = (uid, orderId) => {
order.goods.length && commentList.orders.push(order);
});
// let total = commentList.orders.length;
// let totalPage = Math.ceil(total / limit);
// let begin = (page - 1) * limit;
... ...
... ... @@ -42,17 +42,54 @@
<a href="{{href}}"><img src="{{thumb}}"></a>
</td>
<td>
<a href="{{href}}">{{name}}</a>
<span>下单时间{{../orderTime}}</span>
<a href="{{href}}" class="name">{{name}}</a>
<div>下单时间{{../orderTime}}</div>
</td>
<td>
<td style="width:50%" class="center">
<button class="remark-btn">评价商品</button>
</td>
</tr>
<tr>
<td colspan="3" class="comment-add">
<div>* 商品满意度:</div>
div.
<div class="row">
<label class="fl-left"><i class="color-warn require-sign">*</i> 商品满意度:</label>
<span class="comment-star">
<span class="star-5"></span>
<span class="star-4"></span>
<span class="star-3"></span>
<span class="star-2"></span>
<span class="star-1"></span>
</span>
</div>
<div class="row">
<span class="col">
<label><i class="color-warn require-sign">*</i> 尺码符合度:</label>
<a href="#" class="btn btn-outline">偏小</a>
<a href="#" class="btn btn-outline">合身</a>
<a href="#" class="btn btn-outline">偏大</a>
</span>
<span class="col">
<label>身高:</label>
<a href="#" class="btn btn-outline">175</a> 厘米
</span>
<span class="col">
<label>体重:</label>
<a href="#" class="btn btn-outline">80</a> 公斤
</span>
</div>
<div class="row textarea">
<textarea></textarea>
</div>
<div class="row img-list">
<div class="img-wrap">
<img src="" />
</div>
<span>最多上传1张图片</span>
</div>
<div class="btns">
<a href="#" class="btn btn-submit">提交评价</a>
<span>带*为必填选项</span>
</div>
</td>
</tr>
{{#each comments}}
... ...
.comment-me-page {
.btn {
display:inline-block;
margin:0 7px 0 0;
border:1px solid #636363;
font-size:12px;
line-height:1.3;
text-decoration:none;
color:#141414;
cursor:pointer;
padding:3px 10px 3px 7px;
}
.btn.active{
background:#444;
color: #fff;
}
.btn.disabled{
border-color: ;
}
.txt-center{
text-align: center;
}
.fl-left{
float: left;
}
.comment .title {
background-image: resolve(img/home/comment.png);
}
... ... @@ -18,7 +42,7 @@
margin-top: 10px;
.info {
width: 260px;
width: 50%;
}
.time {
... ... @@ -28,7 +52,7 @@
}
.type {
width: 98px;
width: 49%;
}
}
... ... @@ -37,7 +61,7 @@
margin-top: 10px;
tr {
border: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
th {
background: #efefef;
... ... @@ -45,15 +69,23 @@
}
td {
color: #666;
color: #444;
padding: 5px;
text-align: center;
text-align: left;
&.center {
text-align: center;
}
}
a {
color: #468fa2;
/*color: #468fa2;*/
text-decoration: none;
}
.name {
display: block;
margin-bottom:15px;
}
.remarked {
color: #e8044f;
... ... @@ -71,11 +103,74 @@
}
}
.color-warn{
color: #da1511;
}
.require-sign{
float: left;
margin-left:-10px;
line-height: 1.8;
}
.remark-content {
width: 405px;
border: 1px solid #e6e6e6;
word-break: break-all;
}
.comment-add {
padding: 20px 50px;
.row {
margin-bottom:16px;
.col{
margin-right: 50px;
&:last-child{
margin-right:0;
}
}
}
.textarea{
> textarea{
width: 100%;
height: 80px;
border-color: #dfdfdf;
}
}
}
.comment-star {
position:relative;
display:inline-block;
height:20px;
width:90px;
cursor:pointer;
background: resolve(img/home/star.png) 0 -20px repeat-x;
.star-1, .star-2, .star-3, .star-4, .star-5{
position: absolute;
left:0;
top:0;
display:inline-block;
height:20px;
width: 18px;
&:hover{
background: resolve(img/home/star.png) repeat-x;
}
}
.star-2{
width:36px;
}
.star-3{
width:54px;
}
.star-4{
width:72px;
}
.star-5{
width:90px;
}
}
}
.comment-dialog-widget {
... ...