...
|
...
|
@@ -498,8 +498,25 @@ let getNewProductAsyncData = (data) => { |
|
|
|
|
|
/* 量贩 */
|
|
|
if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) {
|
|
|
let minBuyNum = _.get(bundleData, 'bundleInfo.bundleCount', 1);
|
|
|
let isNotEnough = true;
|
|
|
|
|
|
// 是否满足量贩购买要求:剩余商品数量大于量贩最小购买量
|
|
|
_.forEach(result.goods_list, goods => {
|
|
|
_.forEach(goods.size_list, sizes => {
|
|
|
if (sizes.storage_number > minBuyNum) {
|
|
|
isNotEnough = false;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (finalResult.cartInfo && isNotEnough) {
|
|
|
finalResult.cartInfo.soldOut = isNotEnough;
|
|
|
finalResult.cartInfo.addToCartUrl = false;
|
|
|
}
|
|
|
|
|
|
finalResult.discountBuy = {
|
|
|
num: _.get(bundleData, 'bundleInfo.bundleCount', 1),
|
|
|
num: minBuyNum,
|
|
|
promotionPhrase: _.get(bundleData, 'bundleInfo.promotionPhrase', ''),
|
|
|
discount: _.get(bundleData, 'bundleInfo.discount', '')
|
|
|
};
|
...
|
...
|
|