Explorar o código

Merge pull request #416 from John-Hong/release-3.2.0

fix(SCRM-5682): 添加数组的空状态判断和调整用户可用优惠的判断变量
John-Hong hai 1 ano
pai
achega
e3cc1e8f43

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

@@ -78,11 +78,11 @@ export default {
        * */
       this.couponList = [...this.coupons];
       this.remainPrice = this.usingTotalDiscount - this.paperDiscountFee;
-      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
@@ -280,7 +280,6 @@ export default {
       // 最高优先级,提示未生效的电子券
       if (item.status === 'unavailable' || moment().isSameOrAfter(item.expirationDate)) {
         return Toast({
-          className: 'top300',
           message: `当前电子券暂未生效,不可用`,
           className: "white-space",
           icon: 'none',
@@ -290,7 +289,6 @@ export default {
       if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 8) ) {
         if ( showMsg ) return true
         return Toast({
-          className: 'top300',
           message: `电子券每天最多可使用${ this.maxOneDayCoupons }张`,
           className: "white-space",
           icon: 'none',
@@ -336,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: `优惠券已达当日使用上限,不可再用`,
@@ -346,7 +344,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 - 6
src/pages/parkingFeeV2/mixins/parkingFeeCoupon.js

@@ -78,11 +78,11 @@ export default {
        * */
       this.couponList = [...this.coupons];
       this.remainPrice = this.usingTotalDiscount - this.paperDiscountFee;
-      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
@@ -281,7 +281,6 @@ export default {
       // 最高优先级,提示未生效的电子券
       if (item.status === 'unavailable' || moment().isSameOrAfter(item.expirationDate)) {
         return Toast({
-          className: 'top300',
           message: `当前电子券暂未生效,不可用`,
           className: "white-space",
           icon: 'none',
@@ -291,7 +290,6 @@ export default {
       if ( this.checkedCouponList.length >= this.remainCoupons && (this.parkMallCode === 2 || this.parkMallCode === 8 || this.parkMallCode === 7 || this.parkMallCode === 9) ) {
         if ( showMsg ) return true
         return Toast({
-          className: 'top300',
           message: `电子券每天最多可使用${ this.maxOneDayCoupons }张`,
           className: "white-space",
           icon: 'none',
@@ -337,7 +335,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: `优惠券已达当日使用上限,不可再用`,
@@ -347,7 +345,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}元`,