Browse Source

fix(SCRM-5682): 添加数组的空状态判断和调整用户可用优惠的判断变量

john 1 year ago
parent
commit
dff7a6ae91

+ 4 - 4
src/pages/parkingFee/mixins/parkingFeeCoupon.js

@@ -77,11 +77,11 @@ export default {
        * */
       this.couponList = [...this.coupons];
       this.remainPrice = this.usingTotalDiscount;
-      if ((this.parkMallCode === 4 || this.parkMallCode === 6) && this.orderDetail?.discountInfo?.points[0]?.discountFee) {
+      if ((this.parkMallCode === 4 || this.parkMallCode === 6) && this.orderDetail?.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail.discountInfo.points[0].discountFee
       }   
       // 如果前海开启无积分上限的话,则
-      if ( [5, 10].indexOf(parkMallCode) > -1 && this.unLimitWeekendPoints && this.orderDetail.discountInfo?.points[0]?.discountFee) {
+      if ( [5, 10].indexOf(parkMallCode) > -1 && this.unLimitWeekendPoints && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail?.discountInfo?.points[0]?.discountFee
       }
       this.newAvailableDiscountFee = this.availableDiscountFee
@@ -333,7 +333,7 @@ export default {
         }
       }
       // 深圳超限处理
-      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
+      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.newAvailableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -342,7 +342,7 @@ export default {
       }
 
       // 单日上限
-      if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
+      if (oneDayLimitation && this.remainPrice >= this.newAvailableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,

+ 4 - 4
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -77,11 +77,11 @@ export default {
        * */
       this.couponList = [...this.coupons];
       this.remainPrice = this.usingTotalDiscount;
-      if ((this.parkMallCode === 4 || this.parkMallCode === 6) && this.orderDetail?.discountInfo?.points[0]?.discountFee) {
+      if ((this.parkMallCode === 4 || this.parkMallCode === 6) && this.orderDetail?.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail.discountInfo.points[0].discountFee
       }   
       // 前海积分不参与当前电子券优惠上限
-      if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && this.orderDetail.discountInfo?.points[0]?.discountFee) {
+      if ( [ 5, 10 ].indexOf(parkMallCode) > -1 && this.orderDetail.discountInfo?.points?.[0]?.discountFee) {
         this.remainPrice = this.remainPrice - this.orderDetail?.discountInfo?.points[0]?.discountFee
       }
       this.newAvailableDiscountFee = this.availableDiscountFee
@@ -334,7 +334,7 @@ export default {
         }
       }
       // 深圳超限处理
-      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.availableDiscountFee) {
+      if ([5, 10].indexOf(parkMallCode) > -1 && this.remainPrice  >= this.newAvailableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: `优惠券已达当日使用上限,不可再用`,
@@ -343,7 +343,7 @@ export default {
       }
 
       // 单日上限
-      if (oneDayLimitation && this.remainPrice >= this.availableDiscountFee) {
+      if (oneDayLimitation && this.remainPrice >= this.newAvailableDiscountFee) {
         if ( showMsg ) return true
         return Toast({
           message: [5, 10].indexOf(parkMallCode) > -1 ? '当日优惠已达上限,不可再用' : `每日最高可抵扣${maxOneDayDiscountFee}元`,