石广澎
2024-07-30 d113dc3d1e5f3b42ea414e8be538ce2442ffc899
pay/scanpay.vue
@@ -140,7 +140,8 @@
      ACCESSTOKEN
   } from 'common/config.js';
   import {
      queryShop,
    queryShopByCid,
    queryShopByShopId,
      userLogin,
      queryUseSweepPayCoupon,
    getWechatConfigInfo,
@@ -161,7 +162,9 @@
            showRemark: false,
            UNIONID: null,
            payWay: this.$utils.getPlat(),
            cid: '',
            cid: '', //码牌id  C扫B静态码时有
        activityQrcodeId: '', //动态收款码  C扫B动态码时有
        shopId: '', //商户id  C扫B动态码时有
            bordShow: false, // 显示键盘
            shopInfo: {
               cusid: '',
@@ -209,6 +212,14 @@
            this.money = opt.smoney
         }else{
        this.bordShow = true
      }
         if (opt.activityQrcodeId) {
            this.activityQrcodeId = opt.activityQrcodeId
            // this.getOrderInfo()
         }
      if (opt.shopId) {
        this.shopId = opt.shopId
        this.init()
      }
         if (opt.cid) {
            this.cid = opt.cid
@@ -305,11 +316,25 @@
               this.tips = '当前用户过多,请稍后重试~_~'
               this.loading = false
            }, 2000)
        let api = queryShopByCid
        let params = {
          cid: this.cid
        }
        if(this.cid){
          api = queryShopByCid
          params = {
            cid: this.cid
          }
        }
        if(this.activityQrcodeId){
          api = queryShopByShopId
          params = {
            shopId: this.shopId
          }
        }
            //获取商铺信息
            queryShop({
               params: {
                  cid: this.cid
               }
        api({
          params
            }).then(res => {
               clearTimeout(timer)
               this.loading = false
@@ -385,14 +410,19 @@
            // 金额 this.money
            uni.showLoading()
            const params = {
               money: Number(this.money * 100),
               shopId: this.shopInfo.id,
               cid: this.cid,
               payWay: this.payWay,
               buyerNote: this.buyerNote,
               score: 0,
               couponDetailId: this.couponInfo.id
            }
        if(this.activityQrcodeId){
          params.activityQrcodeId = this.activityQrcodeId
        }
        if(this.cid){
          params.money = Number(this.money * 100)
          params.shopId = this.shopInfo.id
          params.cid = this.cid
        }
            //生成订单
            saveOrder(params).then(res => {
               uni.hideLoading()