Authored by 陈轩

fix seckill list

@@ -87,17 +87,15 @@ function fetchProductList(activityInfo, uid) { @@ -87,17 +87,15 @@ function fetchProductList(activityInfo, uid) {
87 .then(res => { 87 .then(res => {
88 let r1 = res[0]; 88 let r1 = res[0];
89 let r2 = res[1]; 89 let r2 = res[1];
90 - let result = {  
91 - products: []  
92 - }; 90 + let result = [];
93 91
94 if (r1.code !== 200) { 92 if (r1.code !== 200) {
95 return result; 93 return result;
96 } 94 }
97 95
98 - r2.data ?  
99 - result.products = _productAddFlag(r1.data, r2.data) :  
100 - result.products = _productAddFlag(r1.data); 96 + result = r2.data ?
  97 + _productAddFlag(r1.data, r2.data) :
  98 + _productAddFlag(r1.data);
101 99
102 return result; 100 return result;
103 }); 101 });
@@ -250,7 +248,7 @@ const getProductList = (req, res, next) => { @@ -250,7 +248,7 @@ const getProductList = (req, res, next) => {
250 console.log(activityInfo) 248 console.log(activityInfo)
251 249
252 return fetchProductList(activityInfo, uid).then(resultProducts => { 250 return fetchProductList(activityInfo, uid).then(resultProducts => {
253 - res.render('seckill/product-list', Object.assign(resultProducts, { 251 + res.render('seckill/product-list', Object.assign({products: resultProducts}, {
254 layout: false 252 layout: false
255 }, { 253 }, {
256 helpers: _helpers 254 helpers: _helpers