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) => {
brandIntro: extra.brandAbout
}
};
Object.assign(finalResult,
searchHandler.getAboutSeo(`${extra.brandNameEn} ${extra.brandNameCn}`, extra.brandAbout));
}
return finalResult;
... ... @@ -477,8 +480,10 @@ const getShopAbout = (shopId, uid, channel) => {
let data = result[2].data || {};
_.set(resData, 'brand.brandAbout.brandIntro', data.shop_intro);
Object.assign(resData, searchHandler.getAboutSeo(data.shop_name, data.shop_intro, true));
}
return resData;
});
};
... ...
... ... @@ -1521,6 +1521,23 @@ exports.getBrandShopSeo = (channel, info, qs) => {
return resData;
};
exports.getAboutSeo = (name, intro, shop) => {
let type = shop ? '店铺' : '品牌';
intro = intro || '';
intro = _.truncate(_.replace(intro, /<\/?[^>]*>|\s*|(\n)|(\t)|(\r)/g, ''), {
length: 156,
omission: '...'
});
return {
title: `${name}品牌 | ${name}${type}介绍 | YOHO!BUY有货 100%正品保证`,
keywords: `${name}品牌, ${name}${type}介绍`,
description: `${name}${type}介绍 ${intro}`
};
};
/**
* 获取商品的前三个skn 提供给第三方推广使用
* @param glist
... ...
... ... @@ -34,4 +34,19 @@ var _gaq = _gaq || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
\ No newline at end of file
</script>
<!-- 百度站长统计 -->
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
}
else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
... ...