...
|
...
|
@@ -6,9 +6,6 @@ |
|
|
'use strict';
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
// const helpers = global.yoho.helpers;
|
|
|
// const utils = require('../../../utils');
|
|
|
|
|
|
const genderMap = {
|
|
|
boys: '1,3',
|
|
|
girls: '2,3',
|
...
|
...
|
@@ -39,34 +36,17 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
// 如果有二级菜单,二级菜单跳转,否则一级菜单跳转
|
|
|
if (firstItem.sub && firstItem.sub.length) {
|
|
|
_.map(firstItem.sub, function(secondItem) {
|
|
|
// secondItem.url = helpers.urlFormat('/', utils.mapSort({
|
|
|
// sort: _.get(secondItem, 'relation_parameter.sort'),
|
|
|
// sort_name: secondItem.category_name,
|
|
|
// gender: genderMap[key] || ''
|
|
|
// }), 'list');
|
|
|
secondItem.url =
|
|
|
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(secondItem, 'category_id')}`;
|
|
|
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(secondItem, 'category_id')}.html`;
|
|
|
});
|
|
|
|
|
|
firstItem.sub.unshift({
|
|
|
category_name: `全部${firstItem.category_name}`,
|
|
|
|
|
|
// url: helpers.urlFormat('/', utils.mapSort({
|
|
|
// sort: _.get(firstItem, 'relation_parameter.sort'),
|
|
|
// sort_name: firstItem.category_name,
|
|
|
// gender: genderMap[key] || ''
|
|
|
// }), 'list'),
|
|
|
url: `//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}?title=${firstItem.category_name}` // eslint-disable-line
|
|
|
url: `//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}.html?title=${firstItem.category_name}` // eslint-disable-line
|
|
|
});
|
|
|
} else {
|
|
|
// firstItem.url = helpers.urlFormat('/', utils.mapSort({
|
|
|
// sort: _.get(firstItem, 'relation_parameter.sort'),
|
|
|
// sort_name: firstItem.category_name,
|
|
|
// gender: genderMap[key] || ''
|
|
|
// }), 'list');
|
|
|
|
|
|
firstItem.url =
|
|
|
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}`;
|
|
|
`//m.yohobuy.com/list/gd${genderMap[key] || ''}-ci${_.get(firstItem, 'category_id')}.html`;
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
|