...
|
...
|
@@ -326,27 +326,22 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 相关推荐
|
|
|
// 相关商品 170505 更改了前端样式
|
|
|
if (_.get(value, 'goods.data', false)) {
|
|
|
let relatedReco = [];
|
|
|
let moreThanOne = _.get(value, 'goods.data', []).length > 1;
|
|
|
|
|
|
_.forEach(_.get(value, 'goods.data', []), item => {
|
|
|
allgoods += item.id + ',';
|
|
|
});
|
|
|
|
|
|
if (moreThanOne) {
|
|
|
relatedReco = _.get(value, 'goods.data', []);
|
|
|
} else {
|
|
|
relatedReco = _.get(value, 'goods.data[0]', {});
|
|
|
}
|
|
|
relatedReco = _.get(value, 'goods.data', []);
|
|
|
|
|
|
finalDetail.push({
|
|
|
relatedReco: relatedReco
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 悬停浮动商品
|
|
|
// 悬停浮动商品 170505 后面版本不支持配置此资源,重构可忽略此部分
|
|
|
if (_.get(value, 'goodsGroup.data', false)) {
|
|
|
let collocation = [];
|
|
|
|
...
|
...
|
@@ -377,6 +372,10 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 170505 新添加推荐商品
|
|
|
if (_.get(value, '', false)) {
|
|
|
console.log('^-^');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return {
|
...
|
...
|
@@ -392,18 +391,9 @@ const pushGoodsInfo = (finalDetail, goodsList) => { |
|
|
let goodsObj = _goodsArrayToObj(productPrcs.processProductList(goodsList));
|
|
|
|
|
|
_.forEach(finalDetail, (value, key) => {
|
|
|
if (value.relatedReco && _.isArray(value.relatedReco)) {
|
|
|
|
|
|
_.forEach(value.relatedReco, (item, subKey) => {
|
|
|
finalDetail[key].relatedReco[subKey] = goodsObj[item.id];
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (value.relatedReco && _.isObject(value.relatedReco)) {
|
|
|
_.assign(finalDetail[key].relatedReco, goodsObj[_.get(value, 'relatedReco.id', 'false')], {
|
|
|
thumb: helpers.image(_.get(value, 'relatedReco.src', ''), 235, 314)
|
|
|
});
|
|
|
}
|
|
|
_.forEach(value.relatedReco, (item, subKey) => {
|
|
|
finalDetail[key].relatedReco[subKey] = goodsObj[item.id];
|
|
|
});
|
|
|
|
|
|
if (value.collocation) {
|
|
|
_.forEach(value.collocation, (item, subKey) => {
|
...
|
...
|
|