...
|
...
|
@@ -67,8 +67,8 @@ const formatAdvanceGoods = (advanceGood, isGift) => { |
|
|
id: good.product_skn,
|
|
|
name: good.product_name,
|
|
|
thumb: good.goods_images ? helpers.image(good.goods_images, 120, 160) : '',
|
|
|
price: transPrice(advanceGood.last_price),
|
|
|
marketPrice: isGift ? '0.00' : transPrice(advanceGood.market_price),
|
|
|
price: transPrice(good.last_price),
|
|
|
marketPrice: isGift ? '0.00' : transPrice(good.market_price),
|
|
|
count: good.storage_number
|
|
|
};
|
|
|
})
|
...
|
...
|
@@ -99,6 +99,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid = true, inValidLow = f |
|
|
count: goodData.buy_number,
|
|
|
promotion_id: _.toNumber(goodData.promotion_id) === 0 ? '' : goodData.promotion_id
|
|
|
};
|
|
|
|
|
|
goodData.storage_number = _.parseInt(goodData.storage_number);
|
|
|
goodData.min_buy_number = _.parseInt(goodData.min_buy_number);
|
|
|
goodData.buy_number = _.parseInt(goodData.buy_number);
|
...
|
...
|
@@ -190,7 +191,8 @@ const formatPromotion = (promo) => { |
|
|
promotionType: promo.promotion_type,
|
|
|
alreadyMatch: promo.alreadyMatch,
|
|
|
optTitle: formatPromotionOpt(promo),
|
|
|
promotionFlag: getPromotionFlag(promo)
|
|
|
promotionFlag: getPromotionFlag(promo),
|
|
|
noStorage: promo.status === 20
|
|
|
};
|
|
|
};
|
|
|
|
...
|
...
|
@@ -242,7 +244,7 @@ const procCartData = (data, onlyGift = false, onlyAdvanceBuy = false, isAdvanceC |
|
|
if (onlyAdvanceBuy) {
|
|
|
// 加价购
|
|
|
result.advanceBuy = data.price_gift.map(good => {
|
|
|
return formatAdvanceGoods(good, true);
|
|
|
return formatAdvanceGoods(good);
|
|
|
});
|
|
|
return result;
|
|
|
}
|
...
|
...
|
@@ -303,12 +305,22 @@ const procCartData = (data, onlyGift = false, onlyAdvanceBuy = false, isAdvanceC |
|
|
return formatAdvanceGoods(good);
|
|
|
});
|
|
|
result.giftCount = result.freebie.length;
|
|
|
result.giftHasStorage = _.some(result.freebie, freebie => {
|
|
|
return _.some(freebie.goods, good => {
|
|
|
return good.count > 0;
|
|
|
});
|
|
|
});
|
|
|
|
|
|
// 加价购
|
|
|
result.advanceBuy = data.price_gift.map(good => {
|
|
|
return formatAdvanceGoods(good);
|
|
|
});
|
|
|
result.advanceBuyCount = result.advanceBuy.length;
|
|
|
result.advanceHasStorage = _.some(result.advanceBuy, advanceBuy => {
|
|
|
return _.some(advanceBuy.goods, good => {
|
|
|
return good.count > 0;
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 已参加的活动
|
...
|
...
|
|