Authored by 郭成尧

首页剥离goods

@@ -35,16 +35,16 @@ exports.index = (req, res) => { @@ -35,16 +35,16 @@ exports.index = (req, res) => {
35 responseData.devEnv = true; 35 responseData.devEnv = true;
36 36
37 // 假数据输出 37 // 假数据输出
38 - res.render('sale/index', Object.assign(responseData, simulation.saleIndex())); 38 + // res.render('sale/index', Object.assign(responseData, simulation.saleIndex()));
39 39
40 // 真实数据输出 40 // 真实数据输出
41 - /* sale.getSaleIndexData().then(result => { 41 + sale.getSaleIndexData().then(result => {
42 42
43 responseData.result = result; 43 responseData.result = result;
44 responseData.resultShow = JSON.stringify(result, null, 4); 44 responseData.resultShow = JSON.stringify(result, null, 4);
45 45
46 res.render('sale/index', responseData); 46 res.render('sale/index', responseData);
47 - });*/ 47 + });
48 }) 48 })
49 .catch(() => { 49 .catch(() => {
50 res.render('error', { devEnv: true, pageErr: true }); 50 res.render('error', { devEnv: true, pageErr: true });
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-19 10:20:08 3 * @Date: 2016-05-19 10:20:08
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-05-25 09:52:41 5 + * @Last Modified time: 2016-05-25 10:00:24
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
@@ -313,7 +313,7 @@ const getSaleBannerList = () => { @@ -313,7 +313,7 @@ const getSaleBannerList = () => {
313 */ 313 */
314 exports.getSaleIndexData = () => { 314 exports.getSaleIndexData = () => {
315 315
316 - return api.all([getSaleActivityList(), getSaleGoodsList(), getSaleBannerList()]).then(result => { 316 + return api.all([getSaleActivityList(), getSaleBannerList()]).then(result => {
317 var finalResult = {}; 317 var finalResult = {};
318 318
319 if (result[0].code === 200) { 319 if (result[0].code === 200) {
@@ -321,17 +321,8 @@ exports.getSaleIndexData = () => { @@ -321,17 +321,8 @@ exports.getSaleIndexData = () => {
321 } 321 }
322 322
323 if (result[1].code === 200) { 323 if (result[1].code === 200) {
324 -  
325 - if (!_.isEmpty(result[1].data.product_list)) { // 处理商品列表数据  
326 - finalResult.saleCategory = {};  
327 - finalResult.saleCategory.saleImage = [];  
328 - finalResult.saleCategory.saleImage.push(handleSaleGoodsListData(result[1].data.product_list));  
329 - }  
330 - }  
331 -  
332 - if (result[2].code === 200) {  
333 - finalResult.topBanner = handleSaleBannerData(result[2].data);  
334 - finalResult.activityEnter = handleSaleBannerSmallData(result[2].data); 324 + finalResult.topBanner = handleSaleBannerData(result[1].data);
  325 + finalResult.activityEnter = handleSaleBannerSmallData(result[1].data);
335 } 326 }
336 327
337 return finalResult; 328 return finalResult;