...
|
...
|
@@ -82,3 +82,54 @@ exports.getListData = (params) => { |
|
|
return finalResult;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取新品到着数据
|
|
|
*/
|
|
|
exports.getListNewData = (params) => {
|
|
|
// 调用接口
|
|
|
let apiMethod = [
|
|
|
headerModel.requestHeaderData(),
|
|
|
searchApi.getSortList(),
|
|
|
searchApi.getProductList(params),
|
|
|
searchApi.getWeekNew(params)
|
|
|
];
|
|
|
|
|
|
return api.all(apiMethod).then(result => {
|
|
|
let finalResult = {
|
|
|
headerData: Object.assign(result[0].headerData, {
|
|
|
header: true
|
|
|
}),
|
|
|
list: {
|
|
|
leftContent: {}
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 获取左侧类目数据
|
|
|
if (result[1].code === 200) {
|
|
|
finalResult.list = {
|
|
|
leftContent: searchHandler.handleSortData(result[1].data.sort, params),
|
|
|
pathNav: searchHandler.handlePathNavData(result[1].data.sort, params, 'new')
|
|
|
};
|
|
|
}
|
|
|
|
|
|
// 获取商品数据和顶部筛选条件
|
|
|
if (result[2].code === 200) {
|
|
|
Object.assign(finalResult.list, {
|
|
|
filters: searchHandler.handleFilterData(result[2].data.filter, params),
|
|
|
opts: searchHandler.handleOptsData(params, result[2].data.total, result[2].data.filter),
|
|
|
totalCount: result[2].data.total,
|
|
|
footPager: searchHandler.handlePagerData(result[2].data.total, params),
|
|
|
goods: productProcess.processProductList(result[2].data.product_list,
|
|
|
Object.assign({showDiscount: false}, params))
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 新品上架
|
|
|
if (result[3] && result[3].code === 200) {
|
|
|
Object.assign(finalResult.list.leftContent, searchHandler.handleWeekNew(result[3].data, params));
|
|
|
}
|
|
|
|
|
|
return finalResult;
|
|
|
});
|
|
|
}; |
...
|
...
|
|