...
|
...
|
@@ -81,7 +81,7 @@ function productGlobalUrl(skn) { |
|
|
|
|
|
export function processArticleDetail(articleContent) {
|
|
|
let finalDetail = [];
|
|
|
let allgoods = [];
|
|
|
let allgoods = {id: [], skn: []};
|
|
|
let recommends = [];
|
|
|
|
|
|
for (let value of articleContent) {
|
...
|
...
|
@@ -160,18 +160,21 @@ export function processArticleDetail(articleContent) { |
|
|
|
|
|
// 普通商品
|
|
|
forEach(goodsData, (item) => {
|
|
|
allgoods.push(get(item, 'productId', 0));
|
|
|
allgoods.id.push(get(item, 'productId', 0));
|
|
|
allgoods.skn.push(get(item, 'id', 0));
|
|
|
});
|
|
|
|
|
|
// 全球购商品
|
|
|
forEach(goodsDataGlobal, (item) => {
|
|
|
allgoods.push(get(item, 'productId', 0));
|
|
|
allgoods.id.push(get(item, 'productId', 0));
|
|
|
allgoods.skn.push(get(item, 'id', 0));
|
|
|
goodsData.push(item);
|
|
|
});
|
|
|
|
|
|
// 限定商品
|
|
|
forEach(goodsDataLimit, (item) => {
|
|
|
allgoods.push(get(item, 'productId', 0));
|
|
|
allgoods.id.push(get(item, 'productId', 0));
|
|
|
allgoods.skn.push(get(item, 'id', 0));
|
|
|
goodsData.push(item);
|
|
|
});
|
|
|
|
...
|
...
|
@@ -337,30 +340,34 @@ export function pushGoodsInfo(finalDetail, goodsList, favsList) { |
|
|
|
|
|
forEach(finalDetail, (value, key) => {
|
|
|
if (value.relatedReco) {
|
|
|
let goodsIds = [];
|
|
|
let goodsSkn = [];
|
|
|
|
|
|
forEach(value.relatedReco.goods, relatedGoods => {
|
|
|
goodsIds.push(relatedGoods.id);
|
|
|
goodsSkn.push(relatedGoods.id);
|
|
|
});
|
|
|
|
|
|
goodsIds = uniq(goodsIds);
|
|
|
goodsSkn = uniq(goodsSkn);
|
|
|
finalDetail[key].relatedReco.goods = [];
|
|
|
|
|
|
forEach(goodsIds, (item, subKey) => {
|
|
|
forEach(goodsSkn, (item, subKey) => {
|
|
|
console.log(goodsObj, item)
|
|
|
if (goodsObj[item]) {
|
|
|
console.log(goodsObj[item])
|
|
|
finalDetail[key].relatedReco.goods[subKey] = goodsObj[item];
|
|
|
} else {
|
|
|
console.log('delete');
|
|
|
delete finalDetail[key].relatedReco.goods[subKey];
|
|
|
}
|
|
|
});
|
|
|
|
|
|
finalDetail[key].relatedReco.goods = remove(finalDetail[key].relatedReco.goods, (obj) => {
|
|
|
return obj;
|
|
|
});
|
|
|
|
|
|
let moreNum = get(finalDetail[key], 'relatedReco.goods.length', 0);
|
|
|
|
|
|
finalDetail[key].relatedReco.moreNum = moreNum - 4 > 0 ? moreNum - 4 : 0; // 改成第一屏幕最多展示4个
|
|
|
//
|
|
|
// finalDetail[key].relatedReco.goods = remove(finalDetail[key].relatedReco.goods, (obj) => {
|
|
|
// return obj;
|
|
|
// });
|
|
|
//
|
|
|
// let moreNum = get(finalDetail[key], 'relatedReco.goods.length', 0);
|
|
|
//
|
|
|
// finalDetail[key].relatedReco.moreNum = moreNum - 4 > 0 ? moreNum - 4 : 0; // 改成第一屏幕最多展示4个
|
|
|
}
|
|
|
|
|
|
if (value.collocation) {
|
...
|
...
|
|