licc 3 nedēļas atpakaļ
vecāks
revīzija
88bf494c75
2 mainītis faili ar 25 papildinājumiem un 10 dzēšanām
  1. 20 8
      src/views/order/console.vue
  2. 5 2
      src/views/order/index.vue

+ 20 - 8
src/views/order/console.vue

@@ -282,13 +282,13 @@
         </div>
         <template #footer>
             <span class="dialog-footer">
-                <el-button type="primary" @click="showCouponDialog = false">确认</el-button>
+                <el-button type="primary" @click="ticketConfirm">确认</el-button>
             </span>
         </template>
     </el-dialog>
     <el-dialog
             v-model="scanDialogVisible"
-            title="请使用扫码枪扫码支付"
+            title="请引导顾客扫码支付"
             width="300px"
             center
             :show-close="false"
@@ -302,6 +302,7 @@
                     class="mx-auto mb-4"
                     style="width: 150px"
                 />
+              <b style="font-size: 20px;">{{ orderData.payAmount }} 元</b>
             </div>
             <template #footer>
                 <div class="dialog-footer">
@@ -559,6 +560,17 @@ const queryPayStatusWithRetry = (data): Promise<boolean> => {
     })
 }
 
+const ticketConfirm = () => {
+  if (data.phone == '') {
+    params.couponId = null
+    params.couponAmount = '-'
+    params.userId = null
+    // 计算支付金额
+    orderData.payAmount = Number(orderData.sumPriceSum).toFixed(2)
+  }
+  showCouponDialog.value = false
+}
+
 const checkout = () => {
     refreshdishes()
     //结账
@@ -567,12 +579,12 @@ const checkout = () => {
     //     feedback.notify('请点击商品开始点单吧!')
     //     return false
     // }
-    feedback.confirm('结账金额为' + orderData.payAmount + ',确定要结账吗?').then(() => {
-        data.canScan = true
-        scanDialogVisible.value = true
-        // 添加键盘事件监听
-        document.addEventListener('keydown', handleScanInput)
-    })
+    // feedback.confirm('结账金额为' + orderData.payAmount + ',确定要结账吗?').then(() => {
+    data.canScan = true
+    scanDialogVisible.value = true
+    // 添加键盘事件监听
+    document.addEventListener('keydown', handleScanInput)
+    // })
 }
 // 添加优惠券点击处理方法
 const handleCouponClick = (coupon: any) => {

+ 5 - 2
src/views/order/index.vue

@@ -89,7 +89,7 @@
         </el-dialog>
         <el-dialog
             v-model="scanDialogVisible"
-            title="请使用扫码枪扫码支付"
+            title="请引导顾客扫码支付"
             width="300px"
             center
             :show-close="false"
@@ -103,6 +103,7 @@
                     class="mx-auto mb-4"
                     style="width: 150px"
                 />
+                <b style="font-size: 20px;">{{ currentDeskAmount }} 元</b>
             </div>
             <template #footer>
                 <div class="dialog-footer">
@@ -145,6 +146,7 @@ const dialogVisible = ref(false)
 const isLoading = ref(false)
 const currentDeskStatus = ref()
 const currentDeskMaxNum = ref<number>()
+const currentDeskAmount = ref<number>()
 const areaList = ref<any[]>([])
 const deskList = ref<any[]>([])
 let currentDesk: any = {}
@@ -314,7 +316,8 @@ const checkout = () => {
         currentDesk.oid = res.id
         feedback.confirm(currentDesk.name + ' 结账金额为' + currentDesk.amount + ',确定要结账吗?').then(() => {
             data.canScan = true
-            scanDialogVisible.value = true
+          currentDeskAmount.value = currentDesk.amount
+          scanDialogVisible.value = true
             // 添加键盘事件监听
             document.addEventListener('keydown', handleScanInput)
         })