Переглянути джерело

fix(SCRM-5077): 修改浦东的消费减免的上限字段为当前时间

john 1 рік тому
батько
коміт
c0e5addd3a
1 змінених файлів з 6 додано та 4 видалено
  1. 6 4
      src/pages/parkingFeeV2/Discounts/index.js

+ 6 - 4
src/pages/parkingFeeV2/Discounts/index.js

@@ -3,6 +3,7 @@ import { mapState } from 'vuex';
 import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
 import { cloneDeep } from 'lodash'
 import baseMixins from '../mixins/base';
+import { waitByTime } from "@/utils";
 // import uni from '@/utils/uniHooks';
 // const app = getApp()
 export default {
@@ -235,7 +236,7 @@ export default {
       const { memberGrade = [{}], consume = [], memberLevelDiscount, points = [{}] } = this.orderDetail.discountInfo;
       const { maxConsumeTime, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
       // 如果积分存在的话,则移除积分的优惠
-      if (JSON.stringify(points) !== {}) {
+      if (points.length && JSON.stringify(points[0]) !== "{}") {
         this.remainPrice = this.parkMallCode !== 1 ? this.usingTotalDiscount - points[0].discountFee : this.usingTotalDiscount;
       }
       this.memberGrade = { ...memberGrade[0] };
@@ -274,7 +275,7 @@ export default {
       this.discountInit()
       setTimeout(() => {
         this.isInit = this.isInit + 1
-        
+
       }, 300)
     },
     discountInit() {
@@ -456,7 +457,8 @@ export default {
         }
       }
     },
-    reducesClick() {
+    async reducesClick() {
+      await waitByTime(200)
       // 浦东
       if(this.parkMallCode === 1 && (this.isReduces || !this.maxReduceDiscount) ) {
         return;
@@ -526,7 +528,7 @@ export default {
       }
       // 单次上限限制 浦东
       const remainHour = this.remainPrice / hourPrice
-      if (oneTimeLimitation &&  remainConsumeTime - remainHour < 1) {
+      if (oneTimeLimitation &&  maxOneTimeDiscountTime - remainHour < 1) {
         Toast({
           message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
           icon: 'none',