mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 13:09:38 +08:00
1
This commit is contained in:
parent
39ce32b201
commit
1dd20a0380
12
miniprogram/api/pay/pay.js
Normal file
12
miniprogram/api/pay/pay.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import {
|
||||||
|
request
|
||||||
|
} from '../selfRequest';
|
||||||
|
|
||||||
|
// 唤起支付需要的参数
|
||||||
|
export function wxPaySignRq(data) {
|
||||||
|
return request({
|
||||||
|
url: '/meeting/wxPay/paySign',
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
@ -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({
|
callPay(data) {
|
||||||
message: res.msg,
|
wx.requestPayment({
|
||||||
color: '#FB4B4B',
|
timeStamp: data.timeStamp,
|
||||||
background: '#FBE9E9',
|
nonceStr: data.nonceStr,
|
||||||
duration: 3000,
|
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);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user