Authored by 郭成尧

Merge branch 'feature/oneset' into release/5.3.1

@@ -498,8 +498,25 @@ let getNewProductAsyncData = (data) => { @@ -498,8 +498,25 @@ let getNewProductAsyncData = (data) => {
498 498
499 /* 量贩 */ 499 /* 量贩 */
500 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) { 500 if (bundleData && _.get(bundleData, 'bundleInfo.discountType', null) === 2) {
  501 + let minBuyNum = _.get(bundleData, 'bundleInfo.bundleCount', 1);
  502 + let isNotEnough = true;
  503 +
  504 + // 是否满足量贩购买要求:剩余商品数量大于量贩最小购买量
  505 + _.forEach(result.goods_list, goods => {
  506 + _.forEach(goods.size_list, sizes => {
  507 + if (sizes.storage_number > minBuyNum) {
  508 + isNotEnough = false;
  509 + }
  510 + });
  511 + });
  512 +
  513 + if (finalResult.cartInfo && isNotEnough) {
  514 + finalResult.cartInfo.soldOut = isNotEnough;
  515 + finalResult.cartInfo.addToCartUrl = false;
  516 + }
  517 +
501 finalResult.discountBuy = { 518 finalResult.discountBuy = {
502 - num: _.get(bundleData, 'bundleInfo.bundleCount', 1), 519 + num: minBuyNum,
503 promotionPhrase: _.get(bundleData, 'bundleInfo.promotionPhrase', ''), 520 promotionPhrase: _.get(bundleData, 'bundleInfo.promotionPhrase', ''),
504 discount: _.get(bundleData, 'bundleInfo.discount', '') 521 discount: _.get(bundleData, 'bundleInfo.discount', '')
505 }; 522 };