...
|
...
|
@@ -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
|
|
|
};
|
|
|
})
|
...
|
...
|
@@ -105,6 +105,7 @@ const formatCartGoods = (goodData, isAdvanceCart, isValid, inValidLow) => { |
|
|
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);
|
...
|
...
|
@@ -196,7 +197,8 @@ const formatPromotion = (promo) => { |
|
|
promotionType: promo.promotion_type,
|
|
|
alreadyMatch: promo.alreadyMatch,
|
|
|
optTitle: formatPromotionOpt(promo),
|
|
|
promotionFlag: getPromotionFlag(promo)
|
|
|
promotionFlag: getPromotionFlag(promo),
|
|
|
noStorage: promo.status === 20
|
|
|
};
|
|
|
};
|
|
|
|
...
|
...
|
@@ -251,7 +253,7 @@ const procCartData = (data, onlyGift, onlyAdvanceBuy, isAdvanceCart) => { |
|
|
if (onlyAdvanceBuy) {
|
|
|
// 加价购
|
|
|
result.advanceBuy = data.price_gift.map(good => {
|
|
|
return formatAdvanceGoods(good, true);
|
|
|
return formatAdvanceGoods(good);
|
|
|
});
|
|
|
return result;
|
|
|
}
|
...
|
...
|
@@ -312,12 +314,22 @@ const procCartData = (data, onlyGift, onlyAdvanceBuy, isAdvanceCart) => { |
|
|
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;
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 已参加的活动
|
...
|
...
|
@@ -405,7 +417,7 @@ const handleBundleInfo = (apiResult) => { |
|
|
|
|
|
if (apiResult && apiResult.code === 200 && apiResult.data) {
|
|
|
if (_.has(apiResult.data, 'bundleInfo')) {
|
|
|
result.mnum = apiResult.data.bundleInfo.bundleCount;
|
|
|
result.num = apiResult.data.bundleInfo.bundleCount;
|
|
|
result.discount = _.has(apiResult.data.bundleInfo, 'discount') ? apiResult.data.bundleInfo.discount : false;
|
|
|
result.promotionPhrase = apiResult.data.bundleInfo.promotionPhrase;
|
|
|
}
|
...
|
...
|
|