Authored by yyq

逛index tdk

... ... @@ -45,8 +45,9 @@ exports.index = (req, res, next) => {
res.set('Cache-Control', 'no-cache');
}
res.render('guang/index', {
title: '逛' + (res.locals.title || ''),
let seoTdk = ghelper.getIndexSeo(req.query, ret[1]);
res.render('guang/index', Object.assign(seoTdk, {
guang: {
slider: ret[0],
msgTypes: ret[1],
... ... @@ -66,7 +67,7 @@ exports.index = (req, res, next) => {
module: 'guang',
page: 'guang',
headerData: ret[6] && ret[6].headerData
});
}));
}).catch(next);
};
... ...
... ... @@ -88,9 +88,34 @@ const getArticleUrl = (url, id, channel) => {
return helpers.urlFormat(`/${id}.html`, param, 'guang');
};
const getIndexSeo = (params, tabs) => {
let tdk = {
title: '逛|逛潮流,逛购物,官方授权正品潮流购物中心|YOHO!BUY有货',
keywords: '逛,逛潮流,逛购物',
description: 'YOHO!BUY有货逛频道,来YOHO!玩潮流!潮搭大解析!年轻人潮流购物中心,中国潮流购物风向标,吴亦凡重磅代言!YOHO!BUY有货100%正品保证,支持货到付款。'
};
params = params || {};
if (params.hasOwnProperty('type')) {
let tab = _.find(tabs, {isActive: true});
if (tab && tab.type) {
Object.assign(tdk, {
title: `潮流${tab.type}-|YOHO!BUY有货`,
keywords: `潮流${tab.type}`,
description: `YOHO!BUY有货潮流${tab.type}!`
});
}
}
return tdk;
};
module.exports = {
getGenderByCookie,
getUdid,
getArticleUrl
getArticleUrl,
getIndexSeo
};
... ...