Authored by 郭成尧

'opts筛选数据随条件改变'

... ... @@ -218,11 +218,19 @@ exports.getSaleOthersData = (params, channel) => {
if (result[1].code === 200) {
finalResult.goods = productProcess.processProductList(result[1].data.product_list);
// 处理所有商品标题数据
finalResult.saleTitle = {};
// 顶部筛选条件
finalResult.filters = saleHandler.handleSaleFilterData(result[1].data.filter, params);
finalResult.saleTitle.name = '所有商品';
finalResult.saleTitle.count = result[1].data.total;
// 处理排序数据
finalResult.opts = saleHandler.handleSaleOptsData(params, result[1].data.total);
finalResult.totalCount = result[1].data.total;
finalResult.pager = saleHandler.handleSalePagerData(result[1].data.total, params);
// 处理所有商品标题数据
finalResult.saleTitle = {
name: '所有商品',
count: result[1].data.total
};
}
// 获取焦点图数据
... ... @@ -236,13 +244,6 @@ exports.getSaleOthersData = (params, channel) => {
// 获取左侧类目数据
finalResult.leftContent = saleHandler.handleSaleSortData(result[3].data.filter.group_sort, params);
// 顶部筛选条件
finalResult.filters = saleHandler.handleSaleFilterData(result[3].data.filter, params);
// 处理排序数据
finalResult.opts = saleHandler.handleSaleOptsData(params, result[3].data.total);
finalResult.totalCount = result[3].data.total;
finalResult.pager = saleHandler.handleSalePagerData(result[3].data.total, params);
}
if (!_.isEmpty(result[4])) {
... ... @@ -294,7 +295,9 @@ exports.getSaleDiscountData = (params, channel) => {
if (result[1].code === 200) {
finalResult.saleList = {};
finalResult.saleList.goods = productProcess.processProductList(result[1].data.product_list);
finalResult.saleList.totalCount = result[1].data.total;
finalResult.saleList.pager = saleHandler.handleSalePagerData(result[1].data.total, params);
finalResult.saleList.opts = saleHandler.handleSaleOptsData(params, result[1].data.total);
}
// 处理折扣专场标题 banner 数据
... ... @@ -311,9 +314,6 @@ exports.getSaleDiscountData = (params, channel) => {
// 处理分页等筛选信息
if (result[3].code === 200) {
finalResult.leftContent = saleHandler.handleSaleSortData(result[3].data.filter.group_sort, params);
finalResult.saleList.totalCount = result[3].data.total;
finalResult.saleList.pager = saleHandler.handleSalePagerData(result[3].data.total, params);
finalResult.saleList.opts = saleHandler.handleSaleOptsData(params, result[3].data.total);
}
... ... @@ -359,22 +359,19 @@ exports.getSalebreakingYardsData = (params, channel) => {
]).then(subResult => {
// 处理筛选条件数据
if (subResult[0].code === 200) {
finalResult.filters = saleHandler.handleSaleFilterData(
Object.assign(subResult[0].data.filter, {size: result[2].data}),
params);
finalResult.leftContent =
saleHandler.handleSaleSortData(subResult[0].data.filter.group_sort, params);
finalResult.opts = saleHandler.handleSaleOptsData(params, subResult[0].data.total);
finalResult.totalCount = subResult[0].data.total;
finalResult.pager = saleHandler.handleSalePagerData(subResult[0].data.total, params);
}
// 处理商品数据
if (subResult[1].code === 200) {
finalResult.filters = saleHandler.handleSaleFilterData(
Object.assign(subResult[1].data.filter, {size: result[2].data}),
params);
finalResult.goods = productProcess.processProductList(subResult[1].data.product_list);
finalResult.opts = saleHandler.handleSaleOptsData(params, subResult[1].data.total);
finalResult.totalCount = subResult[1].data.total;
finalResult.pager = saleHandler.handleSalePagerData(subResult[1].data.total, params);
// 处理所有商品标题数据
finalResult.saleTitle = {};
... ...