Authored by 郭成尧

tdk

@@ -17,6 +17,18 @@ const stringProcess = require(`${utils}/string-process`); @@ -17,6 +17,18 @@ const stringProcess = require(`${utils}/string-process`);
17 const shopPrcs = require(`${utils}/shop-process`); 17 const shopPrcs = require(`${utils}/shop-process`);
18 const co = require('bluebird').coroutine; 18 const co = require('bluebird').coroutine;
19 19
  20 +/**
  21 + * SEO 优化,页面 TDK
  22 + * @param {*} keyword
  23 + */
  24 +const _tdkProcess = (keyword) => {
  25 + return {
  26 + title: `${keyword}| ${keyword}品牌旗舰店 |正品保证, YOHO!BUY 有货`,
  27 + keywords: `${keyword}${keyword}品牌旗舰店,${keyword}正品`,
  28 + description: `有货网${keyword}旗舰店销售${keyword}正品商品,100%质量保证,支持货到付款,想了解${keyword}价格、图片、评价等信息,就上YOHO!BUY 有货中国最大的潮流商品购物网站!`, // eslint-disable-line
  29 + };
  30 +};
  31 +
20 const shop = { 32 const shop = {
21 33
22 /** 34 /**
@@ -199,7 +211,7 @@ const shop = { @@ -199,7 +211,7 @@ const shop = {
199 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', [])); 211 let goodsList = productProcess.processProductList(_.get(goodsListApi, 'data.product_list', []));
200 212
201 213
202 - res.render('newshop/shop-brand', { 214 + res.render('newshop/shop-brand', _.assign({
203 module: 'product', 215 module: 'product',
204 page: 'shop-brand', 216 page: 'shop-brand',
205 pageHeader: headerModel.setNav({ 217 pageHeader: headerModel.setNav({
@@ -207,15 +219,12 @@ const shop = { @@ -207,15 +219,12 @@ const shop = {
207 }), 219 }),
208 showDownloadApp: true, 220 showDownloadApp: true,
209 pageFooter: true, 221 pageFooter: true,
210 - title: title + '|' + title + '潮流服装服饰-Yoho!Buy有货',  
211 - keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',  
212 - description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
213 brandId: brandId, 222 brandId: brandId,
214 goodsList: goodsList, 223 goodsList: goodsList,
215 shopPage: true, 224 shopPage: true,
216 _noLazy: true, 225 _noLazy: true,
217 localCss: true 226 localCss: true
218 - }); 227 + }, _tdkProcess(title)));
219 })().catch(next); 228 })().catch(next);
220 }, 229 },
221 230
@@ -253,10 +262,6 @@ const shop = { @@ -253,10 +262,6 @@ const shop = {
253 shopInfo.shop_intro_link = helpers.urlFormat('/product/index/intro', { shop_id: shopId }); 262 shopInfo.shop_intro_link = helpers.urlFormat('/product/index/intro', { shop_id: shopId });
254 263
255 let finalResult = { 264 let finalResult = {
256 - title: shopInfo.shop_name + '|' + shopInfo.shop_name + '潮流服装服饰-Yoho!Buy有货',  
257 - keywords: shopInfo.shop_name + ',' + shopInfo.shop_name + '服装服饰,' + shopInfo.shop_name + '潮流服装服饰',  
258 - description: shopInfo.shop_name + '|Yoho!Buy有货' + shopInfo.shop_name +  
259 - '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
260 pageHeader: _.assign({ 265 pageHeader: _.assign({
261 shopPage: { 266 shopPage: {
262 text: '分类', 267 text: '分类',
@@ -299,7 +304,7 @@ const shop = { @@ -299,7 +304,7 @@ const shop = {
299 304
300 res.render('newshop/shop-reds', _.assign(finalResult, { 305 res.render('newshop/shop-reds', _.assign(finalResult, {
301 shppFavHide: shppFavHide 306 shppFavHide: shppFavHide
302 - })); 307 + }, _tdkProcess(shopInfo.shop_name)));
303 })().catch(next); 308 })().catch(next);
304 }, 309 },
305 310
@@ -339,7 +344,7 @@ const shop = { @@ -339,7 +344,7 @@ const shop = {
339 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' + 344 let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shop","params":{"shop_template_type":"1","shop_id":"' +
340 shopId + '","shop_name":"' + shopInfo.shop_name + '"}}'; 345 shopId + '","shop_name":"' + shopInfo.shop_name + '"}}';
341 346
342 - res.render('newshop/shop-list', { 347 + res.render('newshop/shop-list', _.assign({
343 module: 'product', 348 module: 'product',
344 page: 'shop-list', 349 page: 'shop-list',
345 pageHeader: headerModel.setNav({ 350 pageHeader: headerModel.setNav({
@@ -347,9 +352,6 @@ const shop = { @@ -347,9 +352,6 @@ const shop = {
347 }), 352 }),
348 showDownloadApp: true, 353 showDownloadApp: true,
349 pageFooter: true, 354 pageFooter: true,
350 - title: title + '|' + title + '潮流服装服饰-Yoho!Buy有货',  
351 - keywords: title + ',' + title + '服装服饰,' + title + '潮流服装服饰',  
352 - description: title + '|Yoho!Buy有货' + title + '潮流服饰官方授权店!100%品牌正品保证,支持货到付款。',  
353 shopId: shopId, 355 shopId: shopId,
354 shopInfo: shopInfo, 356 shopInfo: shopInfo,
355 goodsList: goodsList, 357 goodsList: goodsList,
@@ -358,7 +360,7 @@ const shop = { @@ -358,7 +360,7 @@ const shop = {
358 _noLazy: true, 360 _noLazy: true,
359 localCss: true, 361 localCss: true,
360 couponData 362 couponData
361 - }); 363 + }, _tdkProcess(title)));
362 364
363 })().catch(next); 365 })().catch(next);
364 }, 366 },