|
|
@@ -32,7 +32,8 @@ export default {
|
|
|
},
|
|
|
data(){
|
|
|
return {
|
|
|
- showSuccess:false
|
|
|
+ showSuccess:false,
|
|
|
+ T:null
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
@@ -53,23 +54,25 @@ export default {
|
|
|
//查询付款结果
|
|
|
checkPay(){
|
|
|
let that = this
|
|
|
- uni.showLoading({title: '查询中',mask:true})
|
|
|
codePayCheck({id:this.orderId}).then(res=>{
|
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
|
if(res.data.returnStatus == 'SUCCESS'){
|
|
|
that.showSuccess = true
|
|
|
+ clearInterval(that.T)
|
|
|
setTimeout(function(){
|
|
|
that.payFinish()
|
|
|
},1500)
|
|
|
+ return
|
|
|
}
|
|
|
+ uni.showLoading({title: res.msg})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
//付款
|
|
|
requestCodePay(authCode){
|
|
|
let that = this
|
|
|
- uni.showLoading({title: '正在付款',mask:true})
|
|
|
+ uni.showLoading({title: '正在付款'})
|
|
|
codePay({id:this.orderId,authCode:authCode}).then(res=>{
|
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
|
@@ -78,7 +81,15 @@ export default {
|
|
|
setTimeout(function(){
|
|
|
that.payFinish()
|
|
|
},1500)
|
|
|
+ }else{
|
|
|
+ that.T = setInterval(function(){
|
|
|
+ that.checkPay()
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
+ }else{
|
|
|
+ that.T = setInterval(function(){
|
|
|
+ that.checkPay()
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -87,7 +98,7 @@ export default {
|
|
|
},
|
|
|
cancelPayFn(){
|
|
|
let that = this
|
|
|
- uni.showLoading({title: '确认中',mask:true})
|
|
|
+ uni.showLoading({title: '确认中'})
|
|
|
codePayCheck({id:this.orderId}).then(res=>{
|
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
|
@@ -104,6 +115,7 @@ export default {
|
|
|
},1500)
|
|
|
},
|
|
|
confirmToCancel(){
|
|
|
+ clearInterval(this.T)
|
|
|
this.$emit('cancelPay')
|
|
|
}
|
|
|
}
|