Merge remote-tracking branch 'origin/release/5.4.1' into release/5.4.1
Showing
1 changed file
with
11 additions
and
4 deletions
@@ -140,7 +140,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys | @@ -140,7 +140,7 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys | ||
140 | if (it.min_buy_number) { | 140 | if (it.min_buy_number) { |
141 | goods.minBuyNumber = Number(it.min_buy_number); | 141 | goods.minBuyNumber = Number(it.min_buy_number); |
142 | 142 | ||
143 | - if(goods.minBuyNumber > 1) { | 143 | + if (goods.minBuyNumber > 1) { |
144 | goods.tipMessage = goods.minBuyNumber + '件起购'; | 144 | goods.tipMessage = goods.minBuyNumber + '件起购'; |
145 | } | 145 | } |
146 | } | 146 | } |
@@ -598,12 +598,19 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { | @@ -598,12 +598,19 @@ const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { | ||
598 | 598 | ||
599 | if (!result.advanceCart && !result.ordinaryCart) { | 599 | if (!result.advanceCart && !result.ordinaryCart) { |
600 | result.isEmpty = true; | 600 | result.isEmpty = true; |
601 | + return result; | ||
602 | + } | ||
603 | + | ||
604 | + if (_.get(result, 'ordinaryCart.promotionInfos')) { | ||
605 | + result.ordinaryCart.promotionInfos = _.filter(result.ordinaryCart.promotionInfos, pinfo => { | ||
606 | + return pinfo && pinfo.tag && pinfo.promotionId > 0; | ||
607 | + }); | ||
601 | } | 608 | } |
602 | 609 | ||
603 | // promotionInfos, gifts, priceGifts 放一起展示 | 610 | // promotionInfos, gifts, priceGifts 放一起展示 |
604 | - let hasGifts = result.ordinaryCart.gifts && result.ordinaryCart.gifts.length; | ||
605 | - let hasPrices = result.ordinaryCart.priceGifts && result.ordinaryCart.priceGifts.length; | ||
606 | - let hasPromo = result.ordinaryCart.promotionInfos && result.ordinaryCart.promotionInfos.length; | 611 | + let hasGifts = _.get(result, 'ordinaryCart.gifts') && _.get(result, 'ordinaryCart.gifts').length; |
612 | + let hasPrices = _.get(result, 'ordinaryCart.priceGifts') && _.get(result, 'ordinaryCart.priceGifts').length; | ||
613 | + let hasPromo = _.get(result, 'ordinaryCart.promotionInfos') && _.get(result, 'ordinaryCart.promotionInfos').length; | ||
607 | let orderAmount = (parseFloat(_.get(advStat, 'orderAmount', 0)) + | 614 | let orderAmount = (parseFloat(_.get(advStat, 'orderAmount', 0)) + |
608 | parseFloat(_.get(ordStat, 'orderAmount', 0))).toFixed(2); | 615 | parseFloat(_.get(ordStat, 'orderAmount', 0))).toFixed(2); |
609 | let lastOrderAmount = (parseFloat(_.get(advStat, 'lastOrderAmount', 0)) + | 616 | let lastOrderAmount = (parseFloat(_.get(advStat, 'lastOrderAmount', 0)) + |
-
Please register or login to post a comment