Authored by 周少峰

Merge branch 'release/5.3' of git.yoho.cn:fe/yohobuy-node into release/5.3

@@ -436,6 +436,9 @@ const getBrandAbout = (domain, uid, channel) => { @@ -436,6 +436,9 @@ const getBrandAbout = (domain, uid, channel) => {
436 brandIntro: extra.brandAbout 436 brandIntro: extra.brandAbout
437 } 437 }
438 }; 438 };
  439 +
  440 + Object.assign(finalResult,
  441 + searchHandler.getAboutSeo(`${extra.brandNameEn} ${extra.brandNameCn}`, extra.brandAbout));
439 } 442 }
440 443
441 return finalResult; 444 return finalResult;
@@ -477,8 +480,10 @@ const getShopAbout = (shopId, uid, channel) => { @@ -477,8 +480,10 @@ const getShopAbout = (shopId, uid, channel) => {
477 let data = result[2].data || {}; 480 let data = result[2].data || {};
478 481
479 _.set(resData, 'brand.brandAbout.brandIntro', data.shop_intro); 482 _.set(resData, 'brand.brandAbout.brandIntro', data.shop_intro);
  483 + Object.assign(resData, searchHandler.getAboutSeo(data.shop_name, data.shop_intro, true));
480 } 484 }
481 485
  486 +
482 return resData; 487 return resData;
483 }); 488 });
484 }; 489 };
@@ -1521,6 +1521,23 @@ exports.getBrandShopSeo = (channel, info, qs) => { @@ -1521,6 +1521,23 @@ exports.getBrandShopSeo = (channel, info, qs) => {
1521 return resData; 1521 return resData;
1522 }; 1522 };
1523 1523
  1524 +exports.getAboutSeo = (name, intro, shop) => {
  1525 + let type = shop ? '店铺' : '品牌';
  1526 +
  1527 + intro = intro || '';
  1528 +
  1529 + intro = _.truncate(_.replace(intro, /<\/?[^>]*>|\s*|(\n)|(\t)|(\r)/g, ''), {
  1530 + length: 156,
  1531 + omission: '...'
  1532 + });
  1533 +
  1534 + return {
  1535 + title: `${name}品牌 | ${name}${type}介绍 | YOHO!BUY有货 100%正品保证`,
  1536 + keywords: `${name}品牌, ${name}${type}介绍`,
  1537 + description: `${name}${type}介绍 ${intro}`
  1538 + };
  1539 +};
  1540 +
1524 /** 1541 /**
1525 * 获取商品的前三个skn 提供给第三方推广使用 1542 * 获取商品的前三个skn 提供给第三方推广使用
1526 * @param glist 1543 * @param glist
@@ -35,3 +35,18 @@ var _gaq = _gaq || []; @@ -35,3 +35,18 @@ var _gaq = _gaq || [];
35 s.parentNode.insertBefore(hm, s); 35 s.parentNode.insertBefore(hm, s);
36 })(); 36 })();
37 </script> 37 </script>
  38 +<!-- 百度站长统计 -->
  39 +<script>
  40 + (function(){
  41 + var bp = document.createElement('script');
  42 + var curProtocol = window.location.protocol.split(':')[0];
  43 + if (curProtocol === 'https') {
  44 + bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  45 + }
  46 + else {
  47 + bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  48 + }
  49 + var s = document.getElementsByTagName("script")[0];
  50 + s.parentNode.insertBefore(bp, s);
  51 + })();
  52 +</script>