Authored by 郭成尧

首页剥离goods

... ... @@ -35,16 +35,16 @@ exports.index = (req, res) => {
responseData.devEnv = true;
// 假数据输出
res.render('sale/index', Object.assign(responseData, simulation.saleIndex()));
// res.render('sale/index', Object.assign(responseData, simulation.saleIndex()));
// 真实数据输出
/* sale.getSaleIndexData().then(result => {
sale.getSaleIndexData().then(result => {
responseData.result = result;
responseData.resultShow = JSON.stringify(result, null, 4);
res.render('sale/index', responseData);
});*/
});
})
.catch(() => {
res.render('error', { devEnv: true, pageErr: true });
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-19 10:20:08
* @Last Modified by: Targaryen
* @Last Modified time: 2016-05-25 09:52:41
* @Last Modified time: 2016-05-25 10:00:24
*/
'use strict';
... ... @@ -313,7 +313,7 @@ const getSaleBannerList = () => {
*/
exports.getSaleIndexData = () => {
return api.all([getSaleActivityList(), getSaleGoodsList(), getSaleBannerList()]).then(result => {
return api.all([getSaleActivityList(), getSaleBannerList()]).then(result => {
var finalResult = {};
if (result[0].code === 200) {
... ... @@ -321,17 +321,8 @@ exports.getSaleIndexData = () => {
}
if (result[1].code === 200) {
if (!_.isEmpty(result[1].data.product_list)) { // 处理商品列表数据
finalResult.saleCategory = {};
finalResult.saleCategory.saleImage = [];
finalResult.saleCategory.saleImage.push(handleSaleGoodsListData(result[1].data.product_list));
}
}
if (result[2].code === 200) {
finalResult.topBanner = handleSaleBannerData(result[2].data);
finalResult.activityEnter = handleSaleBannerSmallData(result[2].data);
finalResult.topBanner = handleSaleBannerData(result[1].data);
finalResult.activityEnter = handleSaleBannerSmallData(result[1].data);
}
return finalResult;
... ...