...
|
...
|
@@ -314,7 +314,7 @@ const shopIntro = (params) => { |
|
|
* 店铺分类处理
|
|
|
* @param {*} params
|
|
|
*/
|
|
|
const category = (params, shopParams) => {
|
|
|
const category = (params, shopParams, isMip) => {
|
|
|
let categoryData = {
|
|
|
list: [],
|
|
|
url: ''
|
...
|
...
|
@@ -325,17 +325,29 @@ const category = (params, shopParams) => { |
|
|
}
|
|
|
|
|
|
if (params.length > 6) {
|
|
|
categoryData.url = helpers.urlFormat('/product/index/category', {
|
|
|
let opt = {
|
|
|
shop_id: shopParams.shopId
|
|
|
});
|
|
|
};
|
|
|
|
|
|
if (isMip) {
|
|
|
opt.union_type = '100000000013130';
|
|
|
}
|
|
|
|
|
|
categoryData.url = helpers.urlFormat('/product/index/category', opt);
|
|
|
} else {
|
|
|
_.forEach(params, value => {
|
|
|
let opt = {
|
|
|
shop_id: shopParams.shopId,
|
|
|
sort: (value.relation_parameter && value.relation_parameter.sort) || '',
|
|
|
title: value.category_name
|
|
|
};
|
|
|
|
|
|
if (isMip) {
|
|
|
opt.union_type = '100000000013130';
|
|
|
}
|
|
|
|
|
|
categoryData.list.push({
|
|
|
url: listParamsProcess.generatePathUrl({
|
|
|
shop_id: shopParams.shopId,
|
|
|
sort: (value.relation_parameter && value.relation_parameter.sort) || '',
|
|
|
title: value.category_name
|
|
|
}, `shop/${shopParams.domain}-${shopParams.shopId}`),
|
|
|
url: listParamsProcess.generatePathUrl(opt, `shop/${shopParams.domain}-${shopParams.shopId}`),
|
|
|
name: value.category_name
|
|
|
});
|
|
|
});
|
...
|
...
|
|