Authored by 毕凯

Merge remote-tracking branch 'origin/feature/newSeo' into gray

@@ -24,6 +24,15 @@ const channelToAppChannel = (channel) => { @@ -24,6 +24,15 @@ const channelToAppChannel = (channel) => {
24 }[channel] || '1'; 24 }[channel] || '1';
25 }; 25 };
26 26
  27 +const channelSeo = (channel) => {
  28 + return {
  29 + boys: '男生',
  30 + girls: '女生',
  31 + kids: '潮童',
  32 + lifestyle: '创意生活'
  33 + }[channel] || '男生';
  34 +};
  35 +
27 // 新品到着(blk) 36 // 新品到着(blk)
28 const blkNewGoods = (req, res, next) => { 37 const blkNewGoods = (req, res, next) => {
29 let params = Object.assign({ 38 let params = Object.assign({
@@ -76,8 +85,9 @@ const newGoods = (req, res, next) => { @@ -76,8 +85,9 @@ const newGoods = (req, res, next) => {
76 res.render('new/new', { 85 res.render('new/new', {
77 module: 'product', 86 module: 'product',
78 page: 'new', 87 page: 'new',
79 -  
80 - // title: '新品到着', 88 + title: channelSeo(req.yoho.channel) + '新品上架,100%正品保证-YOHO!BUY 有货',
  89 + keywords: channelSeo(req.yoho.channel) + '新品,潮流新品,潮流正品',
  90 + description: channelSeo(req.yoho.channel) + '新品上架,正品网购,官方授权!100%品牌正品保证,支持货到付款。 想购买潮流商品就来YOHO! 有货中国最大的潮流商品购物网站。', // eslint-disable-line
81 pageHeader: headerModel.setNav({ 91 pageHeader: headerModel.setNav({
82 navTitle: '新品到着' 92 navTitle: '新品到着'
83 }), 93 }),
@@ -104,7 +114,7 @@ const newGoodsRedirect = (req, res) => { @@ -104,7 +114,7 @@ const newGoodsRedirect = (req, res) => {
104 if (param) { 114 if (param) {
105 param = '?' + param; 115 param = '?' + param;
106 } 116 }
107 - res.redirect(301, `/product/${req.yoho.channel}-new/${param}`); 117 + res.redirect(301, `/${req.yoho.channel}-new/${param}`);
108 }; 118 };
109 119
110 /** 120 /**
@@ -77,6 +77,22 @@ module.exports = () => { @@ -77,6 +77,22 @@ module.exports = () => {
77 req.url = `/product/${req.url}`; 77 req.url = `/product/${req.url}`;
78 } 78 }
79 79
  80 + if (/^\/boy-new/.test(req.url)) {
  81 + req.url = '/product/boys-new/';
  82 + }
  83 +
  84 + if (/^\/girls-new/.test(req.url)) {
  85 + req.url = '/product/girls-new/';
  86 + }
  87 +
  88 + if (/^\/kids-new/.test(req.url)) {
  89 + req.url = '/product/kids-new/';
  90 + }
  91 +
  92 + if (/^\/lifestyle-new/.test(req.url)) {
  93 + req.url = '/product/lifestyle-new/';
  94 + }
  95 +
80 next(); 96 next();
81 }; 97 };
82 }; 98 };