Authored by 郭成尧

sale-nav-url

@@ -93,7 +93,7 @@ let index = (req, res, next) => { @@ -93,7 +93,7 @@ let index = (req, res, next) => {
93 93
94 // 扩展头部频道选择数据 94 // 扩展头部频道选择数据
95 Object.assign(params.renderData.pageHeader, { 95 Object.assign(params.renderData.pageHeader, {
96 - saleNav: saleModel.saleNav(params.channel, req.params[0] || !req.query.channel) 96 + saleNav: saleModel.saleNav(params.channel)
97 }); 97 });
98 98
99 // 此处 channel 需要读取 cookies 的 channel 99 // 此处 channel 需要读取 cookies 的 channel
@@ -14,7 +14,6 @@ const processTime = require(`${utils}/time-process`); @@ -14,7 +14,6 @@ const processTime = require(`${utils}/time-process`);
14 const _ = require('lodash'); 14 const _ = require('lodash');
15 const api = global.yoho.API; 15 const api = global.yoho.API;
16 const serviceAPI = global.yoho.ServiceAPI; 16 const serviceAPI = global.yoho.ServiceAPI;
17 -const helpers = global.yoho.helpers;  
18 17
19 /** 18 /**
20 * 排序转换 19 * 排序转换
@@ -46,32 +45,28 @@ const channelType = { @@ -46,32 +45,28 @@ const channelType = {
46 * 产品要求,SALE的导航显示 Boy,Girl 单数形式 45 * 产品要求,SALE的导航显示 Boy,Girl 单数形式
47 */ 46 */
48 const channelHash = { 47 const channelHash = {
49 - boys: 'Boy',  
50 - girls: 'Girl',  
51 - kids: 'Kid', 48 + boys: 'Boys',
  49 + girls: 'Girls',
  50 + kids: 'Kids',
52 lifestyle: 'Lifestyle' 51 lifestyle: 'Lifestyle'
53 }; 52 };
54 53
55 -const saleNav = (channel, shortUrl) => { 54 +const saleNav = (channel) => {
56 return { 55 return {
57 channel: channelHash[channel], 56 channel: channelHash[channel],
58 list: [ 57 list: [
59 { 58 {
60 - title: 'Boy',  
61 - url: shortUrl ? helpers.urlFormat('/product/boys-sale/') :  
62 - helpers.urlFormat('/product/sale', {channel: 'boys'}) 59 + title: 'Boys',
  60 + url: '/boys-sale'
63 }, { 61 }, {
64 - title: 'Girl',  
65 - url: shortUrl ? helpers.urlFormat('/product/girls-sale/') :  
66 - helpers.urlFormat('/product/sale', {channel: 'girls'}) 62 + title: 'Girls',
  63 + url: '/girls-sale'
67 }, { 64 }, {
68 - title: 'Kid',  
69 - url: shortUrl ? helpers.urlFormat('/product/kids-sale/') :  
70 - helpers.urlFormat('/product/sale', {channel: 'kids'}) 65 + title: 'Kids',
  66 + url: '/kids-sale'
71 }, { 67 }, {
72 title: 'Lifestyle', 68 title: 'Lifestyle',
73 - url: shortUrl ? helpers.urlFormat('/product/lifestyle-sale/') :  
74 - helpers.urlFormat('/product/sale', {channel: 'lifestyle'}) 69 + url: '/lifestyle-sale'
75 } 70 }
76 ] 71 ]
77 }; 72 };