美文网首页
调起支付

调起支付

作者: 曹锦花 | 来源:发表于2020-08-06 16:55 被阅读0次
    //补差价  
    difference(e) {
      post(clientApiCode.orderPayBc, {
        orderId: e.currentTarget.dataset.id
      }).then((res) => {
        if (res.code === 0) {
          let orderId = this.orderId;
          let { appId, timeStamp, nonceStr, packageValue, signType, paySign } = res.data
          this.requestPayment(appId, timeStamp, nonceStr, packageValue, signType, paySign, orderId)
        } else {
          wx.showToast({
            title: res.message,
            icon: "none"
          })
        }
      })
    },
  // 唤起支付流程
  requestPayment(appId, timeStamp, nonceStr, packageValue, signType, paySign, orderId) {
    let _wx = wx
    let _this = this
    wx.requestPayment({
      timeStamp: timeStamp,
      nonceStr: nonceStr,
      package: packageValue,
      signType: signType,
      paySign: paySign,
      success(res) {
      },
      fail(res) {
        wx.showToast({
          title: '支付失败',
          icon: 'none'
        })
      }, complete(res) {
        _wx.showModal({
          title: '提示',
          content: '请确认支付状态',
          cancelText: '支付失败',
          cancelColor: '#666666',
          confirmText: '支付完成',
          confirmColor: '#FCA800',
          success(res) {
            if (res.confirm) {
              _this.findOrderInfo(orderId)
            } else if (res.cancel) {

            }
          }
        })
      }

    })
  },

相关文章

网友评论

      本文标题:调起支付

      本文链接:https://www.haomeiwen.com/subject/dkhtdktx.html