石广澎
2024-06-13 2a93afc95dda6afd1479af042e178b3e84a0c8c4
pages/pay/discountpay.vue
@@ -120,6 +120,7 @@
      queryUseSweepPayCoupon,
      getWechatConfigInfo,
      saveWxOrder,
    saveOrder,
      tlPay
   } from '@/common/api/index'
   import wx from 'weixin-js-sdk'; // 使用js-sdk
@@ -244,7 +245,10 @@
      onLoad(opt) {
         this.isNew = uni.getStorageSync('IS_NEW')
         this.cid = uni.getStorageSync('CID')
         this.discountInfo = uni.getStorageSync('DISCOUNT_INFO')
      if(uni.getStorageSync('DISCOUNT_INFO')){
        this.discountInfo = uni.getStorageSync('DISCOUNT_INFO')
      }
         const token = uni.getStorageSync(ACCESSTOKEN) || null
         if (opt.shopInfo) {
            this.shopInfo = JSON.parse(decodeURIComponent(opt.shopInfo))
@@ -258,6 +262,7 @@
         if (opt.money) {
            this.money = parseFloat(opt.money).toFixed(2)
            let dis = this.money * 100 * (1 - this.discountInfo.shopDiscount)
        console.log('dis',dis)
            let money = parseInt((this.money * 100 * this.discountInfo.shopDiscount))
            if (dis < 1) {
               money = parseInt((this.money * 100))
@@ -332,7 +337,7 @@
            if (this.payWay == 3) {
               params.bankCardId = this.bankCardId
            }
            saveWxOrder(params).then(res => {
        saveOrder(params).then(res => {
               uni.hideLoading()
               try {
                  this.orderId = res.orderId