...
|
...
|
@@ -313,8 +313,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
|
finalDetail.push({
|
|
|
relatedReco: {
|
|
|
isApp: isApp,
|
|
|
goods: goodsData,
|
|
|
moreNum: goodsData.length - 2 > 0 ? goodsData.length - 2 : 0
|
|
|
goods: goodsData
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -380,14 +379,26 @@ const pushGoodsInfo = (finalDetail, goodsList, isApp) => { |
|
|
|
|
|
_.forEach(finalDetail, (value, key) => {
|
|
|
if (value.relatedReco) {
|
|
|
_.forEach(value.relatedReco.goods, (item, subKey) => {
|
|
|
if (goodsObj[item.id]) {
|
|
|
finalDetail[key].relatedReco.goods[subKey] = goodsObj[item.id];
|
|
|
let goodsIds = [];
|
|
|
|
|
|
_.forEach(value.relatedReco.goods, relatedGoods => {
|
|
|
goodsIds.push(relatedGoods.id);
|
|
|
});
|
|
|
|
|
|
goodsIds = _.uniq(goodsIds);
|
|
|
finalDetail[key].relatedReco.goods = [];
|
|
|
|
|
|
_.forEach(goodsIds, (item, subKey) => {
|
|
|
if (goodsObj[item]) {
|
|
|
finalDetail[key].relatedReco.goods[subKey] = goodsObj[item];
|
|
|
} else {
|
|
|
delete finalDetail[key].relatedReco.goods[subKey];
|
|
|
finalDetail[key].relatedReco.moreNum--;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
let moreNum = _.get(finalDetail[key], 'relatedReco.goods.length', 0);
|
|
|
|
|
|
finalDetail[key].relatedReco.moreNum = moreNum - 2 > 0 ? moreNum - 2 : 0;
|
|
|
}
|
|
|
|
|
|
if (value.collocation) {
|
...
|
...
|
|