...
|
...
|
@@ -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) => {
|
...
|
...
|
|