Explorar o código

Merge pull request #330 from John-Hong/John/release-2.20.0/SCRM-5068-2

停车支付宝加入新会员积分控件
Tron hai 1 ano
pai
achega
5964ec8004

+ 11 - 0
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -13,10 +13,12 @@ import {
 } from '@/utils';
 import { Dialog, Toast } from 'vant';
 import { ordersAndPrepay } from '@/api/parking';
+import newMemberPointsItem from '@/components/newMemberPoints/item.vue'
 // import checkOutResponse from '@/api/mockData/checkout.hz.response'
 
 export default {
   name: 'parkingFeeDetail',
+  components: { newMemberPointsItem },
   data() {
     return {
       hasDiscount: false,
@@ -271,6 +273,15 @@ export default {
             "discountPoints": discountFee / hourPrice * pointsPerUnit
           }
         }
+        // 新会员积分
+        if (newMemberPoints?.discountFee && newMemberPoints?.discountFee) {
+          const { pointsPerUnit, unitAmount, discountFee, available } = newMemberPoints
+          params.discountInfo.newMemberPoints = {
+            "discountTime": discountFee / hourPrice * 60,
+            "discountFee": discountFee,
+            "discountPoints": discountFee / hourPrice * pointsPerUnit
+          }
+        }
         // 优惠券
         if (coupons?.length) {
           const selectedCoupons = coupons.filter(elm => {

+ 2 - 0
src/pages/parkingFee/parkingFeeDetail.vue

@@ -35,6 +35,8 @@
             <van-icon name="arrow"/>
           </div>
         </div>
+        <!-- 新会员积分 -->
+        <newMemberPointsItem></newMemberPointsItem>
         <div class="info-item-box" v-if="enablePoints">
           <div class="label">积分减免</div>
           <div :class="['value']" @click="showPointsMathPopup('bottom')">

+ 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',

+ 1 - 0
src/pages/parkingFeeV2/mixins/parkingFeeDetail.js

@@ -343,6 +343,7 @@ export default {
             "discountPoints": discountFee / hourPrice * pointsPerUnit
           }
         }
+        // 新会员积分
         if (newMemberPoints?.discountFee && newMemberPoints?.discountFee) {
           const { pointsPerUnit, unitAmount, discountFee, available } = newMemberPoints
           params.discountInfo.newMemberPoints = {