Authored by Targaryen

list-seo

... ... @@ -14,6 +14,7 @@ const crypto = global.yoho.crypto;
const helpers = global.yoho.helpers;
const productProcess = require(`${utils}/product-process`);
const searchModel = require(`${mRoot}/search`);
const searchProcess = require(`${utils}/search-process`);
/**
* 从 useragent 获取 uid
... ... @@ -236,7 +237,7 @@ const category = (req, res, next) => {
}
searchModel.getSearchData(initialData).then((firstPageGoods) => {
res.render('search/goods-list', {
res.render('search/goods-list', Object.assign({
_noLazy: true, // 首屏不使用lazyload
module: 'product',
page: 'search-list',
... ... @@ -252,7 +253,7 @@ const category = (req, res, next) => {
localCss: true,
appPath: appPath,
introText: req.query.intro_text
});
}, searchProcess.getListSeoData(req.query.gender, req.query.title || req.query.sort_name)));
}).catch(next);
};
... ...
... ... @@ -4,6 +4,12 @@
* @date: 2016/7/29
*/
const _getGender = {
'1,3': '男生',
'2,3': '女生',
'1,2,3': '',
};
/**
* 根据频道判断出性别
*/
... ... @@ -66,8 +72,22 @@ const getTypeCont = (type, order) => {
}
};
/**
* 品类列表页 SEO 数据
* @param {*} gender
* @param {*} sort_name
*/
const getListSeoData = (gender, sort_name) => {
return {
title: `${sort_name}|新款${sort_name}${_getGender[gender]}|品牌正品|YOHO!BUY有货`,
keywords: `新款${sort_name},${_getGender[gender]}${sort_name},品牌正品`,
description: `正品网购!YOHO!BUY有货提供新款${sort_name}${_getGender[gender]}${sort_name}100%品牌正品保证,支持货到付款。`
};
};
module.exports = {
getGenderByChannel,
getChannelType,
getTypeCont
getTypeCont,
getListSeoData
};
... ...