shish hace 2 semanas
padre
commit
2e1e797165

+ 14 - 8
ghsPad/src/pages/home/components/toPay.vue

@@ -23,8 +23,7 @@
                         v-model="manualAuthCode"
                         type="number"
                         maxlength="32"
-                        placeholder="请输入或扫描付款码"
-                        :focus="manualInputFocus"
+                        placeholder="请出示付款码"
                         @confirm="submitManualCode"
                     />
                     <view class="manual-code-actions">
@@ -44,8 +43,11 @@
                 <view v-if="goPay == 1">
                     <image style="width:25upx;height:25upx;margin:0 auto;" :src="`${constant.imgUrl}/icon/loading.gif`" mode="scaleToFill" />
                 </view>
-                <view style="margin-top:10upx;">
-                    <view @click="cancelPayFn" class="btn-default">取消</view>
+                <view style="margin-top:10upx;display:flex;justify-content:center;">
+                    <view style="position:relative;">
+                        <view @click="cancelPayFn(0)" class="btn-default">取消</view>
+                        <view @click="cancelPayFn(1)" style="position:absolute;left:100%;bottom:0;margin-left:10upx;font-size:13upx;color:black;white-space:nowrap;text-decoration: underline;">强制取消</view>
+                    </view>
                 </view>
             </view>
         </view>
@@ -104,7 +106,8 @@ export default {
             pollingCount:0, // 轮询计数器
             showManualInput:false, // 是否展示手动输入付款码
             manualAuthCode:'', // 手动输入的付款码
-            manualInputFocus:false // 控制输入框自动聚焦
+            manualInputFocus:false, // 控制输入框自动聚焦
+            isForceCancel: 0 // 0: 普通取消,1: 强制取消
         }
     },
 	props: {
@@ -372,10 +375,13 @@ export default {
             }
             this.$emit('closePay')
         },
-        cancelPayFn(){
+        cancelPayFn(force = 0){
+            this.isForceCancel = force
             this.isCancelDialogOpen = true
             if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
-                this.cancelText = '确认取消?'
+                this.cancelText = this.isForceCancel ? '确认要强制取消?' : '确认取消?'
+            } else {
+                this.cancelText = this.isForceCancel ? '确认要强制取消?' : '确认要取消?'
             }
             this.$refs.cancelPaymentRef.open('center')
         },
@@ -394,7 +400,7 @@ export default {
             this.isCancelDialogOpen = false
             this.clearPolling() // 取消时,必须清除定时器
             this.isPaymentProcessing = false
-            cancelOrderFn({id:this.orderId,cashier:1}).then(res=>{
+            cancelOrderFn({id:this.orderId,cashier:1, forceCancel: this.isForceCancel}).then(res=>{
                 if(res.code == 1){
                     that.$msg('已取消')
                 }

+ 14 - 8
hdPad/src/pages/home/components/toPay.vue

@@ -12,8 +12,7 @@
                         v-model="manualAuthCode"
                         type="number"
                         maxlength="32"
-                        placeholder="请输入或扫描付款码"
-                        :focus="manualInputFocus"
+                        placeholder="请出示付款码"
                         @confirm="submitManualCode"
                     />
                     <view class="manual-code-actions">
@@ -33,8 +32,11 @@
                 <view v-if="goPay == 1">
                     <image style="width:25upx;height:25upx;margin:10upx auto 0 auto;" :src="`${constant.imgUrl}/icon/loading.gif`" mode="scaleToFill" />
                 </view>
-                <view style="margin-top:15upx;">
-                    <view @click="cancelPayFn" class="btn-default">取消</view>
+                <view style="margin-top:15upx;display:flex;justify-content:center;">
+                    <view style="position:relative;">
+                        <view @click="cancelPayFn(0)" class="btn-default">取消</view>
+                        <view @click="cancelPayFn(1)" style="position:absolute;left:100%;bottom:0;margin-left:10upx;font-size:13upx;color:black;white-space:nowrap;text-decoration: underline;">强制取消</view>
+                    </view>
                 </view>
             </view>
         </view>
@@ -93,7 +95,8 @@ export default {
             pollingCount:0, // 轮询计数器
             showManualInput:false, // 是否展示付款码输入区域
             manualAuthCode:'', // 手动输入或扫码填入的付款码
-            manualInputFocus:false // 控制输入框自动聚焦
+            manualInputFocus:false, // 控制输入框自动聚焦
+            isForceCancel: 0 // 0: 普通取消,1: 强制取消
         }
     },
 	props: {
@@ -355,10 +358,13 @@ export default {
             }
             this.$emit('closePay')
         },
-        cancelPayFn(){
+        cancelPayFn(force = 0){
+            this.isForceCancel = force
             this.isCancelDialogOpen = true
             if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
-                this.cancelText = '确认取消?'
+                this.cancelText = this.isForceCancel ? '确认要强制取消?' : '确认取消?'
+            } else {
+                this.cancelText = this.isForceCancel ? '确认要强制取消?' : '确认要取消?'
             }
             this.$refs.cancelPaymentRef.open('center')
         },
@@ -377,7 +383,7 @@ export default {
             this.isCancelDialogOpen = false
             this.clearPolling() // 取消时,必须清除定时器
             this.isPaymentProcessing = false
-            cancelOrderFn({id:this.orderId}).then(res=>{
+            cancelOrderFn({id:this.orderId, forceCancel: this.isForceCancel}).then(res=>{
                 if(res.code == 1){
                     that.$msg('已取消')
                 }