...
|
...
|
@@ -166,21 +166,37 @@ const setSeoInfo = (goodInfo, nav) => { |
|
|
* @param { string } name 商品名称
|
|
|
* @return { Object } 面包屑导航数据
|
|
|
*/
|
|
|
const setPathNav = (data, name) => {
|
|
|
const setPathNav = (data, name, channel) => {
|
|
|
let resData = {};
|
|
|
let link = channel,
|
|
|
gender;
|
|
|
|
|
|
channel = channel || 'men';
|
|
|
|
|
|
switch (channel) {
|
|
|
case 'men': // 男
|
|
|
link = '';
|
|
|
gender = '1,3';
|
|
|
break;
|
|
|
case 'women': // 女
|
|
|
gender = '2,3';
|
|
|
break;
|
|
|
default: // 其它
|
|
|
gender = '1,2,3';
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if (!_.isEmpty(data)) {
|
|
|
let navs = [{
|
|
|
link: helpers.urlFormat(''),
|
|
|
name: 'MEN首页' // 待处理
|
|
|
link: helpers.urlFormat(`/${link}`),
|
|
|
name: `${_.toUpper(channel)}首页`
|
|
|
}];
|
|
|
let sort = data.sort[0];
|
|
|
|
|
|
navs.push({
|
|
|
link: helpers.urlFormat('/list', {
|
|
|
msort: sort.sort_id
|
|
|
|
|
|
// gender: '' // 待处理
|
|
|
msort: sort.sort_id,
|
|
|
gender: gender
|
|
|
}),
|
|
|
name: sort.sort_name,
|
|
|
pathTitle: sort.sort_name
|
...
|
...
|
@@ -191,9 +207,8 @@ const setPathNav = (data, name) => { |
|
|
navs.push({
|
|
|
link: helpers.urlFormat('/list', {
|
|
|
msort: sort.sort_id,
|
|
|
misort: sort.sub.sort_id
|
|
|
|
|
|
// gender: '' // 待处理
|
|
|
misort: sort.sub.sort_id,
|
|
|
gender: gender
|
|
|
}),
|
|
|
name: sort.sub[0].sort_name,
|
|
|
pathTitle: sort.sub[0].sort_name
|
...
|
...
|
|