Authored by yyq

Merge branch 'feature/seo-product' into feature/seo1203

... ... @@ -70,13 +70,8 @@ const showMain = (req, res, next) => {
}, nullUserInfo)).then((result)=> {
return res.render('product/detail', Object.assign({
module: 'product',
page: 'detail',
title_more: true,
title: _.get(result, 'seo.title', '') + ' | ' + SEO_SLOGAN,
keywords: _.get(result, 'seo.keywords', '').replace(/~+/, ''),
description_more: true,
description: result.description
}, result));
page: 'detail'
}, result.seo, result));
}).catch(next);
};
... ...
... ... @@ -1061,15 +1061,21 @@ const _getSeoByGoodsInfo = (goodsInfo, navs) => {
title += navs[1].name + '|';
}
title += goodsInfo.name + '正品 ';
title += goodsInfo.name + '正品 | YOHO!BUY 有货';
let keywords = brandName + sortName + ',' + brandName + '官网专卖店,' + brandName + '官方授权店,' +
brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购';
let description = !goodsInfo.shareDesc ? goodsInfo.name : goodsInfo.shareDesc;
let description = `YOHO!BUY 有货-${brandName}官方授权店,${goodsInfo.name}图片、报价、介绍。` +
`YOHO!BUY 有货{品牌}官网专卖店提供${brandName}正品、${brandName}真品、 ${brandName}打折、${brandName}代购等。`;
let cononicalURL = goodsInfo.productUrl;
return {
title: title,
keywords: keywords,
description: description
keywords: keywords.replace(/~+/, ''),
description: description,
cononicalURL: cononicalURL
};
};
... ... @@ -1458,6 +1464,8 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
statGoodsInfo.smallSortId = result.smallSortId;
statGoodsInfo.soldOut = soldOut ? 1 : 0;
result.productUrl = statGoodsInfo.productUrl;
// 商品的品牌信息
let bandInfo = {};
... ...
... ... @@ -5,6 +5,7 @@
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
{{#if cononicalURL}} <link rel="cononical" href="{{cononicalURL}}"/> {{/if}}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
... ...