Authored by 毕凯

Merge branch 'feature/seo4' into 'release/6.3'

Feature/seo4



See merge request !1164
... ... @@ -232,7 +232,7 @@ const category = (req, res, next) => {
try {
seoTitle = decodeURIComponent(req.query.title || req.query.sort_name);
} catch (e) {
logger.error('decodeURIComponent seoTitle: ' + e);
logger.error(`decodeURIComponent seoTitle:${e}url:${req.url}`);
}
/* 勿修改,唤起 APP 使用 */
... ... @@ -366,7 +366,7 @@ const listNew = (req, res, next) => {
try {
seoTitle = decodeURIComponent(paramsTitle);
} catch (e) {
logger.error('decodeURIComponent seoTitle: ' + e);
logger.error(`decodeURIComponent seoTitle:${e}url:${req.url}`);
}
}
... ...
... ... @@ -94,16 +94,7 @@ const getTypeCont = (type, order) => {
* @param 接口数据 apiData
*/
const getFilterValueForSeo = (queryParams, apiData) => {
let seoParams = {
color: '',
size: '',
style: '',
brand: '',
gender: '',
sort: '',
price: '',
senior: ''
};
let seoParams = {};
let seniors = [];
_.forEach(queryParams, (value, key) => {
... ... @@ -190,14 +181,28 @@ const getListSeoData = (params) => {
keywords: '潮流服装配饰,创意生活用品,男生服装配饰,女生服装配饰,潮童服装配饰',
description: '潮流服装配饰及创意生活正品网购!YOHO!BUY有货提供男生、女生、潮童服装配饰。100%品牌正品保证,支持货到付款。'
};
let seoParams = {
color: '',
size: '',
style: '',
brand: '',
gender: '',
sort: '',
price: '',
senior: '',
channel: ''
};
if (params) {
let baseInfo = `${params.brand}${params.sort}`;
_.assign(seoParams, params);
console.log(seoParams);
let baseInfo = `${seoParams.brand}${seoParams.sort}`;
seoData = {
title: `${baseInfo ? baseInfo + '|' : ''}新款${params.brand}${params.channel}${params.color}${params.size}${params.sort}${params.price},${params.brand}${params.senior}${params.sort}品牌正品|YOHO!BUY有货`, // eslint-disable-line
keywords: `${baseInfo ? baseInfo + ',' : ''}新款${params.brand}${params.channel}${params.color}${params.size}${params.sort}${params.price},${params.brand}${params.senior}${params.sort}品牌正品`, // eslint-disable-line
description: `${baseInfo}正品网购!YOHO!BUY有货提供新款${params.brand}${params.channel}${params.color}${params.size}${params.sort}${params.price},${params.brand}${params.senior}${params.sort}100%品牌正品保证,支持货到付款。` // eslint-disable-line
title: `${baseInfo ? baseInfo + '|' : ''}新款${seoParams.brand}${seoParams.channel}${seoParams.color}${seoParams.size}${seoParams.sort}${seoParams.price},${seoParams.brand}${seoParams.senior}${seoParams.sort}品牌正品|YOHO!BUY有货`, // eslint-disable-line
keywords: `${baseInfo ? baseInfo + ',' : ''}新款${seoParams.brand}${seoParams.channel}${seoParams.color}${seoParams.size}${seoParams.sort}${seoParams.price},${seoParams.brand}${seoParams.senior}${seoParams.sort}品牌正品`, // eslint-disable-line
description: `${baseInfo}正品网购!YOHO!BUY有货提供新款${seoParams.brand}${seoParams.channel}${seoParams.color}${seoParams.size}${seoParams.sort}${seoParams.price},${seoParams.brand}${seoParams.senior}${seoParams.sort}100%品牌正品保证,支持货到付款。` // eslint-disable-line
};
}
return seoData;
... ...