This commit is contained in:
SelfRidicule 2024-03-19 11:17:53 +08:00
parent 39ce32b201
commit 1dd20a0380
2 changed files with 42 additions and 15 deletions

View File

@ -0,0 +1,12 @@
import {
request
} from '../selfRequest';
// 唤起支付需要的参数
export function wxPaySignRq(data) {
return request({
url: '/meeting/wxPay/paySign',
method: "post",
data
});
}

View File

@ -5,6 +5,10 @@ import {
selectReservationByIdRq, selectReservationByIdRq,
} from "../../../../api/meeting/meetingRoom.js" } from "../../../../api/meeting/meetingRoom.js"
import {
wxPaySignRq
} from "../../../../api/pay/pay.js"
Page({ Page({
/** /**
@ -83,22 +87,33 @@ Page({
// 确认支付 // 确认支付
payComplete() { payComplete() {
let _this = this; let _this = this;
meetingRoomPayOrderRq({ wxPaySignRq({
id: _this.data.id prepayId: _this.data.detail.prepayId
}).then(res => { }).then(res => {
console.log('meetingRoomPayOrderRq', res); console.log('wxPaySignRq', res);
if (res.code == 0) { // 唤起支付
wx.reLaunch({ _this.callPay(res.data)
url: '/pages/meeting/pay/waitComplete/waitComplete',
}) })
} else { },
// 消息提示
Notify({ // 唤起支付
message: res.msg, callPay(data) {
color: '#FB4B4B', wx.requestPayment({
background: '#FBE9E9', timeStamp: data.timeStamp,
duration: 3000, nonceStr: data.nonceStr,
}); package: data.prepayId,
signType: data.signType,
paySign: data.paySign,
success(res) {
console.log('success' ,res );
},
fail(res) {
console.log('fail' ,res );
},
complete(res) {
console.log('complete' , res);
} }
}) })
}, },