石广澎
2025-03-07 fb809790d865c5ec0a107c752f1a8c0be151cb9b
feat(支付):折扣券最大减免金额支持
1个文件已修改
17 ■■■■ 已修改文件
pay/scanpay.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pay/scanpay.vue
@@ -199,12 +199,14 @@
      couponInfo: {
        id: '',
        discount: 0,
        thresholdValue: 0
        thresholdValue: 0,
        discountMax: 0,
      }, // 优惠券内容
      checkCoupon: {
        id: null,
        discount: 0,
        thresholdValue: 0
        thresholdValue: 0,
        discountMax: 0,
      },
    };
  },
@@ -224,7 +226,10 @@
        return parseFloat(num);
      }
      const dis = 1 - parseFloat(this.checkCoupon.discount)
      const dic = Math.floor(this.$utils.accMul(this.money,100) * dis)
      let dic = Math.floor(this.$utils.accMul(this.money,100) * dis)
      if(dic>this.checkCoupon.discountMax){
        dic = this.checkCoupon.discountMax
      }
      return this.$utils.fenToYuan(dic).toFixed(2);
    },
    discount() {
@@ -236,7 +241,10 @@
        return parseFloat(num);
      }
      const dis = 1 - parseFloat(this.couponInfo.discount)
      const dic = Math.floor(this.$utils.accMul(this.money,100) * dis)
      let dic = Math.floor(this.$utils.accMul(this.money,100) * dis)
      if(dic>this.couponInfo.discountMax){
        dic = this.couponInfo.discountMax
      }
      return this.$utils.fenToYuan(dic).toFixed(2);
    },
    payMoney() {
@@ -428,6 +436,7 @@
              thresholdValue: res.thresholdValue,
              discount: res.discount,
              discountType: res.discountType,
              discountMax: res.discountMax
            }
          }
        }