Prechádzať zdrojové kódy

纸质兑换券优化

john 2 rokov pred
rodič
commit
9deefa352a

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

@@ -172,21 +172,22 @@ export default {
       }))
       // 如果纸质优惠券不存在的话,则往 paperCoupons 添加
       if ( this.paperCoupons.findIndex(item => item.discountCode === couponCode) < 0 ) {
-        const {hourPrice} = this.orderDetail.parkingRule
+        // const {hourPrice} = this.orderDetail.parkingRule
         // const discountTime = Number(res.discountFee) / hourPrice
         const paperCoupons =  [
           ...this.paperCoupons,
           {
             ...res,
+            code: res.discountCode
             // discountTime: res.discountFee / hourPrice
           }
         ]
         this.paperCouponList = paperCoupons
         this.$store.commit('order/setPaperCoupons',paperCoupons)
         // 金额
-        this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee + Number(res.discountFee))
+        // this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee + Number(res.discountFee))
         // 时间
-        this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
+        // this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
       }
     },
     // 删除
@@ -194,12 +195,12 @@ export default {
       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
+      // const discountTime = Number(item.discountFee) / hourPrice
       this.$store.commit('order/setPaperCoupons',this.paperCouponList)
       // 金额
-      this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee - Number(item.discountFee))
+      // this.$store.commit('order/setPaperDiscountFee',this.paperDiscountFee - Number(item.discountFee))
       // 时间
-      this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
+      // this.$store.commit('order/setPaperDiscountTime',this.paperDiscountTime + discountTime)
     },
 
     // 确认