Authored by yyq

Merge branch 'feature/globalDetailSeo' into release/5.8

... ... @@ -283,21 +283,31 @@ module.exports = class extends global.yoho.BaseModel {
}
});
let ht;
if (params.keywords) {
nav = [
{
name: '搜索结果'
}
];
ht = `${params.keywords}`;
} else {
nav = _this._getNav(params.id, menuData, params.url);
ht = _.last(nav).name;
}
return {
nav: nav,
data: {
menuData: menuData,
contData: contData
contData: contData,
seoData: {
title: `有货${ht}-帮助中心-YOHO!BUY有货 100%正品保证`,
keywords: `${ht},有货${ht},有货${ht}帮助中心`,
description: `有货${ht}YOHO!BUY有货帮助中心${ht}频道,提供有关${ht}相关问题解答。YOHO!BUY有货100%品牌正品保证,支持货到付款。`
}
}
};
}
... ...
... ... @@ -140,6 +140,23 @@ const _handelGlobalSort = (origin, params, originParams) => {
};
};
const _getProductSeoData = (detail) => {
let resData = {};
if (!_.isEmpty(detail)) {
let gn = detail.product_name,
bn = _.get(detail, 'brand_info.brand_name') || detail.product_source;
resData = {
title: `${bn} | ${gn}正品 | YOHO!BUY 有货`,
keywords: `${bn},${bn}官网专卖店,${bn}官方授权店,${bn}正品,${bn}打折,${bn}折扣店,${bn}真品,${bn}代购`,
description: `YOHO!BUY 有货-${bn}官方授权店,${gn}图片、报价、介绍。YOHO!BUY 有货${bn}官网专卖店提供${bn}正品、${bn}真品、 ${bn}打折、${bn}代购等。` // eslint-disable-line
};
}
return resData;
};
const getGlobalProductListData = (params, yoho) => {
let limitNum = params.limit ? params.limit - 1 : 59;
let dps = {};
... ... @@ -340,7 +357,7 @@ const getGlobalProductDetailData = (skn, channelNum, channel) => {
Object.assign(resData, result.header, {
goodsInfo: detailInfo,
detailHtml: html || ''
});
}, _getProductSeoData(detailInfo));
return resData;
});
... ...
... ... @@ -31,6 +31,75 @@ module.exports = [
origin: '/new?order=s_t_desc&msort=10',
target: helpers.urlFormat('/lifestyle-new/', null, 'list')
},
// 男生销售类目一级菜单
{
type: TYPE.redirect,
origin: '/?gender=1,3&msort=1,3',
target: helpers.urlFormat('/?category_id=5,8&gender=1,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=1,3&msort=6',
target: helpers.urlFormat('/?category_id=11&gender=1,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=1,3&msort=7',
target: helpers.urlFormat('/?category_id=14&gender=1,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=1,3&msort=8',
target: helpers.urlFormat('/?category_id=17&gender=1,3', null, 'list')
},
// 女生销售类目一级菜单
{
type: TYPE.redirect,
origin: '/?gender=2,3&msort=1,3',
target: helpers.urlFormat('/?category_id=18,31,25&gender=2,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=2,3&msort=6',
target: helpers.urlFormat('/?category_id=52&gender=2,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=2,3&msort=7',
target: helpers.urlFormat('/?category_id=59&gender=2,3', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?gender=2,3&msort=8,10,241',
target: helpers.urlFormat('/?category_id=76&gender=2,3', null, 'list')
},
// 潮童销售类目一级菜单
{
type: TYPE.redirect,
origin: '/?gender=1,2,3&misort=382,368,372,448,392,388,384,414,429,390,425,464&msort=365',
target: helpers.urlFormat('/?category_id=13,16,15&gender=1,2,3', null, 'list')
},
// 创意生活销售类目一级菜单
{
type: TYPE.redirect,
origin: '/?msort=10&misort=103',
target: helpers.urlFormat('/?category_id=21', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?msort=10&misort=266',
target: helpers.urlFormat('/?category_id=20', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?msort=10&misort=101,280',
target: helpers.urlFormat('/?category_id=251', null, 'list')
},
{
type: TYPE.redirect,
origin: '/?misort=259&msort=10',
target: helpers.urlFormat('/?category_id=23', null, 'list')
},
// 筛选参数排序匹配
{
... ...