Authored by zhangxiaoru

guang

... ... @@ -232,14 +232,14 @@ const _pageArticleContent = (articleContent, isApp, gender, isWeixin, isqq, isWe
* [处理品牌数据]
* @param {[array]} getBrand [品牌原数据]
*/
const _relatedBrand = (getBrand, isApp, id) => {
const _relatedBrand = (getBrand, isApp) => {
let relatedBrand = getBrand;
relatedBrand.forEach(brand => {
brand.thumb = brand.thumb.replace('http://', '//');
if (isApp) {
brand.url = 'http://guang.m.yohobuy.com/guang/info/' + id + '.html?openby:yohobuy={"action":"go.brand","params":{"brand_id":"' + brand.id + '"}}';
brand.url = brand.url + '?openby:yohobuy={"action":"go.brand","params":{"brand_id":"' + brand.id + '"}}';
}
});
... ... @@ -256,12 +256,13 @@ const _relatedTag = (tags, isApp) => {
let tagUrl;
tags.forEach(value => {
tagUrl = helpers.urlFormat('/tags/index', {query: value.name}, 'guang');
if (!isApp) {
value.url = tagUrl;
} else {
if (value.url.indexOf('openby')) {
if (value.url.indexOf('openby') >= 0) {
value.url = value.url;
} else {
value.url = tagUrl + '&openby:yohobuy={"action":"go.h5","params":{"query":"' + value.name + '","type":0","title":"' + value.name + '","url":"http://guang.m.yohobuy.com/tags/index","islogin":"N"}}}';
... ... @@ -270,6 +271,7 @@ const _relatedTag = (tags, isApp) => {
relatedTag.push(value);
});
return relatedTag;
};
... ... @@ -296,6 +298,7 @@ const _relatedInfo = (getOtherArticle, isApp) => {
value.thumb = helpers.image(value.thumb, 279, 175);
relatedInfo.push(value);
});
return relatedInfo;
};
... ... @@ -432,7 +435,7 @@ const index = (req, res, next) => {
// 相关品牌
if (detail.getBrand && detail.getBrand.length) {
guang.relatedBrand = _relatedBrand(detail.getBrand, isApp, id);
guang.relatedBrand = _relatedBrand(detail.getBrand, isApp);
}
// 相关标签
... ... @@ -541,7 +544,7 @@ const mini = (req, res, next) => {
// 相关品牌
if (detail.getBrand && detail.getBrand.length) {
guang.relatedBrand = _relatedBrand(detail.getBrand, isApp, id);
guang.relatedBrand = _relatedBrand(detail.getBrand, isApp);
}
// 分享参数
... ...