diff --git a/miniprogram/api/pay/pay.js b/miniprogram/api/pay/pay.js index 3ebf39f..692282d 100644 --- a/miniprogram/api/pay/pay.js +++ b/miniprogram/api/pay/pay.js @@ -10,3 +10,12 @@ export function wxPaySignRq(data) { data }); } + +// 查询订单状态 +export function wxMerchantOrderQueryRq(data) { + return request({ + url: '/meeting/wxPay/wxMerchantOrderQuery', + method: "post", + data + }); +} diff --git a/miniprogram/pages/meeting/pay/waitPay/waitPay.js b/miniprogram/pages/meeting/pay/waitPay/waitPay.js index f78887d..badef83 100644 --- a/miniprogram/pages/meeting/pay/waitPay/waitPay.js +++ b/miniprogram/pages/meeting/pay/waitPay/waitPay.js @@ -6,7 +6,8 @@ import { } from "../../../../api/meeting/meetingRoom.js" import { - wxPaySignRq + wxPaySignRq, + wxMerchantOrderQueryRq } from "../../../../api/pay/pay.js" Page({ @@ -98,6 +99,7 @@ Page({ // 唤起支付 callPay(data) { + let _this = this; wx.requestPayment({ timeStamp: data.timeStamp, nonceStr: data.nonceStr, @@ -105,15 +107,41 @@ Page({ signType: data.signType, paySign: data.paySign, success(res) { - console.log('success' ,res ); + console.log('success', res); }, fail(res) { - console.log('fail' ,res ); + console.log('fail', res); }, complete(res) { - console.log('complete' , res); + console.log('complete', res); + // 查询订单详情 + _this.wxMerchantOrderQuery() + } + }) + }, + + // 查询订单详情 + wxMerchantOrderQuery() { + let _this = this + wxMerchantOrderQueryRq({ + outTradeNo: _this.data.detail.oderNumber + }).then(res => { + console.log('wxMerchantOrderQuery', res); + if (res.code == '200') { + Notify({ + type: 'primary', + message: res.msg + }); + wx.reLaunch({ + url: '/pages/meeting/pay/waitComplete/waitComplete', + }) + } else { + Notify({ + type: 'warning', + message: res.msg + }); } }) },