Authored by yyq

Merge branch 'feature/globalDetailSeo' into release/5.8

@@ -283,21 +283,31 @@ module.exports = class extends global.yoho.BaseModel { @@ -283,21 +283,31 @@ module.exports = class extends global.yoho.BaseModel {
283 } 283 }
284 }); 284 });
285 285
  286 + let ht;
  287 +
286 if (params.keywords) { 288 if (params.keywords) {
287 nav = [ 289 nav = [
288 { 290 {
289 name: '搜索结果' 291 name: '搜索结果'
290 } 292 }
291 ]; 293 ];
  294 +
  295 + ht = `${params.keywords}`;
292 } else { 296 } else {
293 nav = _this._getNav(params.id, menuData, params.url); 297 nav = _this._getNav(params.id, menuData, params.url);
  298 + ht = _.last(nav).name;
294 } 299 }
295 300
296 return { 301 return {
297 nav: nav, 302 nav: nav,
298 data: { 303 data: {
299 menuData: menuData, 304 menuData: menuData,
300 - contData: contData 305 + contData: contData,
  306 + seoData: {
  307 + title: `有货${ht}-帮助中心-YOHO!BUY有货 100%正品保证`,
  308 + keywords: `${ht},有货${ht},有货${ht}帮助中心`,
  309 + description: `有货${ht}YOHO!BUY有货帮助中心${ht}频道,提供有关${ht}相关问题解答。YOHO!BUY有货100%品牌正品保证,支持货到付款。`
  310 + }
301 } 311 }
302 }; 312 };
303 } 313 }
@@ -140,6 +140,23 @@ const _handelGlobalSort = (origin, params, originParams) => { @@ -140,6 +140,23 @@ const _handelGlobalSort = (origin, params, originParams) => {
140 }; 140 };
141 }; 141 };
142 142
  143 +const _getProductSeoData = (detail) => {
  144 + let resData = {};
  145 +
  146 + if (!_.isEmpty(detail)) {
  147 + let gn = detail.product_name,
  148 + bn = _.get(detail, 'brand_info.brand_name') || detail.product_source;
  149 +
  150 + resData = {
  151 + title: `${bn} | ${gn}正品 | YOHO!BUY 有货`,
  152 + keywords: `${bn},${bn}官网专卖店,${bn}官方授权店,${bn}正品,${bn}打折,${bn}折扣店,${bn}真品,${bn}代购`,
  153 + description: `YOHO!BUY 有货-${bn}官方授权店,${gn}图片、报价、介绍。YOHO!BUY 有货${bn}官网专卖店提供${bn}正品、${bn}真品、 ${bn}打折、${bn}代购等。` // eslint-disable-line
  154 + };
  155 + }
  156 +
  157 + return resData;
  158 +};
  159 +
143 const getGlobalProductListData = (params, yoho) => { 160 const getGlobalProductListData = (params, yoho) => {
144 let limitNum = params.limit ? params.limit - 1 : 59; 161 let limitNum = params.limit ? params.limit - 1 : 59;
145 let dps = {}; 162 let dps = {};
@@ -340,7 +357,7 @@ const getGlobalProductDetailData = (skn, channelNum, channel) => { @@ -340,7 +357,7 @@ const getGlobalProductDetailData = (skn, channelNum, channel) => {
340 Object.assign(resData, result.header, { 357 Object.assign(resData, result.header, {
341 goodsInfo: detailInfo, 358 goodsInfo: detailInfo,
342 detailHtml: html || '' 359 detailHtml: html || ''
343 - }); 360 + }, _getProductSeoData(detailInfo));
344 361
345 return resData; 362 return resData;
346 }); 363 });
@@ -31,6 +31,75 @@ module.exports = [ @@ -31,6 +31,75 @@ module.exports = [
31 origin: '/new?order=s_t_desc&msort=10', 31 origin: '/new?order=s_t_desc&msort=10',
32 target: helpers.urlFormat('/lifestyle-new/', null, 'list') 32 target: helpers.urlFormat('/lifestyle-new/', null, 'list')
33 }, 33 },
  34 + // 男生销售类目一级菜单
  35 + {
  36 + type: TYPE.redirect,
  37 + origin: '/?gender=1,3&msort=1,3',
  38 + target: helpers.urlFormat('/?category_id=5,8&gender=1,3', null, 'list')
  39 + },
  40 + {
  41 + type: TYPE.redirect,
  42 + origin: '/?gender=1,3&msort=6',
  43 + target: helpers.urlFormat('/?category_id=11&gender=1,3', null, 'list')
  44 + },
  45 + {
  46 + type: TYPE.redirect,
  47 + origin: '/?gender=1,3&msort=7',
  48 + target: helpers.urlFormat('/?category_id=14&gender=1,3', null, 'list')
  49 + },
  50 + {
  51 + type: TYPE.redirect,
  52 + origin: '/?gender=1,3&msort=8',
  53 + target: helpers.urlFormat('/?category_id=17&gender=1,3', null, 'list')
  54 + },
  55 + // 女生销售类目一级菜单
  56 + {
  57 + type: TYPE.redirect,
  58 + origin: '/?gender=2,3&msort=1,3',
  59 + target: helpers.urlFormat('/?category_id=18,31,25&gender=2,3', null, 'list')
  60 + },
  61 + {
  62 + type: TYPE.redirect,
  63 + origin: '/?gender=2,3&msort=6',
  64 + target: helpers.urlFormat('/?category_id=52&gender=2,3', null, 'list')
  65 + },
  66 + {
  67 + type: TYPE.redirect,
  68 + origin: '/?gender=2,3&msort=7',
  69 + target: helpers.urlFormat('/?category_id=59&gender=2,3', null, 'list')
  70 + },
  71 + {
  72 + type: TYPE.redirect,
  73 + origin: '/?gender=2,3&msort=8,10,241',
  74 + target: helpers.urlFormat('/?category_id=76&gender=2,3', null, 'list')
  75 + },
  76 + // 潮童销售类目一级菜单
  77 + {
  78 + type: TYPE.redirect,
  79 + origin: '/?gender=1,2,3&misort=382,368,372,448,392,388,384,414,429,390,425,464&msort=365',
  80 + target: helpers.urlFormat('/?category_id=13,16,15&gender=1,2,3', null, 'list')
  81 + },
  82 + // 创意生活销售类目一级菜单
  83 + {
  84 + type: TYPE.redirect,
  85 + origin: '/?msort=10&misort=103',
  86 + target: helpers.urlFormat('/?category_id=21', null, 'list')
  87 + },
  88 + {
  89 + type: TYPE.redirect,
  90 + origin: '/?msort=10&misort=266',
  91 + target: helpers.urlFormat('/?category_id=20', null, 'list')
  92 + },
  93 + {
  94 + type: TYPE.redirect,
  95 + origin: '/?msort=10&misort=101,280',
  96 + target: helpers.urlFormat('/?category_id=251', null, 'list')
  97 + },
  98 + {
  99 + type: TYPE.redirect,
  100 + origin: '/?misort=259&msort=10',
  101 + target: helpers.urlFormat('/?category_id=23', null, 'list')
  102 + },
34 103
35 // 筛选参数排序匹配 104 // 筛选参数排序匹配
36 { 105 {