Authored by 周少峰

Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuy-node into release/4.6

... ... @@ -82,10 +82,16 @@ exports.getOutletsIndexData = (params, channel) => {
};
// 添加锚点
if (!_.isEmpty(finalResult.goodsBoard.sort.sortType)) {
if (finalResult.goodsBoard.sort.sortType) {
_.forEach(finalResult.goodsBoard.sort.sortType, (value, key) => {
finalResult.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (finalResult.goodsBoard.sort.preHref) {
finalResult.goodsBoard.sort.preHref += '#otspool';
}
if (finalResult.goodsBoard.sort.nextHref) {
finalResult.goodsBoard.sort.nextHref += '#otspool';
}
}
finalResult.pager = publicHandler.handleSalePagerData(result[5].data.total, params);
... ... @@ -168,6 +174,12 @@ exports.getOutletsChannelData = (params, channel) => {
_.forEach(channelData.goodsBoard.sort.sortType, (value, key) => {
channelData.goodsBoard.sort.sortType[key].href += '#otspool';
});
if (finalResult.goodsBoard.sort.preHref) {
finalResult.goodsBoard.sort.preHref += '#otspool';
}
if (finalResult.goodsBoard.sort.nextHref) {
finalResult.goodsBoard.sort.nextHref += '#otspool';
}
}
}
... ... @@ -183,36 +195,33 @@ exports.getOutletsChannelData = (params, channel) => {
exports.getOutletsSpecialData = (params, channel) => {
return api.all([
headerModel.requestHeaderData('outlets'),
outletsApi.getOutletsActivityOrigin({
outletsApi.getOutletsActivityOrigin({ // 获取活动信息
id: params.id
})
]).then(result => {
let specialData = {};
specialData.headerData = {};
specialData.headerData = result[0].headerData;
specialData.headerData.header = true;
Object.assign(specialData, result[0]);
specialData.headerData.headType = 'outlets';
specialData.pageErr = true;
if (result[1].code === 200) {
delete specialData.pageErr;
Object.assign(specialData,
outletsProcess.handleOutletsSpecilData(result[1].data[0]));
return api.all([
list.getListData(Object.assign({
productPool: result[1].data[0].productPoolId,
saleType: 4
}, params), channel)
]).then(data => {
specialData.specialHead.count = data[0].totalCount;
Object.assign(specialData, data[0]);
return specialData;
});
if (result[1].code !== 200) {
// 活动信息获取异常
throw new Error('fail_to_get_special_info_with_ID:' + params.id);
}
return specialData;
Object.assign(specialData,
outletsProcess.handleOutletsSpecilData(result[1].data[0]));
return api.all([
list.getListData(Object.assign({
productPool: result[1].data[0].productPoolId,
saleType: 4
}, params), channel)
]).then(data => {
specialData.specialHead.count = data[0].totalCount;
Object.assign(specialData, data[0]);
return specialData;
});
});
};
... ...