...
|
...
|
@@ -26,6 +26,13 @@ const _setHotKeywordData = (result, params, channel) => { |
|
|
// 获取商品数据和顶部筛选条件
|
|
|
if (result[1].code === 200) {
|
|
|
let data = result[1].data;
|
|
|
let goodsList = productProcess.processProductList(data.product_list,
|
|
|
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params));
|
|
|
|
|
|
goodsList.map(goods => {
|
|
|
goods.productTitle = `${params.query}|${goods.product_name}`;
|
|
|
return goods;
|
|
|
});
|
|
|
|
|
|
Object.assign(finalResult,
|
|
|
searchHandler.handlePathNavData({total: data.total}, params, 'search', channel),
|
...
|
...
|
@@ -34,8 +41,7 @@ const _setHotKeywordData = (result, params, channel) => { |
|
|
opts: searchHandler.handleOptsData(changeQuery, data.total),
|
|
|
totalCount: data.total,
|
|
|
footPager: searchHandler.handlePagerData(data.total, changeQuery),
|
|
|
goods: productProcess.processProductList(data.product_list,
|
|
|
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params)),
|
|
|
goods: goodsList,
|
|
|
hasNextPage: searchHandler.handleNextPage(changeQuery, data.total)
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -58,8 +64,12 @@ const _setHotKeywordData = (result, params, channel) => { |
|
|
|
|
|
finalResult.latestWalkExtra = [{
|
|
|
extraTabName: '相关推荐',
|
|
|
active: true,
|
|
|
extraGoodsList: productProcess.processProductList(data.product_list,
|
|
|
Object.assign({showDiscount: false, from: {type: 'hot', params: params}}, params))
|
|
|
}, {
|
|
|
extraTabName: '最近预览',
|
|
|
latestWalk: 5
|
|
|
}];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -96,7 +106,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
searchParams.need_filter = 'yes';
|
|
|
|
|
|
return Promise.all([
|
|
|
headerModel.requestHeaderData(channel),
|
|
|
headerModel.requestHeaderData(channel, true),
|
|
|
this.searchApi.getSeoProductList(searchParams, 'fuzzySearch'),
|
|
|
this.searchApi.getSeoProductList(Object.assign(searchParams, {
|
|
|
order: 's_n_desc',
|
...
|
...
|
@@ -130,14 +140,15 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
val.href = helpers.urlFormat(`/hot/${val.id}.html`);
|
|
|
return val;
|
|
|
});
|
|
|
let seoTDK = seoHandler.getHotKeywordsSeo(keyword.name, _.get(result, 'product.totalCount', '多'));
|
|
|
|
|
|
keyword.list = _.take(hotKeys, 6);
|
|
|
keyword.describe = keyword.describe || seoTDK.description;
|
|
|
|
|
|
Object.assign(result, {
|
|
|
hotKeys: _.drop(hotKeys, 6),
|
|
|
keyword: keyword,
|
|
|
latestWalk: 5
|
|
|
}, seoHandler.getHotKeywordsSeo(keyword.name, _.get(result, 'product.totalCount', '多')));
|
|
|
keyword: keyword
|
|
|
}, seoTDK);
|
|
|
|
|
|
return result;
|
|
|
});
|
...
|
...
|
|