...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2016-05-19 10:20:08
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2016-06-07 13:11:53
|
|
|
* @Last Modified time: 2016-06-07 13:48:17
|
|
|
*/
|
|
|
|
|
|
'use strict';
|
...
|
...
|
@@ -189,14 +189,14 @@ exports.getSaleOthersData = (params, channel) => { |
|
|
promiseObject = [
|
|
|
saleApi.getSaleGoodsList(params),
|
|
|
saleApi.getSaleBannerList(contentCode[channel].vip),
|
|
|
saleApi.getLeftContentList(),
|
|
|
saleApi.getSaleGoodsList({ saleType: '2', limit: '1', channel: channel }),
|
|
|
saleApi.getUserProfile(params.uid)
|
|
|
];
|
|
|
} else {
|
|
|
promiseObject = [
|
|
|
saleApi.getSaleGoodsList(params),
|
|
|
saleApi.getSaleBannerList(contentCode[channel].vip),
|
|
|
saleApi.getLeftContentList()
|
|
|
saleApi.getSaleGoodsList({ saleType: '3', limit: '1', channel: channel })
|
|
|
];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -204,23 +204,9 @@ exports.getSaleOthersData = (params, channel) => { |
|
|
return api.all(promiseObject).then(result => {
|
|
|
let finalResult = {};
|
|
|
|
|
|
// 获取商品数据和顶部筛选条件
|
|
|
// 获取商品数据
|
|
|
if (result[0].code === 200) {
|
|
|
finalResult.goods = productProcess.processProductList(result[0].data.product_list);
|
|
|
if (!_.isEmpty(result[0].data.filter)) {
|
|
|
finalResult.filters = saleHandler.handleSaleFilterData(result[0].data.filter, params);
|
|
|
}
|
|
|
|
|
|
// 处理排序数据
|
|
|
finalResult.opts = saleHandler.handleSaleOptsData(params, result[0].data.total);
|
|
|
finalResult.totalCount = result[0].data.total;
|
|
|
finalResult.pager = saleHandler.handleSalePagerData(result[0].data.total, params);
|
|
|
|
|
|
// 处理所有商品标题数据
|
|
|
finalResult.saleTitle = {};
|
|
|
|
|
|
finalResult.saleTitle.name = '所有商品';
|
|
|
finalResult.saleTitle.count = finalResult.totalCount;
|
|
|
}
|
|
|
|
|
|
// 获取焦点图数据
|
...
|
...
|
@@ -228,13 +214,25 @@ exports.getSaleOthersData = (params, channel) => { |
|
|
finalResult.topBanner = saleHandler.handleSaleBannerData(result[1].data);
|
|
|
}
|
|
|
|
|
|
// 获取左侧类目数据
|
|
|
// 获取分类筛选数据
|
|
|
if (result[2].code === 200) {
|
|
|
if (params.gender === '2,3') {
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[2].data.girl, params);
|
|
|
} else {
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[2].data.boy, params);
|
|
|
}
|
|
|
|
|
|
// 获取左侧类目数据
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[2].data.filter.group_sort, params);
|
|
|
|
|
|
// 顶部筛选条件
|
|
|
finalResult.filters = saleHandler.handleSaleFilterData(result[2].data.filter, params);
|
|
|
|
|
|
// 处理排序数据
|
|
|
finalResult.opts = saleHandler.handleSaleOptsData(params, result[2].data.total);
|
|
|
finalResult.totalCount = result[2].data.total;
|
|
|
finalResult.pager = saleHandler.handleSalePagerData(result[2].data.total, params);
|
|
|
|
|
|
// 处理所有商品标题数据
|
|
|
finalResult.saleTitle = {};
|
|
|
|
|
|
finalResult.saleTitle.name = '所有商品';
|
|
|
finalResult.saleTitle.count = finalResult.totalCount;
|
|
|
}
|
|
|
|
|
|
if (!_.isEmpty(result[3])) {
|
...
|
...
|
@@ -293,7 +291,7 @@ exports.getSaleDiscountData = (params, channel) => { |
|
|
finalResult.saleTitle = {};
|
|
|
|
|
|
finalResult.saleTitle.name = '所有商品';
|
|
|
finalResult.saleTitle.count = finalResult.totalCount;
|
|
|
finalResult.saleTitle.count = finalResult.saleList.totalCount;
|
|
|
}
|
|
|
|
|
|
// 处理焦点图数据
|
...
|
...
|
@@ -322,7 +320,7 @@ exports.getSalebreakingYardsData = (params, channel) => { |
|
|
saleApi.getSaleGoodsList(params),
|
|
|
saleApi.getSalebreakingYardsSortList(params),
|
|
|
saleApi.getSaleBannerList(contentCode[channel].breakCode),
|
|
|
saleApi.getLeftContentList()
|
|
|
saleApi.getSaleGoodsList({ channel: channel, saleType: '1', limit: '1' })
|
|
|
]).then(result => {
|
|
|
let finalResult = {};
|
|
|
|
...
|
...
|
@@ -354,12 +352,7 @@ exports.getSalebreakingYardsData = (params, channel) => { |
|
|
}
|
|
|
|
|
|
if (result[3].code === 200) {
|
|
|
if (params.gender === '2,3') {
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[3].data.girl, params);
|
|
|
} else {
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[3].data.boy, params);
|
|
|
}
|
|
|
|
|
|
finalResult.leftContent = saleHandler.handleSaleSortData(result[3].data.filter.group_sort, params);
|
|
|
}
|
|
|
|
|
|
return finalResult;
|
...
|
...
|
|