...
|
...
|
@@ -63,8 +63,9 @@ exports.getSaleGoodsData = (params) => { |
|
|
if (result[0].code === 200) {
|
|
|
finalResult.goods = productProcess.processProductList(result[0].data.product_list);
|
|
|
_.forEach(finalResult.goods, (value, key) => {
|
|
|
finalResult.goods[key].tags.isNew = false; // 屏蔽 new 标签
|
|
|
finalResult.goods[key].tags.isSale = false;
|
|
|
delete finalResult.goods[key].tags.isNew; // 屏蔽 new 标签
|
|
|
delete finalResult.goods[key].tags.isSale;// 屏蔽 sale 标签
|
|
|
delete finalResult.goods[key].discount; // 屏蔽折扣信息
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -315,47 +316,54 @@ exports.getSaleOthersData = (params, channel) => { |
|
|
exports.getSaleDiscountData = (params, channel) => {
|
|
|
return api.all([
|
|
|
headerModel.requestHeaderData(channel),
|
|
|
saleApi.getSaleGoodsList(params),
|
|
|
saleApi.getSaleActivityList(params, channel),
|
|
|
saleApi.getSaleGoodsList({channel: channel, saleType: '3', limit: '1'})
|
|
|
saleApi.getSaleGoodsList({channel: channel, saleType: '3', limit: '1'}),
|
|
|
saleApi.getSaleActivityList(params, channel)
|
|
|
]).then(result => {
|
|
|
let finalResult = result[0];
|
|
|
|
|
|
// 处理商品数据,顶部分类
|
|
|
// 处理折扣专场标题 banner 数据
|
|
|
if (result[1].code === 200) {
|
|
|
finalResult.saleList = {};
|
|
|
finalResult.saleList.goods = productProcess.processProductList(result[1].data.product_list);
|
|
|
finalResult.saleList.totalCount = result[1].data.total;
|
|
|
|
|
|
_.forEach(finalResult.saleList.goods, (value, key) => {
|
|
|
delete finalResult.saleList.goods[key].tags.isNew; // 屏蔽 new 标签
|
|
|
delete finalResult.saleList.goods[key].tags.isSale;// 屏蔽 sale 标签
|
|
|
delete finalResult.saleList.goods[key].discount; // 屏蔽折扣信息
|
|
|
Object.assign(finalResult, {
|
|
|
leftContent: publicHandler.handleSaleSortData(result[1].data.filter.group_sort, params, 'discount'),
|
|
|
saleList: {
|
|
|
pager: publicHandler.handleSalePagerData(result[1].data.total, params),
|
|
|
opts: publicHandler.handleSaleOptsData(params, result[1].data.total)
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 处理折扣专场标题 banner 数据
|
|
|
// 处理分页等筛选信息
|
|
|
if (result[2].code === 200) {
|
|
|
|
|
|
if (_.size(result[2].data) === 1) {
|
|
|
finalResult.saleTitle = saleHandler.handleDiscountTitleData(result[2].data[0]);
|
|
|
finalResult.topBanner = {};
|
|
|
finalResult.topBanner.list = [];
|
|
|
finalResult.topBanner.list[0] = {};
|
|
|
finalResult.topBanner.list[0].img = result[2].data[0].web_url;
|
|
|
}
|
|
|
finalResult.topBanner.list[0] = {
|
|
|
img: result[2].data[0].web_url
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// 处理分页等筛选信息
|
|
|
if (result[3].code === 200) {
|
|
|
finalResult.leftContent =
|
|
|
publicHandler.handleSaleSortData(result[3].data.filter.group_sort, params, 'discount');
|
|
|
finalResult.saleList.pager = publicHandler.handleSalePagerData(result[3].data.total, params);
|
|
|
finalResult.saleList.opts = publicHandler.handleSaleOptsData(params, result[3].data.total);
|
|
|
}
|
|
|
return api.all([
|
|
|
saleApi.getSaleGoodsList(Object.assign(params, {productPool: result[2].data[0].product_pool}))
|
|
|
]).then(subResult => {
|
|
|
// 处理商品数据,顶部分类
|
|
|
if (subResult[0].code === 200) {
|
|
|
finalResult.saleList.goods = productProcess.processProductList(subResult[0].data.product_list);
|
|
|
finalResult.saleList.totalCount = subResult[0].data.total;
|
|
|
|
|
|
_.forEach(finalResult.saleList.goods, (value, key) => {
|
|
|
delete finalResult.saleList.goods[key].tags.isNew; // 屏蔽 new 标签
|
|
|
delete finalResult.saleList.goods[key].tags.isSale;// 屏蔽 sale 标签
|
|
|
delete finalResult.saleList.goods[key].discount; // 屏蔽折扣信息
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return finalResult;
|
|
|
});
|
|
|
}
|
|
|
return finalResult;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -409,17 +417,18 @@ exports.getSalebreakingYardsData = (params, channel) => { |
|
|
Object.assign(subResult[1].data.filter, {size: result[2].data}),
|
|
|
params);
|
|
|
}
|
|
|
|
|
|
finalResult.goods = productProcess.processProductList(subResult[1].data.product_list);
|
|
|
finalResult.opts = publicHandler.handleSaleOptsData(params, subResult[1].data.total);
|
|
|
finalResult.totalCount = subResult[1].data.total;
|
|
|
finalResult.pager = publicHandler.handleSalePagerData(subResult[1].data.total, params);
|
|
|
Object.assign(finalResult, {
|
|
|
goods: productProcess.processProductList(subResult[1].data.product_list),
|
|
|
opts: publicHandler.handleSaleOptsData(params, subResult[1].data.total),
|
|
|
totalCount: subResult[1].data.total,
|
|
|
pager: publicHandler.handleSalePagerData(subResult[1].data.total, params)
|
|
|
});
|
|
|
|
|
|
// 处理所有商品标题数据
|
|
|
finalResult.saleTitle = {};
|
|
|
|
|
|
finalResult.saleTitle.name = '所有商品';
|
|
|
finalResult.saleTitle.count = subResult[1].data.count;
|
|
|
finalResult.saleTitle = {
|
|
|
name: '所有商品',
|
|
|
count: subResult[1].data.count
|
|
|
};
|
|
|
|
|
|
_.forEach(finalResult.goods, (value, key) => {
|
|
|
delete finalResult.goods[key].tags.isNew; // 屏蔽 new 标签
|
...
|
...
|
|