feat(支付):
1、未输入金额时不加载优惠券
2、金额变动时,取消选定的优惠券
1个文件已修改
33 ■■■■ 已修改文件
pay/scanpay.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pay/scanpay.vue
@@ -39,6 +39,7 @@
                  font-size: 13px;
                  color: #999
                }
                .btn {
                  font-size: 13px;
                  color: #1E8BE0
@@ -233,7 +234,7 @@
        code: opt.code
      }
      let code = opt.code
      if (this.payWay == 2&&opt.state == 1 ) { //微信
      if (this.payWay == 2 && opt.state == 1) { //微信
        params.getUserInfo = 1
      }
      if (this.payWay == 5) { //支付宝
@@ -303,7 +304,7 @@
      uni.setStorageSync(ACCESSTOKEN, res.token)
      uni.setStorageSync('IS_NEW', res.isNew)
      this.isNew = res.isNew
      if (!res.isNew) {
      if (!res.isNew && !uni.$u.test.isEmpty(this.money)) {
        this.showCoupon()
      }
    },
@@ -319,6 +320,16 @@
    // 更新金额
    changeMoney(str) {
      this.money = str;
      this.couponInfo = {
        id: '',
        discount: 0,
        thresholdValue: 0
      } // 优惠券内容
      this.checkCoupon = {
        id: null,
        discount: 0,
        thresholdValue: 0
      }
    },
    // 展示键盘
    showBord() {
@@ -360,7 +371,7 @@
      }).catch((err) => {
        clearTimeout(timer)
        this.shopInfo.scanFlag = 0
        this.tips = err.description||'当前用户过多,请稍后重试~_~'
        this.tips = err.description || '当前用户过多,请稍后重试~_~'
        this.loading = false
      })
@@ -386,7 +397,11 @@
    },
    // 获取会员相关信息
    showCoupon() {
      if(this.UNIONID){
      if (this.UNIONID) {
        if (uni.$u.test.isEmpty(this.money)) {
          uni.$u.toast('请输入金额!')
          return
        }
        //获取用户优惠券
        queryUseSweepPayCoupon({
          params: {
@@ -398,7 +413,7 @@
          this.couponList = res
          this.couponShow = true
        })
      }else{
      } else {
        this.toRegister()
      }
@@ -513,9 +528,11 @@
      });
    },
    closeOrder() {
      closeOrder({params:{
        id: this.orderId,
      }}).then(res => {
      closeOrder({
        params: {
          id: this.orderId,
        }
      }).then(res => {
      })
    }
  }