Authored by 刘传洋

comment temp

... ... @@ -11,15 +11,33 @@ const _ = require('lodash');
// comment page
exports.index = (req, res) => {
/* let uid = req.user.uid;
exports.index = (req, res, next) => {
let uid = req.user.uid;
let isComment = req.query.isComment;
let page = req.query.page || 1;
// 转string值为bool值
isComment = isComment === 'Y';*/
isComment = isComment === 'Y';
//uid: 20000318 test1
console.log('==> uid: ' + req.user.uid);
commentModel.getCommentList(uid, isComment, page)
.then(data => {
let localData = _.merge(data, {
module: 'home',
page: 'comment'
});
res.render('comment', {
res.render('comment', localData);
// res.render('comment', {
//
// });
})
.catch(next);
/*res.render('comment', {
comment: {
orders: [{
orderTime: '2016-10-10',
... ... @@ -35,22 +53,7 @@ exports.index = (req, res) => {
}]
}]
}
});
/* commentModel.getCommentList(uid, isComment, page /!* , limit=10*!/)
.then(data => {
let localData = _.merge(data, {
module: 'home',
page: 'comment'
});
res.render('comment', localData);
// res.render('comment', {
//
// });
})
.catch(next);*/
});*/
};
exports.commentList4Order = (req, res, next) => {
... ...
... ... @@ -85,9 +85,9 @@
<textarea name="goodsComment"></textarea>
</div>
<div class="row img-list clearfix">
<div class="img-preview selected">
<img src="" alt="">
<input type="file" id="upload-{{@index}}" />
<div class="img-preview">
<img src="" />
<input type="file" id="upload-{{../orderId}}-{{goodsId}}" />
<i class="view">查看</i>
<i class="del">删除</i>
</div>
... ...
... ... @@ -143,6 +143,7 @@ $('.comment-add input[type="file"]').each(function(i, it) {
window.location.origin = window.location.protocol + '//' +
window.location.hostname + (window.location.port ? ':' + window.location.port : '');
}
alert(window.location.origin);
$this.qupload({
button_image_url: '',
upload_url: window.location.origin + '/home/returns/imgUpload',
... ...