...
|
...
|
@@ -160,12 +160,14 @@ const index = (req) => { |
|
|
page: req.query.page || 1
|
|
|
});
|
|
|
|
|
|
let cateId = req.query.cateId || '';
|
|
|
|
|
|
let apiMethod = [
|
|
|
headerModel.requestHeaderData(channel),
|
|
|
api.recShop(shopParams),
|
|
|
api.recBrand(params),
|
|
|
api.recList(Object.assign({}, params)),//获取品类
|
|
|
api.recList(recParams)//获取商品数据
|
|
|
api.recList(Object.assign({}, params)), // 获取品类
|
|
|
api.recList(recParams)// 获取商品数据
|
|
|
];
|
|
|
|
|
|
return Promise.all(apiMethod).then(result => {
|
...
|
...
|
@@ -260,14 +262,17 @@ const index = (req) => { |
|
|
_.forEach(group.sub, subSort =>{
|
|
|
let cateObj = {
|
|
|
cateId: subSort.category_id,
|
|
|
url: publicHandler.handleFilterUrl(params, {sort: subSort.relation_parameter.sort}),
|
|
|
url: publicHandler.handleFilterUrl(params, {
|
|
|
sort: subSort.relation_parameter.sort,
|
|
|
cateId: subSort.category_id
|
|
|
}),
|
|
|
name: subSort.category_name,
|
|
|
active: false
|
|
|
};
|
|
|
|
|
|
|
|
|
if (ctyList.length < 20) {
|
|
|
//默认选中判断
|
|
|
if (req.query.sort === subSort.relation_parameter.sort) {
|
|
|
// 默认选中判断
|
|
|
if (cateId === subSort.category_id) {
|
|
|
cateObj.active = true;
|
|
|
}
|
|
|
ctyList.push(cateObj);
|
...
|
...
|
@@ -283,7 +288,7 @@ const index = (req) => { |
|
|
if (result[4].code === 200 && result[4].data) {
|
|
|
// 列表数据
|
|
|
Object.assign(respData.newProduct, _proListHandler(result[4].data,
|
|
|
Object.assign({}, recParams, {channel: channel})));
|
|
|
Object.assign({}, recParams, {channel: channel, cateId: cateId})));
|
|
|
}
|
|
|
|
|
|
// 数据为空,不显示页面模块
|
...
|
...
|
@@ -321,6 +326,7 @@ const getRecList = (req) => { |
|
|
|
|
|
Object.assign(params, {
|
|
|
sort: req.query.sort || '',
|
|
|
cateId: req.query.cateId || '',
|
|
|
page: req.query.page || 1
|
|
|
});
|
|
|
|
...
|
...
|
|