ソースを参照

Merge pull request #133 from John-Hong/John/release-2.9.0/SCRM-3932

纸质兑换券优化
Tron 2 年 前
コミット
c0b626a01d

+ 2 - 2
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -201,13 +201,13 @@ export default {
         // 纸质优惠券
         if ( paperCoupons?.length ) {
             params.discountInfo.paperCoupons = paperCoupons.filter(elm => {
-              if ( !elm.discountCode ) {
+              if ( !elm.discountFee ) {
                 return false
               }
               return {
                 ...elm,
                 "discountFee": elm.discountFee,
-                discountTime: elm.discountFee / hourPrice * 60
+                // discountTime: elm.discountFee / hourPrice * 60
               }
             })
          }

+ 6 - 6
src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

@@ -173,12 +173,12 @@ export default {
       // 如果纸质优惠券不存在的话,则往 paperCoupons 添加
       if ( this.paperCoupons.findIndex(item => item.discountCode === couponCode) < 0 ) {
         const {hourPrice} = this.orderDetail.parkingRule
-        const discountTime = Number(res.discountFee) / hourPrice
+        // const discountTime = Number(res.discountFee) / hourPrice
         const paperCoupons =  [
           ...this.paperCoupons,
           {
             ...res,
-            discountTime: res.discountFee / hourPrice
+            // discountTime: res.discountFee / hourPrice
           }
         ]
         this.paperCouponList = paperCoupons
@@ -191,11 +191,11 @@ export default {
     },
     // 删除
     deleteCoupon( i ) {
-      const item = this.paperCoupons[i]
-      const paperCoupons = this.paperCoupons.filter(elm => elm.discountCode !== item.discountCode)
+      const item = this.paperCouponList[i]
+      this.paperCouponList = this.paperCouponList.filter(elm => elm.discountCode !== item.discountCode)
       const {hourPrice} = this.orderDetail.parkingRule
       const discountTime = Number(item.discountFee) / hourPrice
-      this.$store.commit('order/setPaperCoupons',paperCoupons)
+      this.$store.commit('order/setPaperCoupons',this.paperCouponList)
       // 金额
       this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee - Number(item.discountFee))
       // 时间
@@ -207,7 +207,7 @@ export default {
       console.log(310,this.orderDetail);
       
       this.$store.dispatch('order/savePaperCoupon', {
-        couponList: this.paperCoupons,
+        paperCoupons: this.paperCoupons,
         callback: () => {
           this.$router.back();
         },

+ 1 - 1
src/pages/parkingFee/parkingFeeDetail.vue

@@ -49,7 +49,7 @@
             <van-icon name="arrow"/>
           </div>
         </div>
-        <div class="info-item-box" v-if="enablePaperCoupons">
+        <div class="info-item-box" v-if="enablePaperCoupons || orderDetail.parkInfo.parkMallCode === 1">
           <div class="label">纸质优惠劵</div>
           <div :class="['value', 'text-red']" @click="paperCoupon">扫描纸质优惠劵二维码
             <van-icon name="arrow"/>

+ 1 - 1
src/pages/parkingFee/parkingFeeDetailSuccess.vue

@@ -79,7 +79,7 @@
             <span class="info-key">会员卡券</span>
             <span class="info-value ">{{ detail.discountInfo.couponDiscount | currency }}</span>
           </div>
-          <div class="parking-info-item" v-if="detail.paperCouponCode">
+          <div class="parking-info-item" v-if="detail.discountInfo && detail.discountInfo.paperCouponDiscount">
             <span class="info-key">纸质优惠券</span>
             <span class="info-value ">{{ detail.discountInfo.paperCouponDiscount | currency }}</span>
           </div>

+ 1 - 1
src/store/order/paperCoupon.js

@@ -23,7 +23,7 @@ export default {
     try {
       const orderDetail = {...state.orderDetail};
       setSelected(['coupons','consume','points','memberGrade'], orderDetail)
-      orderDetail.discountInfo.paperCoupons = state.paperCoupons.map(elm => {
+      orderDetail.discountInfo.paperCoupons = paperCoupons.map(elm => {
         return {
           ...elm,
           selected: true,

+ 6 - 6
src/store/order/points.js

@@ -127,9 +127,9 @@ export default {
       if ( type === 'add' && (state.pointsTime >= maxPointsTime || state.usingTotalDiscount >= state.availableDiscountFee) ) {
         // 以下是深圳积分上限规则
         // 超出抵扣上限,每日最高可抵扣${this.parkFee.parkInfoEntity.maxOneDayHour}元 '优惠金额' >= '每日最高可抵扣'
-        if ( state.usingTotalDiscount >= state.availableDiscountFee && !msg ) {
-          msg = `超出抵扣上限,每日最高可抵扣${ state.maxOneDayDiscountFee }元`
-        }
+        // if ( state.usingTotalDiscount >= state.availableDiscountFee && !msg ) {
+        //   msg = `超出抵扣上限,每日最高可抵扣${ state.maxOneDayDiscountFee }元`
+        // }
         // 超出抵扣上限,每次最高可抵扣${this.integralMaxMoney}元 '积分兑换时长' >= '深圳前海停车积分上限'q
         if ( state.pointsTime >= state.maxDiscountFee && !msg ) {
           msg = `超出抵扣上限,每次最高可抵扣${ state.maxDiscountFee }元`
@@ -168,9 +168,9 @@ export default {
     }
     // 计算浦东的上限
     // if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && state.unlimitUsePoints === 'LIMIT') {
-    if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && !state.unLimitWeekendPoints) {
-      return;
-    }
+    // if ( type === 'add' && state.usingTotalDiscount >= state.availableDiscountFee && parkMallCode === 5 && !state.unLimitWeekendPoints) {
+    //   return;
+    // }
     if ( type === 'add' ) {
       let pointsTime = 0;
       pointsTime = state.pointsTime + (parkMallCode === 5 ? state.unitAmount : state.unitHour);