Authored by 刘传洋

comment temp

@@ -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) => {
@@ -85,9 +85,9 @@ @@ -85,9 +85,9 @@
85 <textarea name="goodsComment"></textarea> 85 <textarea name="goodsComment"></textarea>
86 </div> 86 </div>
87 <div class="row img-list clearfix"> 87 <div class="row img-list clearfix">
88 - <div class="img-preview selected">  
89 - <img src="" alt="">  
90 - <input type="file" id="upload-{{@index}}" /> 88 + <div class="img-preview">
  89 + <img src="" />
  90 + <input type="file" id="upload-{{../orderId}}-{{goodsId}}" />
91 <i class="view">查看</i> 91 <i class="view">查看</i>
92 <i class="del">删除</i> 92 <i class="del">删除</i>
93 </div> 93 </div>
@@ -143,6 +143,7 @@ $('.comment-add input[type="file"]').each(function(i, it) { @@ -143,6 +143,7 @@ $('.comment-add input[type="file"]').each(function(i, it) {
143 window.location.origin = window.location.protocol + '//' + 143 window.location.origin = window.location.protocol + '//' +
144 window.location.hostname + (window.location.port ? ':' + window.location.port : ''); 144 window.location.hostname + (window.location.port ? ':' + window.location.port : '');
145 } 145 }
  146 +alert(window.location.origin);
146 $this.qupload({ 147 $this.qupload({
147 button_image_url: '', 148 button_image_url: '',
148 upload_url: window.location.origin + '/home/returns/imgUpload', 149 upload_url: window.location.origin + '/home/returns/imgUpload',