水滴兑换模块开发完成

This commit is contained in:
2023-07-27 16:27:08 +08:00
parent 454b6963a4
commit a0399a8944
14 changed files with 986 additions and 887 deletions

View File

@@ -24,6 +24,9 @@ Page({
* 确认支付
*/
payBtn() {
this.setData({
disabled: false
})
wx.showLoading({
title: '支付中...',
mask : true
@@ -31,9 +34,6 @@ Page({
let that = this
wx.$api.mall.mallPay(this.data.orderNo,{type: 'miniapp', openid: wx.getStorageSync("openid")}).then(res=>{
wx.hideLoading()
this.setData({
disabled: false
})
let payInfo = JSON.parse(res.data.wechat)
wx.requestPayment({
timeStamp: payInfo.timeStamp,
@@ -51,7 +51,8 @@ Page({
mask:true,
success: function () {
that.setData({
paySuccess: true
paySuccess: true,
disabled: true
})
setTimeout(()=>{
wx.redirectTo({
@@ -71,7 +72,8 @@ Page({
mask:true,
success: function () {
that.setData({
paySuccess: true
paySuccess: true,
disabled: true
})
setTimeout(()=>{
wx.redirectTo({
@@ -82,6 +84,10 @@ Page({
})
}
})
}).catch(err => {});
}).catch(err => {
that.setData({
disabled: true
})
});
}
})