Authored by 郭成尧

'首页断码区参数'

... ... @@ -677,9 +677,10 @@ exports.handleSaleBannerSmallData = (origin) => {
* @param origin 要处理的原始数据
* @param saleType 获取数据分属哪个类目:断码区,会员专享,折扣专场等
* @param channel 频道
* @param breakingSizeSort 为断码去额外拼接参数,接口比较垃圾嘛,没办法
* @returns {{}}
*/
exports.handleSaleCategoryData = (origin, saleType, channel) => {
exports.handleSaleCategoryData = (origin, saleType, channel, breakingSizeSort) => {
let dest = {};
... ... @@ -695,7 +696,8 @@ exports.handleSaleCategoryData = (origin, saleType, channel) => {
switch (saleType) {
case '1':
dest.title = '断码区';
urlLocation.url = '?saleType=' + saleType + '&order=s_t_desc&channel=' + channel;
urlLocation.url = '?saleType=' + saleType + '&order=s_t_desc&channel=' + channel +
'&breakSize=' + breakingSizeSort.breakSize + '&breakSort=' + breakingSizeSort.breakSort;
urlLocation.limit = 14;
dest.urlLocation = dest.navItem[0].urlLocation = urlLocation.url + `&limit=${urlLocation.limit}`;
break;
... ...
... ... @@ -140,7 +140,8 @@ exports.getSaleIndexData = (channel) => {
saleApi.getSaleActivityList('', channel),
saleApi.getSaleBannerList(contentCode[channel].sale),
saleApi.getSaleGoodsList({channel: channel, saleType: '2', limit: '1'}), // 会员专享分类
saleApi.getSaleGoodsList({channel: channel, saleType: '1', limit: '1'}), // 断码区分类
// saleApi.getSaleGoodsList({channel: channel, saleType: '1', limit: '1'}), // 断码区分类
saleApi.getSalebreakingYardsSortList({channel: channel}), // 断码区尺码数据
saleApi.getSaleGoodsList({channel: channel, saleType: '3', limit: '1'}) // 最新降价分类
]).then(result => {
var finalResult = result[0];
... ... @@ -167,10 +168,26 @@ exports.getSaleIndexData = (channel) => {
// 断码区分类处理
if (result[4].code === 200) {
let breakingSizeSort = saleHandler.handleSaleBreakingSizeData(result[4].data);
return api.all([saleApi.getSaleGoodsList({
channel: channel,
saleType: '1',
limit: '1'
})]).then(subResult => {
if (subResult[0].code === 200) {
finalResult.saleCategory.push(
saleHandler.handleSaleCategoryData(
subResult[0].data.filter.group_sort,
'1',
channel,
breakingSizeSort
)
);
return finalResult;
}
});
finalResult.saleCategory.push(
saleHandler.handleSaleCategoryData(result[4].data.filter.group_sort, '1', channel)
);
}
// 最新降价分类处理
... ...