|
|
|
@ -47,6 +47,9 @@ Page({ |
|
|
|
codeId:null, |
|
|
|
inputAreaHeight: 0, |
|
|
|
heightTimer: null, |
|
|
|
|
|
|
|
isPaying: false, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -103,6 +106,9 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
onShow: function () { |
|
|
|
// 正在支付中不处理
|
|
|
|
if (this.data.isPaying) return |
|
|
|
|
|
|
|
commonApi.user_post("subwallet.ermb/wallet",{}).then(res=>{ |
|
|
|
// 给建设银行子钱包做标识
|
|
|
|
let resData = res.data || [] |
|
|
|
@ -248,6 +254,7 @@ Page({ |
|
|
|
}).then(res=>{ |
|
|
|
res.data = JSON.parse(res.data) |
|
|
|
console.log(res.data) |
|
|
|
_this.data.isPaying = true |
|
|
|
wx.requestPayment({ |
|
|
|
nonceStr: res.data.nonceStr || res.data.noncestr, |
|
|
|
package: res.data.package, |
|
|
|
@ -260,12 +267,15 @@ Page({ |
|
|
|
icon:'success' |
|
|
|
}) |
|
|
|
setTimeout(()=>{ |
|
|
|
// 支付成功不还原isPaying redirectTo 会删掉当前页面触发unload
|
|
|
|
// _this.data.isPaying = false
|
|
|
|
wx.redirectTo({ |
|
|
|
url: '../payresult/index?tid='+_this.data.id+'&ids='+_this.data.ids.join(',') |
|
|
|
}) |
|
|
|
},1000) |
|
|
|
}, |
|
|
|
fail:function(err){ |
|
|
|
_this.data.isPaying = false |
|
|
|
console.log(err) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -557,7 +567,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
*/ |
|
|
|
onUnload: function () { |
|
|
|
if (!this.data.status) { |
|
|
|
if (!this.data.status && !this.data.isPaying) { |
|
|
|
wx.reLaunch({ |
|
|
|
url: '/pages/user/order/list', |
|
|
|
}) |
|
|
|
|