Răsfoiți Sursa

fix(KIP-10378): 临时停车,纸质优惠券,扫描数量超过7张以后,页面显示错误

john 2 ani în urmă
părinte
comite
be548a737a

+ 11 - 12
src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

@@ -171,34 +171,33 @@ export default {
         return item.discountCode === couponCode
       }))
       // 如果纸质优惠券不存在的话,则往 paperCoupons 添加
-      if ( this.paperCoupons.findIndex(item => item.discountCode === couponCode) < 0 ) {
+      if ( this.paperCouponList.findIndex(item => item.code === couponCode) < 0 ) {
         // const {hourPrice} = this.orderDetail.parkingRule
         // const discountTime = Number(res.discountFee) / hourPrice
-        const paperCoupons =  [
-          ...this.paperCoupons,
+        const paperCouponList =  [
+          ...this.paperCouponList,
           {
             ...res,
-            code: res.discountCode
+            code: couponCode
             // discountTime: res.discountFee / hourPrice
           }
         ]
-        this.paperCouponList = paperCoupons
-        this.$store.commit('order/setPaperCoupons',paperCoupons)
+        this.paperCouponList = paperCouponList
+        this.$store.commit('order/setPaperCoupons',paperCouponList)
         // 金额
-        // 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)
       }
     },
     // 删除
-    deleteCoupon( i ) {
-      const item = this.paperCouponList[i]
-      this.paperCouponList = this.paperCouponList.filter(elm => elm.discountCode !== item.discountCode)
-      const {hourPrice} = this.orderDetail.parkingRule
+    deleteCoupon( item ) {
+      this.paperCouponList = this.paperCouponList.filter(elm => elm.code !== item.code)
+      // const {hourPrice} = this.orderDetail.parkingRule
       // 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)
     },

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

@@ -17,7 +17,7 @@
           </div>
           <div class="menu_item" @click="doRouter3" v-if="source !== 'KIP'">
             <img :src="`${require(`./static/images/icon-coupon.png`)}`" />
-            <span>停车兑换</span>
+            <span>停车兑换</span>
           </div>
           <div class="menu_item" @click="doRouter1">
             <img :src="`${require(`./static/images/icon-ticket.png`)}`" />

+ 35 - 49
src/pages/parkingFee/parkingFeePaperCoupon.vue

@@ -1,65 +1,50 @@
 <template>
   <div :class="['scroll-Y', theme]">
-    <div class="worp">
-      <div class="title">纸质优惠劵减免说明</div>
-      <div style="font-size: 28px; color: #808080; padding-top: 12px">
-        {{ orderDetail && orderDetail.parkingRule && orderDetail.parkingRule.paperCouponsDescription || '' }}
+    <div>
+      <div class="worp">
+        <div class="title">纸质优惠劵减免说明</div>
+        <div style="font-size: 28px; color: #808080; padding-top: 12px">
+          {{ (orderDetail && orderDetail.parkingRule && orderDetail.parkingRule.paperCouponsDescription) || '' }}
+        </div>
+      </div>
+      <div v-if="paperCouponList.length">
+        <div class="worp_index1" v-for="(item, index) in paperCouponList" :key="item.code">
+          <div class="worp_index1_index">
+            <div class="content">劵码 {{ item.discountCode }}</div>
+            <div @click="deleteCoupon(item)"><van-icon name="delete-o" /></div>
+          </div>
+          <div style="padding-bottom: 25px; margin-left: 20px; margin-top: 20px; font-size: 28px">
+            优惠劵金额 :<span style="color: #064c8a">{{ item.discountFee | currency }}</span>
+          </div>
+        </div>
       </div>
-    </div>
-    <template v-if="paperCouponList.length">
       <div
-        class="worp_index1"
-        v-for="(item, index) in paperCouponList"
-        :key="item.discountCode"
+        :class="{
+          worp_button: true,
+        }"
+        @click="scanCode"
       >
-        <div class="worp_index1_index">
-          <div class="content">劵码 {{ item.discountCode }}</div>
-          <div @click="deleteCoupon(index)"><van-icon name="delete-o" /></div>
-        </div>
-        <div
-          style="
-            padding-bottom: 25px;
-            margin-left: 20px;
-            margin-top: 20px;
-            font-size: 28px;
-          "
-        >
-          优惠劵金额 :<span style="color: #064c8a">{{
-            item.discountFee | currency
-          }}</span>
-        </div>
+        <img :src="require('./static/images/sweep.png')" style="width: 35px; height: 35px; margin-right: 20px" />
+        <div>扫码用劵</div>
       </div>
-    </template>
-    <div
-      :class="{
-        worp_button: true,
-      }"
-      @click="scanCode"
-    >
-      <img
-        :src="require('./static/images/sweep.png')"
-        style="width: 35px; height: 35px; margin-right: 20px"
-      />
-      <div>扫码用劵</div>
+      <div style="height: 220px;"></div>
     </div>
     <div class="flewx">
-      <div style="display: flex; width: 100%;align-items: center">
+      <div style="display: flex; width: 100%; align-items: center">
         <!-- <div class="flewx-content">应付<span style="color: red;font-size: 32px;padding-left: 20px;">{{actualFee |
       currency}}</span> 元 <span style="color: #8d8d8d;padding-left: 30px;font-size: 28px;">已优惠{{discountFee |
           currency}}元</span>
       </div> -->
         <div class="flewx-content">
           已选<span class="num">{{ paperCouponList.length }}张</span>
-          <span class="discountFee"
-          >优惠券可优惠{{ paperDiscountFee | currency }}</span
-          >
+          <span class="discountFee">优惠券可优惠{{ paperDiscountFee | currency }}</span>
         </div>
         <div class="btn-box">
-          <k-button style="width: 100%;max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm"/>
+          <k-button style="width: 100%; max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm" />
         </div>
       </div>
       <!-- 开启底部安全区适配 -->
-      <van-number-keyboard safe-area-inset-bottom />
+      <!-- <van-number-keyboard safe-area-inset-bottom /> -->
     </div>
     <!-- 新的toast -->
     <fui-toast ref="toast"></fui-toast>
@@ -67,11 +52,11 @@
 </template>
 
 <script>
-import parkingFeePaperCouponJs from './mixins/parkingFeePaperCoupon'
-import baseMixins from './mixins/base'
+import parkingFeePaperCouponJs from './mixins/parkingFeePaperCoupon';
+import baseMixins from './mixins/base';
 export default {
-  mixins:[baseMixins, parkingFeePaperCouponJs]
-}
+  mixins: [baseMixins, parkingFeePaperCouponJs],
+};
 </script>
 
 <style lang="less" scoped>
@@ -81,12 +66,13 @@ export default {
   flex-direction: column;
   height: 100vh;
   background: #f4f7ff;
+  overflow-y: scroll;
 }
 
 .worp {
   padding-left: 30px;
   margin-top: 30px;
-  overflow: hidden;
+  // overflow: hidden;
 
   .title {
     font-size: 30px;
@@ -150,7 +136,7 @@ export default {
   align-items: center;
   // padding-bottom: constant(safe-area-inset-bottom);
   // padding-bottom: env(safe-area-inset-bottom);
-  padding-bottom: 20px;
+  padding-bottom: 50px;
   padding-top: 33px;
 
   .flewx-content {