|
@@ -313,8 +313,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
|
@@ -313,8 +313,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW |
313
|
finalDetail.push({
|
313
|
finalDetail.push({
|
314
|
relatedReco: {
|
314
|
relatedReco: {
|
315
|
isApp: isApp,
|
315
|
isApp: isApp,
|
316
|
- goods: goodsData,
|
|
|
317
|
- moreNum: goodsData.length - 2 > 0 ? goodsData.length - 2 : 0
|
316
|
+ goods: goodsData
|
318
|
}
|
317
|
}
|
319
|
});
|
318
|
});
|
320
|
}
|
319
|
}
|
|
@@ -380,14 +379,26 @@ const pushGoodsInfo = (finalDetail, goodsList, isApp) => { |
|
@@ -380,14 +379,26 @@ const pushGoodsInfo = (finalDetail, goodsList, isApp) => { |
380
|
|
379
|
|
381
|
_.forEach(finalDetail, (value, key) => {
|
380
|
_.forEach(finalDetail, (value, key) => {
|
382
|
if (value.relatedReco) {
|
381
|
if (value.relatedReco) {
|
383
|
- _.forEach(value.relatedReco.goods, (item, subKey) => {
|
|
|
384
|
- if (goodsObj[item.id]) {
|
|
|
385
|
- finalDetail[key].relatedReco.goods[subKey] = goodsObj[item.id];
|
382
|
+ let goodsIds = [];
|
|
|
383
|
+
|
|
|
384
|
+ _.forEach(value.relatedReco.goods, relatedGoods => {
|
|
|
385
|
+ goodsIds.push(relatedGoods.id);
|
|
|
386
|
+ });
|
|
|
387
|
+
|
|
|
388
|
+ goodsIds = _.uniq(goodsIds);
|
|
|
389
|
+ finalDetail[key].relatedReco.goods = [];
|
|
|
390
|
+
|
|
|
391
|
+ _.forEach(goodsIds, (item, subKey) => {
|
|
|
392
|
+ if (goodsObj[item]) {
|
|
|
393
|
+ finalDetail[key].relatedReco.goods[subKey] = goodsObj[item];
|
386
|
} else {
|
394
|
} else {
|
387
|
delete finalDetail[key].relatedReco.goods[subKey];
|
395
|
delete finalDetail[key].relatedReco.goods[subKey];
|
388
|
- finalDetail[key].relatedReco.moreNum--;
|
|
|
389
|
}
|
396
|
}
|
390
|
});
|
397
|
});
|
|
|
398
|
+
|
|
|
399
|
+ let moreNum = _.get(finalDetail[key], 'relatedReco.goods.length', 0);
|
|
|
400
|
+
|
|
|
401
|
+ finalDetail[key].relatedReco.moreNum = moreNum - 2 > 0 ? moreNum - 2 : 0;
|
391
|
}
|
402
|
}
|
392
|
|
403
|
|
393
|
if (value.collocation) {
|
404
|
if (value.collocation) {
|