Authored by 毕凯

Merge branch 'feature/seo' into 'gray'

SEO



See merge request !603
@@ -23,7 +23,9 @@ exports.index = (req, res, next) => { @@ -23,7 +23,9 @@ exports.index = (req, res, next) => {
23 module: 'activity', 23 module: 'activity',
24 page: 'coupon-floor', 24 page: 'coupon-floor',
25 wechatShare: true, 25 wechatShare: true,
26 - title: '领券中心', 26 + title: '有货优惠券_有货现金优惠券,全场券,品类券,品牌券_领券频道-Yoho!Buy有货',
  27 + keywords: '有货优惠券,有货现金优惠券,全场券,品类券,品牌券',
  28 + description: 'Yoho!Buy有货官网领券频道,提供有货优惠券,有货现金优惠券,有货全场券,有货品类券,品牌券免费领取,让你做网购达人,省钱又省心!',
27 pageHeader: headerModel.setNav({ 29 pageHeader: headerModel.setNav({
28 navTitle: '领券中心' 30 navTitle: '领券中心'
29 }), 31 }),
@@ -250,7 +250,6 @@ const index = (req, res, next) => { @@ -250,7 +250,6 @@ const index = (req, res, next) => {
250 data.guang.wxFooter = resu; 250 data.guang.wxFooter = resu;
251 res.render('info/index', Object.assign({ 251 res.render('info/index', Object.assign({
252 page: 'info-index', 252 page: 'info-index',
253 - title: '逛',  
254 gender: gender, 253 gender: gender,
255 wechatShare: true, 254 wechatShare: true,
256 isWeixin: isWeixin, 255 isWeixin: isWeixin,
@@ -67,7 +67,9 @@ const editor = (req, res, next) => { @@ -67,7 +67,9 @@ const editor = (req, res, next) => {
67 67
68 res.render('index/list', Object.assign({ 68 res.render('index/list', Object.assign({
69 page: 'index-editor', 69 page: 'index-editor',
70 - title: title, 70 + title: `潮流编辑${authorData.data.name}|YOHO!BUY有货`,
  71 + keywords: `潮流编辑${authorData.data.name}`,
  72 + description: `YOHO!BUY有货潮流编辑${authorData.data.name}!`,
71 guangList: true, 73 guangList: true,
72 gender: gender, 74 gender: gender,
73 guang: { 75 guang: {
@@ -193,7 +195,9 @@ const index = (req, res, next) => { @@ -193,7 +195,9 @@ const index = (req, res, next) => {
193 let responseData = { 195 let responseData = {
194 module: 'guang', 196 module: 'guang',
195 page: 'index', 197 page: 'index',
196 - title: '逛 | Yoho!Buy有货 | 潮流购物逛不停', 198 + title: '逛|逛潮流,逛购物,官方授权正品潮流购物中心|YOHO!BUY有货',
  199 + keywords: '逛,逛潮流,逛购物',
  200 + description: 'YOHO!BUY有货逛频道,来YOHO!玩潮流!潮搭大解析!年轻人潮流购物中心,中国潮流购物风向标,吴亦凡重磅代言!YOHO!BUY有货100%正品保证,支持货到付款。',
197 showFooterTab: footerModel.getUrlData('guang') 201 showFooterTab: footerModel.getUrlData('guang')
198 }; 202 };
199 203
@@ -238,7 +242,9 @@ const tag = (req, res, next) => { @@ -238,7 +242,9 @@ const tag = (req, res, next) => {
238 pageHeader: headerData, 242 pageHeader: headerData,
239 module: 'guang', 243 module: 'guang',
240 page: 'index-editor', 244 page: 'index-editor',
241 - title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停' 245 + title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停',
  246 + keywords: tagTitle,
  247 + description: 'YOHO!BUY有货潮流' + tagTitle + '!'
242 }; 248 };
243 249
244 let param = { 250 let param = {
@@ -14,6 +14,7 @@ const crypto = global.yoho.crypto; @@ -14,6 +14,7 @@ const crypto = global.yoho.crypto;
14 const helpers = global.yoho.helpers; 14 const helpers = global.yoho.helpers;
15 const productProcess = require(`${utils}/product-process`); 15 const productProcess = require(`${utils}/product-process`);
16 const searchModel = require(`${mRoot}/search`); 16 const searchModel = require(`${mRoot}/search`);
  17 +const searchProcess = require(`${utils}/search-process`);
17 18
18 /** 19 /**
19 * 从 useragent 获取 uid 20 * 从 useragent 获取 uid
@@ -236,7 +237,7 @@ const category = (req, res, next) => { @@ -236,7 +237,7 @@ const category = (req, res, next) => {
236 } 237 }
237 238
238 searchModel.getSearchData(initialData).then((firstPageGoods) => { 239 searchModel.getSearchData(initialData).then((firstPageGoods) => {
239 - res.render('search/goods-list', { 240 + res.render('search/goods-list', Object.assign({
240 _noLazy: true, // 首屏不使用lazyload 241 _noLazy: true, // 首屏不使用lazyload
241 module: 'product', 242 module: 'product',
242 page: 'search-list', 243 page: 'search-list',
@@ -252,7 +253,7 @@ const category = (req, res, next) => { @@ -252,7 +253,7 @@ const category = (req, res, next) => {
252 localCss: true, 253 localCss: true,
253 appPath: appPath, 254 appPath: appPath,
254 introText: req.query.intro_text 255 introText: req.query.intro_text
255 - }); 256 + }, searchProcess.getListSeoData(req.query.gender, req.query.title || req.query.sort_name)));
256 }).catch(next); 257 }).catch(next);
257 }; 258 };
258 259
@@ -51,7 +51,13 @@ const newDetail = { @@ -51,7 +51,13 @@ const newDetail = {
51 pageHeader: headerData, 51 pageHeader: headerData,
52 result: result, 52 result: result,
53 page: 'new-detail', 53 page: 'new-detail',
54 - title: result.goodsName, 54 + title: result.goodsName + result.sortName + '正品 | YOHO!BUY 有货',
  55 + keywords: result.brandName + result.sortName + ',' + result.brandName + '官网专卖店,' +
  56 + result.brandName + '官方授权店,' + result.brandName + '正品,' + result.brandName + '打折,' +
  57 + result.brandName + '折扣店,' +
  58 + result.brandName + '真品,' + result.brandName + '代购',
  59 + description: `YOHO!BUY 有货-${result.brandName}官方授权店,${result.goodsName}图片、报价、介绍。` +
  60 + `YOHO!BUY 有货${result.brandName}官网专卖店提供${result.brandName}正品、${result.brandName}真品、 ${result.brandName}打折、${result.brandName}代购等。`, // eslint-disable-line
55 pageFooter: true, 61 pageFooter: true,
56 localCss: true, 62 localCss: true,
57 appPath: appPath 63 appPath: appPath
@@ -431,6 +431,10 @@ const shop = { @@ -431,6 +431,10 @@ const shop = {
431 let decorators = redShopPrcs.pushGoodsInfo(decoratorsAll.decorators, goodsList); 431 let decorators = redShopPrcs.pushGoodsInfo(decoratorsAll.decorators, goodsList);
432 432
433 res.render('newshop/shop-reds', { 433 res.render('newshop/shop-reds', {
  434 + title: shopInfo.shop_name + '|' + shopInfo.shop_name + '潮流服装服饰-Yoho!Buy有货',
  435 + keywords: shopInfo.shop_name + ',' + shopInfo.shop_name + '服装服饰,' + shopInfo.shop_name + '潮流服装服饰',
  436 + description: shopInfo.shop_name + '|Yoho!Buy有货' + shopInfo.shop_name +
  437 + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',
434 pageHeader: _.assign({ 438 pageHeader: _.assign({
435 shopPage: { 439 shopPage: {
436 text: '分类', 440 text: '分类',
@@ -174,7 +174,7 @@ const index = (req, res, next) => { @@ -174,7 +174,7 @@ const index = (req, res, next) => {
174 } 174 }
175 175
176 })((result) => { 176 })((result) => {
177 - res.render('search/index', { 177 + res.render('search/index', Object.assign({
178 module: 'product', 178 module: 'product',
179 page: 'search-index', 179 page: 'search-index',
180 pageHeader: headerModel.setNav({ 180 pageHeader: headerModel.setNav({
@@ -190,7 +190,7 @@ const index = (req, res, next) => { @@ -190,7 +190,7 @@ const index = (req, res, next) => {
190 wantTerms: result.guessTerms 190 wantTerms: result.guessTerms
191 } 191 }
192 192
193 - }); 193 + }, searchProcess.getListSeoData()));
194 }); 194 });
195 }; 195 };
196 196
@@ -132,6 +132,8 @@ const tool = { @@ -132,6 +132,8 @@ const tool = {
132 132
133 // 底部简介URL链接 133 // 底部简介URL链接
134 dest.introUrl = '/product/detail/intro/' + origin.product_skn; 134 dest.introUrl = '/product/detail/intro/' + origin.product_skn;
  135 + dest.brandName = _.get(origin, 'brand_info.brand_name', '');
  136 + dest.sortName = _.get(origin, 'middle_sort_name', '');
135 137
136 return dest; 138 return dest;
137 }, 139 },
@@ -25,56 +25,66 @@ const seoMap = { @@ -25,56 +25,66 @@ const seoMap = {
25 keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,Yoho!Buy有货', 25 keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,Yoho!Buy有货',
26 description: 'Yoho!BUY有货官网创意生活频道提供了潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。' 26 description: 'Yoho!BUY有货官网创意生活频道提供了潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。'
27 }, 27 },
28 - '/product/sale?channel=boys': { 28 + '/product/boys-sale/': {
29 title: '折扣男装专区|男装SALE折扣,男款鞋包配饰特卖|Yoho!Buy有货 100%正品保证', 29 title: '折扣男装专区|男装SALE折扣,男款鞋包配饰特卖|Yoho!Buy有货 100%正品保证',
30 keywords: 'SALE,男装SALE,男装折扣,男款鞋包配饰特卖', 30 keywords: 'SALE,男装SALE,男装折扣,男款鞋包配饰特卖',
31 description: 'Yoho!Buy有货SALE频道提供男装折扣,精致品牌男装sale,限时特惠。Yoho!Buy有货男装折扣,100%正品保证!' 31 description: 'Yoho!Buy有货SALE频道提供男装折扣,精致品牌男装sale,限时特惠。Yoho!Buy有货男装折扣,100%正品保证!'
32 }, 32 },
33 - '/product/sale?gender=2,3': { 33 + '/product/girls-sale/': {
34 title: '折扣女装专区|女装SALE折扣,女款鞋包配饰特卖|Yoho!Buy有货', 34 title: '折扣女装专区|女装SALE折扣,女款鞋包配饰特卖|Yoho!Buy有货',
35 keywords: 'SALE,女装SALE,女装折扣,女款鞋包配饰特卖', 35 keywords: 'SALE,女装SALE,女装折扣,女款鞋包配饰特卖',
36 description: 'Yoho!Buy有货SALE频道提供女装折扣,精致品牌女装sale,限时特惠。Yoho!Buy有货女装折扣,100%正品保证!' 36 description: 'Yoho!Buy有货SALE频道提供女装折扣,精致品牌女装sale,限时特惠。Yoho!Buy有货女装折扣,100%正品保证!'
37 }, 37 },
38 - '/product/new?gender=1,3': { 38 + '/product/kids-sale/': {
  39 + title: 'SALE|童装SALE,童装折扣,潮童鞋包配饰特卖|YOHO!BUY有货',
  40 + keywords: 'SALE,童装SALE,童装折扣,潮童鞋包配饰特卖',
  41 + description: 'YOHO!BUY有货SALE频道提供童装折扣,精致品牌童装sale,童装,针织衫,外套 卫衣,夹克,棉衣,裤子,品牌童鞋,潮童鞋包配饰等限时特惠。YOHO!BUY有货潮童折扣,100%正品保证!'
  42 + },
  43 + '/product/lifestyle-sale/': {
  44 + title: 'SALE|家居生活用品SALE,生活用品折扣,数码家居特卖YOHO!BUY有货',
  45 + keywords: 'SALE,家居生活用品SALE,生活用品折扣,数码家居特卖',
  46 + description: 'YOHO!BUY有货SALE频道提供生活用品折扣,数码家居特卖,数码3c,居家,玩具娱乐,文具,美妆等限时特惠。YOHO!BUY有货家居生活用品SALE,,100%正品保证! '
  47 + },
  48 + '/product/boys-new/': {
39 title: '男生潮装新品|男装新品发布,饰品推荐|Yoho!Buy有货 ', 49 title: '男生潮装新品|男装新品发布,饰品推荐|Yoho!Buy有货 ',
40 keywords: '男生潮装新品,新品发布,新品男装,新款男装推荐,新款男鞋推荐,新款男包推荐,新款男饰品推荐,Yoho!Buy有货', 50 keywords: '男生潮装新品,新品发布,新品男装,新款男装推荐,新款男鞋推荐,新款男包推荐,新款男饰品推荐,Yoho!Buy有货',
41 description: 'Yoho!Buy有货男装新品到着为您提供新品男装,男装新品直达就选Yoho!Buy有货,100%正品保证!' 51 description: 'Yoho!Buy有货男装新品到着为您提供新品男装,男装新品直达就选Yoho!Buy有货,100%正品保证!'
42 }, 52 },
43 - '/product/new?gender=2,3': { 53 + '/product/girls-new/': {
44 title: '女生潮装新品|女装新品发布,饰品推荐|Yoho!Buy有货 ', 54 title: '女生潮装新品|女装新品发布,饰品推荐|Yoho!Buy有货 ',
45 keywords: '女生潮流新品,女款新品发布,新品女装,新款女装推荐,新款女鞋推荐,新款女包推荐,新款饰品推荐,Yoho!Buy有货', 55 keywords: '女生潮流新品,女款新品发布,新品女装,新款女装推荐,新款女鞋推荐,新款女包推荐,新款饰品推荐,Yoho!Buy有货',
46 description: 'Yoho!Buy有货女装新品到着为您提供新品女装,女装样品,女装新款推荐;汇集国内外最新款女装,鞋,女包,饰品,100%正品保证!' 56 description: 'Yoho!Buy有货女装新品到着为您提供新品女装,女装样品,女装新款推荐;汇集国内外最新款女装,鞋,女包,饰品,100%正品保证!'
47 }, 57 },
48 - '/product/new?msort=365&channel=4': { 58 + '/product/kids-new/': {
49 title: '新品到着|潮童新品发布,新款童装童鞋,包包配饰推荐|Yoho!Buy有货', 59 title: '新品到着|潮童新品发布,新款童装童鞋,包包配饰推荐|Yoho!Buy有货',
50 keywords: '潮童新品发布,新品童装,新款童装推荐,新款童鞋,新款儿童鞋包,儿童配饰新品,Yoho!Buy有货', 60 keywords: '潮童新品发布,新品童装,新款童装推荐,新款童鞋,新款儿童鞋包,儿童配饰新品,Yoho!Buy有货',
51 description: 'Yoho!Buy有货潮童新品到着为您提供新品童装,童装样品,童装新款推荐;汇集国内外最新款童装,童鞋,儿童鞋包配饰。' 61 description: 'Yoho!Buy有货潮童新品到着为您提供新品童装,童装样品,童装新款推荐;汇集国内外最新款童装,童鞋,儿童鞋包配饰。'
52 }, 62 },
53 - '/product/new?msort=10&channel=4': { 63 + '/product/lifestyle-new/': {
54 title: '新品到着|数码3c,居家,玩具娱乐,文具,美妆|Yoho!Buy有货', 64 title: '新品到着|数码3c,居家,玩具娱乐,文具,美妆|Yoho!Buy有货',
55 keywords: '数码3c,居家,玩具娱乐,文具,美妆,Yoho!Buy有货', 65 keywords: '数码3c,居家,玩具娱乐,文具,美妆,Yoho!Buy有货',
56 description: 'Yoho!Buy有货创意生活新品到着为您提供潮流创意生活,汇集国内外最新款数码3c,居家,玩具娱乐,文具,美妆。' 66 description: 'Yoho!Buy有货创意生活新品到着为您提供潮流创意生活,汇集国内外最新款数码3c,居家,玩具娱乐,文具,美妆。'
57 }, 67 },
58 - '/brands?channel=1': { 68 + '/boys-brands/': {
59 title: '潮流男装品牌|男装品牌排行榜,男装品牌大全|Yoho!Buy有货', 69 title: '潮流男装品牌|男装品牌排行榜,男装品牌大全|Yoho!Buy有货',
60 keywords: '潮流男装品牌,男装品牌,男装品牌排行榜,男装品牌大全,Yoho!Buy有货', 70 keywords: '潮流男装品牌,男装品牌,男装品牌排行榜,男装品牌大全,Yoho!Buy有货',
61 description: 'Yoho!Buy有货男装品牌一览汇集国内国际各大男装品牌大全,为广大爱好时尚的男士青年提供品牌男装、休闲男装、商务男装.Yoho!Buy有货,100%正品保证' 71 description: 'Yoho!Buy有货男装品牌一览汇集国内国际各大男装品牌大全,为广大爱好时尚的男士青年提供品牌男装、休闲男装、商务男装.Yoho!Buy有货,100%正品保证'
62 }, 72 },
63 - '/brands?channel=2': { 73 + '/girls-brands/': {
64 title: '潮流女装品牌|女装品牌排行榜,女装品牌大全|Yoho!Buy有货', 74 title: '潮流女装品牌|女装品牌排行榜,女装品牌大全|Yoho!Buy有货',
65 keywords: '潮流女装品牌,女装品牌,女装品牌排行榜,女装品牌大全,Yoho!Buy有货', 75 keywords: '潮流女装品牌,女装品牌,女装品牌排行榜,女装品牌大全,Yoho!Buy有货',
66 description: 'Yoho!Buy有货女装品牌一览汇集各大女装品牌,提供品牌女装、休闲女装、商务女装.Yoho!Buy有货品牌女装100%正品保证。' 76 description: 'Yoho!Buy有货女装品牌一览汇集各大女装品牌,提供品牌女装、休闲女装、商务女装.Yoho!Buy有货品牌女装100%正品保证。'
67 }, 77 },
68 - '/brands?channel=3': { 78 + '/kids-brands/': {
69 title: '品牌一览|童装童鞋品牌,儿童鞋包配饰排行榜大全|Yoho!Buy有货', 79 title: '品牌一览|童装童鞋品牌,儿童鞋包配饰排行榜大全|Yoho!Buy有货',
70 keywords: '童装品牌,童装童鞋排行榜,儿童鞋包配饰排行榜,潮童品牌大全,品牌一览,Yoho!Buy有货', 80 keywords: '童装品牌,童装童鞋排行榜,儿童鞋包配饰排行榜,潮童品牌大全,品牌一览,Yoho!Buy有货',
71 description: 'Yoho!Buy有货童装品牌一览汇集国内国际各大童装品牌大全,提供品牌童装、童鞋,儿童鞋包配饰,100%正品保证' 81 description: 'Yoho!Buy有货童装品牌一览汇集国内国际各大童装品牌大全,提供品牌童装、童鞋,儿童鞋包配饰,100%正品保证'
72 }, 82 },
73 - '/brands?channel=4': { 83 + '/lifestyle-brands/': {
74 title: '品牌一览|数码3c,居家,玩具娱乐,文具,美妆品牌|Yoho!Buy有货', 84 title: '品牌一览|数码3c,居家,玩具娱乐,文具,美妆品牌|Yoho!Buy有货',
75 keywords: '数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌', 85 keywords: '数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌',
76 description: 'Yoho!Buy有货女装品牌一览汇集国内国际各大数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌.' 86 description: 'Yoho!Buy有货女装品牌一览汇集国内国际各大数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌.'
77 - }, 87 + }
78 /* eslint-enable */ 88 /* eslint-enable */
79 }; 89 };
80 90
@@ -4,6 +4,12 @@ @@ -4,6 +4,12 @@
4 * @date: 2016/7/29 4 * @date: 2016/7/29
5 */ 5 */
6 6
  7 +const _getGender = {
  8 + '1,3': '男生',
  9 + '2,3': '女生',
  10 + '1,2,3': '',
  11 +};
  12 +
7 /** 13 /**
8 * 根据频道判断出性别 14 * 根据频道判断出性别
9 */ 15 */
@@ -66,8 +72,31 @@ const getTypeCont = (type, order) => { @@ -66,8 +72,31 @@ const getTypeCont = (type, order) => {
66 } 72 }
67 }; 73 };
68 74
  75 +/**
  76 + * 品类列表页 SEO 数据
  77 + * @param {*} gender
  78 + * @param {*} sort_name
  79 + */
  80 +const getListSeoData = (gender, sort_name) => {
  81 + let seoData = {
  82 + title: '潮流服装配饰,创意生活用品_男生|女生|潮童服装,鞋履,配饰品牌正品-YOHO!BUY有货',
  83 + keywords: '潮流服装配饰,创意生活用品,男生服装配饰,女生服装配饰,潮童服装配饰',
  84 + description: '潮流服装配饰及创意生活正品网购!YOHO!BUY有货提供男生、女生、潮童服装配饰。100%品牌正品保证,支持货到付款。'
  85 + };
  86 +
  87 + if (gender && sort_name) {
  88 + seoData = {
  89 + title: `${sort_name}|新款${sort_name}${_getGender[gender]}|品牌正品|YOHO!BUY有货`,
  90 + keywords: `新款${sort_name},${_getGender[gender]}${sort_name},品牌正品`,
  91 + description: `正品网购!YOHO!BUY有货提供新款${sort_name}${_getGender[gender]}${sort_name}100%品牌正品保证,支持货到付款。`
  92 + };
  93 + }
  94 + return seoData;
  95 +};
  96 +
69 module.exports = { 97 module.exports = {
70 getGenderByChannel, 98 getGenderByChannel,
71 getChannelType, 99 getChannelType,
72 - getTypeCont 100 + getTypeCont,
  101 + getListSeoData
73 }; 102 };