shish hai 2 semanas
pai
achega
ff54e2d1c6

+ 5 - 1
ghsPad/src/pages/home/components/console.vue

@@ -67,7 +67,7 @@
 
     <!-- 扫码付款 -->
     <uni-popup ref="toPayRef" background-color="#fff" type="center" :animation="false" :is-mask-click="false">
-        <toPayWay @cancelPay="cancelPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price" :reachDiscountPrice.sync="reachDiscountPrice" :orderReachDiscountPrice.sync="orderReachDiscountPrice"></toPayWay>
+        <toPayWay @cancelPay="cancelPay()" @closePay="closeToPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price" :reachDiscountPrice.sync="reachDiscountPrice" :orderReachDiscountPrice.sync="orderReachDiscountPrice"></toPayWay>
     </uni-popup>
 
 	<!-- 临时收款 / 计算器 -->
@@ -456,6 +456,10 @@ export default {
 				}, 120)
 			})
 		},
+		/** 仅关闭付款弹层,不取消订单 */
+		closeToPay(){
+			this.cancelPay()
+		},
 		cancelSettle(){
 			this.$util.hitVoice()
 			this.settleOpenStatus = 0

+ 5 - 1
ghsPad/src/pages/home/components/leftGroup.vue

@@ -25,7 +25,7 @@
 
         <!-- 扫码付款 -->
         <uni-popup ref="toPayRef" background-color="#fff" type="center" :animation="false" :is-mask-click="false">
-            <toPayWay @cancelPay="cancelPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price"></toPayWay>
+            <toPayWay @cancelPay="cancelPay()" @closePay="closeToPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price"></toPayWay>
         </uni-popup>
 
     </view>
@@ -113,6 +113,10 @@ export default {
 			this.$refs.toPayRef.close()
 			this.listenScanItem()
 		},
+		/** 仅关闭付款弹层,不取消订单 */
+		closeToPay(){
+			this.cancelPay()
+		},
         reachBottom() {
 
         },

+ 137 - 6
ghsPad/src/pages/home/components/toPay.vue

@@ -1,5 +1,6 @@
 <template>
     <view class="app-collect_money">
+        <view class="close-icon" @click="closePayPanel">×</view>
         <view v-if="showSuccess == false">
             <view class="collect-code_box">
                 <image class="img" :src="`${constant.imgUrl}/icon/scan/scan.png`" mode="scaleToFill" @click="beginScan()" />
@@ -15,7 +16,22 @@
 </view>
 <view style="margin-top:10upx;font-weight:bold;font-size:34upx;color:black;">¥{{price}}</view>
 
-                <view class="show-code" v-if="goPay == 0">请出示付款码</view>
+                <view class="show-code" v-if="goPay == 0 && !showManualInput" @click="openManualInput">请出示付款码</view>
+                <view class="manual-code-box" v-if="goPay == 0 && showManualInput">
+                    <input
+                        class="manual-code-input"
+                        v-model="manualAuthCode"
+                        type="number"
+                        maxlength="32"
+                        placeholder="请输入付款码"
+                        :focus="manualInputFocus"
+                        @confirm="submitManualCode"
+                    />
+                    <view class="manual-code-actions">
+                        <view class="btn-default" @click="closeManualInput">返回</view>
+                        <view class="btn-default btn-primary" @click="submitManualCode">确认支付</view>
+                    </view>
+                </view>
                 <view class="paying" v-if="goPay == 1">请求中</view>
                 <view style="font-size:18upx;margin:8upx auto;color:red;font-weight:bold;text-align:center;" v-if="goPay == 2">
                     <view style="font-size:16upx;line-height:1.3;max-width:90%;margin:0 auto;">{{ remindText }}</view>
@@ -51,12 +67,22 @@
             </view>
         </uni-popup>
 
+        <uni-popup ref="closePaymentRef" type="dialog">
+            <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+                <view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认关闭?</view>
+                <view style="text-align:center;">
+                    <button class="admin-button-com mini-btn default" @click="returnClose">返回</button>
+                    <button class="admin-button-com mini-btn default" @click="confirmClose" style="margin-left:30upx;">确认</button>
+                </view>
+            </view>
+        </uni-popup>
+
     </view>
 </template>
 <script>
 /**
  * 扫码支付组件(供货商收银机端)
- * 解决客户扫码后转圈状态被卡住、钱未到账的问题,支持网络异常降级和自动后台复查
+ * 支持扫码与手动输入付款码,解决客户扫码后转圈状态被卡住、钱未到账的问题,支持网络异常降级和自动后台复查
  */
 import { codePay,codePayCheck,codePayVerify,cancelOrderFn,getDetail} from "@/api/order";
 export default {
@@ -72,9 +98,13 @@ export default {
             returnCode:'',
             cancelText:'确认要取消?',
             isCancelDialogOpen:false,
+            isCloseDialogOpen:false, // 关闭确认弹框是否打开
             isPaymentProcessing:false, // 标志位:防重复扫码
             pollingTimer:null, // 后台轮询复查定时器
-            pollingCount:0 // 轮询计数器
+            pollingCount:0, // 轮询计数器
+            showManualInput:false, // 是否展示手动输入付款码
+            manualAuthCode:'', // 手动输入的付款码
+            manualInputFocus:false // 控制输入框自动聚焦
         }
     },
 	props: {
@@ -124,6 +154,38 @@ export default {
             this.goPay = 0
             this.returnCode = ''
             this.isPaymentProcessing = false
+            this.closeManualInput()
+        },
+        /**
+         * 点击「请出示付款码」后展开手动输入区域
+         */
+        openManualInput(){
+            this.showManualInput = true
+            this.manualAuthCode = ''
+            this.manualInputFocus = false
+            this.$nextTick(() => {
+                this.manualInputFocus = true
+            })
+        },
+        /**
+         * 关闭手动输入付款码区域
+         */
+        closeManualInput(){
+            this.showManualInput = false
+            this.manualAuthCode = ''
+            this.manualInputFocus = false
+        },
+        /**
+         * 提交手动输入的付款码
+         */
+        submitManualCode(){
+            const authCode = String(this.manualAuthCode || '').replace(/\s+/g, '')
+            if (!authCode) {
+                this.$msg('请输入付款码')
+                return
+            }
+            this.closeManualInput()
+            this.requestCodePay(authCode)
         },
         checkOrder(){
             let that = this
@@ -152,8 +214,8 @@ export default {
         },
         requestCodePay(authCode){
             // 如果取消对话框打开,则不处理扫码
-            if(this.isCancelDialogOpen){
-                this.$msg('请先完成取消操作')
+            if(this.isCancelDialogOpen || this.isCloseDialogOpen){
+                this.$msg('请先完成当前操作')
                 return
             }
             
@@ -257,6 +319,30 @@ export default {
             this.clearPolling()
             this.$emit('payFinish')
         },
+        /**
+         * 右上角关闭:先弹框确认,确认后仅关闭弹层不取消订单
+         */
+        closePayPanel(){
+            this.isCloseDialogOpen = true
+            this.$refs.closePaymentRef.open('center')
+        },
+        returnClose(){
+            this.isCloseDialogOpen = false
+            this.$refs.closePaymentRef.close()
+        },
+        confirmClose(){
+            this.isCloseDialogOpen = false
+            this.$refs.closePaymentRef.close()
+            this.clearPolling()
+            this.isPaymentProcessing = false
+            this.isCancelDialogOpen = false
+            this.closeManualInput()
+            if (this.showSuccess) {
+                this.payFinish()
+                return
+            }
+            this.$emit('closePay')
+        },
         cancelPayFn(){
             this.isCancelDialogOpen = true
             if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
@@ -279,7 +365,7 @@ export default {
             this.isCancelDialogOpen = false
             this.clearPolling() // 取消时,必须清除定时器
             this.isPaymentProcessing = false
-            cancelOrderFn({id:this.orderId}).then(res=>{
+            cancelOrderFn({id:this.orderId,cashier:1}).then(res=>{
                 if(res.code == 1){
                     that.$msg('已取消')
                 }
@@ -302,6 +388,17 @@ export default {
     flex-direction: column;
     box-sizing: border-box;
     width:60vw;
+    position: relative;
+    & .close-icon {
+        position: absolute;
+        top: 10upx;
+        right: 10upx;
+        z-index: 10;
+        font-size: 40upx;
+        line-height: 1;
+        color: #999999;
+        padding: 0 8upx;
+    }
     & .price-box {
         min-height: 100upx;
         & > .title {
@@ -335,6 +432,40 @@ export default {
             font-size: 19upx;
             margin: 10upx 0 10upx 0;
             font-weight:bold;
+            color: #3385ff;
+        }
+        & .manual-code-box{
+            width: 90%;
+            margin: 10upx auto 0 auto;
+        }
+        & .manual-code-input{
+            width: 100%;
+            height: 60upx;
+            line-height: 60upx;
+            border: 1upx solid #cccccc;
+            border-radius: 8upx;
+            font-size: 20upx;
+            text-align: center;
+            color: #333333;
+            background-color: #fafafa;
+            box-sizing: border-box;
+        }
+        & .manual-code-actions{
+            margin-top: 15upx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+        }
+        & .manual-code-actions .btn-default{
+            margin-left: 0;
+        }
+        & .manual-code-actions .btn-default + .btn-default{
+            margin-left: 20upx;
+        }
+        & .btn-primary{
+            background-color: #3385ff;
+            color: #ffffff;
+            border-color: #3385ff;
         }
         & .paying{
             font-size: 19upx;

+ 5 - 1
hdPad/src/pages/home/components/console.vue

@@ -79,7 +79,7 @@
 
     <!-- 扫码付款 -->
     <uni-popup ref="toPayRef" background-color="#fff" type="center" :animation="false" :is-mask-click="false">
-        <toPayWay @cancelPay="cancelPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price"></toPayWay>
+        <toPayWay @cancelPay="cancelPay()" @closePay="closeToPay()" @payFinish="payFinish()" @selectPayWayBack="selectPayWayBack" :orderId.sync="orderId" :price.sync="price"></toPayWay>
     </uni-popup>
 
 	<!-- 直接收款 -->
@@ -492,6 +492,10 @@ export default {
 				}, 120)
 			})
 		},
+		/** 仅关闭付款弹层,不取消订单 */
+		closeToPay(){
+			this.cancelPay()
+		},
 		cancelSettle(){
 			this.$util.hitVoice()
 			this.settleOpenStatus = 0

+ 5 - 0
hdPad/src/pages/home/components/leftGroup.vue

@@ -58,6 +58,7 @@
 		>
 			<toPayWay
 				@cancelPay="cancelPay()"
+				@closePay="closeToPay()"
 				@payFinish="payFinish()"
 				@selectPayWayBack="selectPayWayBack"
 				:orderId.sync="orderId"
@@ -164,6 +165,10 @@ export default {
 			this.$refs.toPayRef.close();
 			this.listenScanItem();
 		},
+		/** 仅关闭付款弹层,不取消订单 */
+		closeToPay() {
+			this.cancelPay();
+		},
 		reachBottom() {
 			if (!this.list.finished) {
 				this.getGroupList().then((res) => {

+ 48 - 2
hdPad/src/pages/home/components/toPay.vue

@@ -1,5 +1,6 @@
 <template>
     <view class="app-collect_money">
+        <view class="close-icon" @click="closePayPanel">×</view>
         <view v-if="showSuccess == false">
             <view class="collect-code_box">
                 <image class="img" :src="`${constant.imgUrl}/icon/scan/scan.png`" mode="scaleToFill" @click="beginScan()" />
@@ -40,6 +41,16 @@
             </view>
         </uni-popup>
 
+        <uni-popup ref="closePaymentRef" type="dialog">
+            <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
+                <view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认关闭?</view>
+                <view style="text-align:center;">
+                    <button class="admin-button-com mini-btn default" @click="returnClose">返回</button>
+                    <button class="admin-button-com mini-btn default" @click="confirmClose" style="margin-left:30upx;">确认</button>
+                </view>
+            </view>
+        </uni-popup>
+
     </view>
 </template>
 <script>
@@ -61,6 +72,7 @@ export default {
             returnCode:'',
             cancelText:'确认要取消?',
             isCancelDialogOpen:false,
+            isCloseDialogOpen:false, // 关闭确认弹框是否打开
             isPaymentProcessing:false, // 标志位:防重复扫码
             pollingTimer:null, // 后台轮询复查定时器
             pollingCount:0 // 轮询计数器
@@ -133,8 +145,8 @@ export default {
         },
         requestCodePay(authCode){
             // 如果取消对话框打开,则不处理扫码
-            if(this.isCancelDialogOpen){
-                this.$msg('请先完成取消操作')
+            if(this.isCancelDialogOpen || this.isCloseDialogOpen){
+                this.$msg('请先完成当前操作')
                 return
             }
             
@@ -240,6 +252,29 @@ export default {
             this.showSuccess = false
             this.goPay = 0
         },
+        /**
+         * 右上角关闭:先弹框确认,确认后仅关闭弹层不取消订单
+         */
+        closePayPanel(){
+            this.isCloseDialogOpen = true
+            this.$refs.closePaymentRef.open('center')
+        },
+        returnClose(){
+            this.isCloseDialogOpen = false
+            this.$refs.closePaymentRef.close()
+        },
+        confirmClose(){
+            this.isCloseDialogOpen = false
+            this.$refs.closePaymentRef.close()
+            this.clearPolling()
+            this.isPaymentProcessing = false
+            this.isCancelDialogOpen = false
+            if (this.showSuccess) {
+                this.payFinish()
+                return
+            }
+            this.$emit('closePay')
+        },
         cancelPayFn(){
             this.isCancelDialogOpen = true
             if(this.returnCode=='BBS11105' || this.returnCode=='BBS10000'){
@@ -286,6 +321,17 @@ export default {
     flex-direction: column;
     box-sizing: border-box;
     width:60vw;
+    position: relative;
+    & .close-icon {
+        position: absolute;
+        top: 10upx;
+        right: 10upx;
+        z-index: 10;
+        font-size: 40upx;
+        line-height: 1;
+        color: #999999;
+        padding: 0 8upx;
+    }
     & .price-box {
         min-height: 100upx;
         & > .title {