Explorar el Código

收银优化1

shish hace 5 meses
padre
commit
eba99271a2

+ 28 - 1
ghsPad/src/pages/home/components/toPay.vue

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

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 214 - 228
hdPad/package-lock.json


+ 28 - 1
hdPad/src/pages/home/components/toPay.vue

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

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio