...
|
...
|
@@ -7,6 +7,7 @@ |
|
|
const _ = require('lodash');
|
|
|
const api = global.yoho.API;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const utils = require('../../../utils');
|
|
|
|
|
|
const genderMap = {
|
|
|
boys: '1,3',
|
...
|
...
|
@@ -33,27 +34,27 @@ let _processCateData = (list, channel) => { |
|
|
// 如果有二级菜单,二级菜单跳转,否则一级菜单跳转
|
|
|
if (firstItem.sub && firstItem.sub.length) {
|
|
|
_.map(firstItem.sub, function(secondItem) {
|
|
|
secondItem.url = helpers.urlFormat('/', {
|
|
|
secondItem.url = helpers.urlFormat('/', utils.mapSort({
|
|
|
sort: _.get(secondItem, 'relation_parameter.sort'),
|
|
|
sort_name: secondItem.category_name,
|
|
|
gender: genderMap[key] || ''
|
|
|
}, 'list');
|
|
|
}), 'list');
|
|
|
});
|
|
|
|
|
|
firstItem.sub.unshift({
|
|
|
category_name: `全部${firstItem.category_name}`,
|
|
|
url: helpers.urlFormat('/', {
|
|
|
url: helpers.urlFormat('/', utils.mapSort({
|
|
|
sort: _.get(firstItem, 'relation_parameter.sort'),
|
|
|
sort_name: firstItem.category_name,
|
|
|
gender: genderMap[key] || ''
|
|
|
}, 'list')
|
|
|
}), 'list')
|
|
|
});
|
|
|
} else {
|
|
|
firstItem.url = helpers.urlFormat('/', {
|
|
|
firstItem.url = helpers.urlFormat('/', utils.mapSort({
|
|
|
sort: _.get(firstItem, 'relation_parameter.sort'),
|
|
|
sort_name: firstItem.category_name,
|
|
|
gender: genderMap[key] || ''
|
|
|
}, 'list');
|
|
|
}), 'list');
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
|