|
@@ -11,15 +11,33 @@ const _ = require('lodash'); |
|
@@ -11,15 +11,33 @@ const _ = require('lodash'); |
11
|
|
11
|
|
12
|
|
12
|
|
13
|
// comment page
|
13
|
// comment page
|
14
|
-exports.index = (req, res) => {
|
|
|
15
|
- /* let uid = req.user.uid;
|
14
|
+exports.index = (req, res, next) => {
|
|
|
15
|
+ let uid = req.user.uid;
|
16
|
let isComment = req.query.isComment;
|
16
|
let isComment = req.query.isComment;
|
17
|
let page = req.query.page || 1;
|
17
|
let page = req.query.page || 1;
|
18
|
|
18
|
|
19
|
// 转string值为bool值
|
19
|
// 转string值为bool值
|
20
|
- isComment = isComment === 'Y';*/
|
20
|
+ isComment = isComment === 'Y';
|
|
|
21
|
+
|
|
|
22
|
+ //uid: 20000318 test1
|
|
|
23
|
+console.log('==> uid: ' + req.user.uid);
|
|
|
24
|
+
|
|
|
25
|
+ commentModel.getCommentList(uid, isComment, page)
|
|
|
26
|
+ .then(data => {
|
|
|
27
|
+ let localData = _.merge(data, {
|
|
|
28
|
+ module: 'home',
|
|
|
29
|
+ page: 'comment'
|
|
|
30
|
+ });
|
21
|
|
31
|
|
22
|
- res.render('comment', {
|
32
|
+ res.render('comment', localData);
|
|
|
33
|
+
|
|
|
34
|
+ // res.render('comment', {
|
|
|
35
|
+ //
|
|
|
36
|
+ // });
|
|
|
37
|
+ })
|
|
|
38
|
+ .catch(next);
|
|
|
39
|
+
|
|
|
40
|
+ /*res.render('comment', {
|
23
|
comment: {
|
41
|
comment: {
|
24
|
orders: [{
|
42
|
orders: [{
|
25
|
orderTime: '2016-10-10',
|
43
|
orderTime: '2016-10-10',
|
|
@@ -35,22 +53,7 @@ exports.index = (req, res) => { |
|
@@ -35,22 +53,7 @@ exports.index = (req, res) => { |
35
|
}]
|
53
|
}]
|
36
|
}]
|
54
|
}]
|
37
|
}
|
55
|
}
|
38
|
- });
|
|
|
39
|
-
|
|
|
40
|
- /* commentModel.getCommentList(uid, isComment, page /!* , limit=10*!/)
|
|
|
41
|
- .then(data => {
|
|
|
42
|
- let localData = _.merge(data, {
|
|
|
43
|
- module: 'home',
|
|
|
44
|
- page: 'comment'
|
|
|
45
|
- });
|
|
|
46
|
-
|
|
|
47
|
- res.render('comment', localData);
|
|
|
48
|
-
|
|
|
49
|
- // res.render('comment', {
|
|
|
50
|
- //
|
|
|
51
|
- // });
|
|
|
52
|
- })
|
|
|
53
|
- .catch(next);*/
|
56
|
+ });*/
|
54
|
};
|
57
|
};
|
55
|
|
58
|
|
56
|
exports.commentList4Order = (req, res, next) => {
|
59
|
exports.commentList4Order = (req, res, next) => {
|