|
@@ -51,7 +51,9 @@ export default {
|
|
|
goPay:0,
|
|
goPay:0,
|
|
|
remindText:'',
|
|
remindText:'',
|
|
|
returnCode:'',
|
|
returnCode:'',
|
|
|
- cancelText:'确认要取消?'
|
|
|
|
|
|
|
+ cancelText:'确认要取消?',
|
|
|
|
|
+ isCancelDialogOpen:false,
|
|
|
|
|
+ isPaymentProcessing:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
@@ -105,9 +107,23 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
requestCodePay(authCode){
|
|
requestCodePay(authCode){
|
|
|
|
|
+ // 如果取消对话框打开,则不处理扫码
|
|
|
|
|
+ if(this.isCancelDialogOpen){
|
|
|
|
|
+ this.$msg('请先完成取消操作')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 如果支付处理中,则不处理扫码
|
|
|
|
|
+ if(this.isPaymentProcessing){
|
|
|
|
|
+ this.$msg('支付处理中,请稍候')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let that = this
|
|
let that = this
|
|
|
this.goPay = 1
|
|
this.goPay = 1
|
|
|
|
|
+ this.isPaymentProcessing = true
|
|
|
codePay({id:this.orderId,authCode:authCode,version:2}).then(res=>{
|
|
codePay({id:this.orderId,authCode:authCode,version:2}).then(res=>{
|
|
|
|
|
+ that.isPaymentProcessing = false
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
if(res.data.returnStatus == 'SUCCESS'){
|
|
if(res.data.returnStatus == 'SUCCESS'){
|
|
|
that.showSuccess = true
|
|
that.showSuccess = true
|
|
@@ -120,6 +136,8 @@ export default {
|
|
|
that.goPay = 2
|
|
that.goPay = 2
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ that.isPaymentProcessing = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
payFinish(){
|
|
payFinish(){
|
|
@@ -128,16 +146,25 @@ export default {
|
|
|
this.goPay = 0
|
|
this.goPay = 0
|
|
|
},
|
|
},
|
|
|
cancelPayFn(){
|
|
cancelPayFn(){
|
|
|
|
|
+ this.isCancelDialogOpen = true
|
|
|
if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
|
|
if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
|
|
|
this.cancelText = '客户正在付款,提醒客户退出付款界面,再点确认取消'
|
|
this.cancelText = '客户正在付款,提醒客户退出付款界面,再点确认取消'
|
|
|
}
|
|
}
|
|
|
this.$refs.cancelPaymentRef.open('center')
|
|
this.$refs.cancelPaymentRef.open('center')
|
|
|
},
|
|
},
|
|
|
returnCancel(){
|
|
returnCancel(){
|
|
|
|
|
+ this.isCancelDialogOpen = false
|
|
|
this.$refs.cancelPaymentRef.close()
|
|
this.$refs.cancelPaymentRef.close()
|
|
|
},
|
|
},
|
|
|
confirmToCancel(){
|
|
confirmToCancel(){
|
|
|
|
|
+ // 如果支付处理中,提示用户
|
|
|
|
|
+ if(this.isPaymentProcessing){
|
|
|
|
|
+ this.$msg('支付处理中,请稍候')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let that = this
|
|
let that = this
|
|
|
|
|
+ this.isCancelDialogOpen = false
|
|
|
cancelOrderFn({id:this.orderId}).then(res=>{
|
|
cancelOrderFn({id:this.orderId}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
that.$msg('已取消')
|
|
that.$msg('已取消')
|