From 22b98fd6979cffe9c8e5f963f7d54215f3f6a727 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Tue, 22 Apr 2025 09:49:57 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=AB=E7=A0=81?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=8C=E6=88=90=E5=9B=9E=E8=B0=83=E6=97=A0?=
=?UTF-8?q?=E5=93=8D=E5=BA=94=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/tool/Instead/components/order.vue | 17 +++++++++++++----
src/views/tool/Instead/components/scan-pay.vue | 13 ++++++++++++-
src/views/tool/Instead/index.vue | 11 +++++++++++
3 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/src/views/tool/Instead/components/order.vue b/src/views/tool/Instead/components/order.vue
index 990c31c..b1fbdfd 100644
--- a/src/views/tool/Instead/components/order.vue
+++ b/src/views/tool/Instead/components/order.vue
@@ -207,7 +207,12 @@
-
+
@@ -591,12 +596,16 @@ async function payOrder(payType, isScan, guazhangren) {
}
if (res) {
- clearTimeout(payTimer);
- ElMessage.success("支付成功");
- emits("paysuccess");
loading.close();
+ paysuccess();
}
}
+
+function paysuccess() {
+ clearTimeout(payTimer);
+ ElMessage.success("支付成功");
+ emits("paysuccess");
+}
//整单改价
const discountAmount = computed(() => {
const money = carts.goodsTotal - productCouponDiscountAmount.value;
diff --git a/src/views/tool/Instead/components/scan-pay.vue b/src/views/tool/Instead/components/scan-pay.vue
index 48a4660..47f59c1 100644
--- a/src/views/tool/Instead/components/scan-pay.vue
+++ b/src/views/tool/Instead/components/scan-pay.vue
@@ -139,9 +139,20 @@ export default {
shopId: localStorage.getItem("shopId"),
orderId: this.order.id,
});
+ console.log(res);
+ // if (res == "done") {
+ // ElMessage({
+ // message: "支付已完成",
+ // type: "success",
+ // });
+ // }
if (res != "unpaid") {
+ console.log("已支付或取消");
+ this.close();
this.clear();
- this.$emit("paySuccess");
+ if (res == "done") {
+ this.$emit("paysuccess");
+ }
}
},
startGetOrderInfo() {
diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue
index c0c9ad7..13004a7 100644
--- a/src/views/tool/Instead/index.vue
+++ b/src/views/tool/Instead/index.vue
@@ -859,7 +859,10 @@ function resetOldOrder() {
originAmount: 0,
});
}
+
function refresh() {
+ console.log("index refresh");
+ carts.clearHistory();
resetOldOrder();
showOrder.value = false;
user.value = {};
@@ -871,6 +874,14 @@ function refresh() {
// router.go(0);
// }, 1500);
}
+watch(
+ () => carts.oldOrder.id,
+ (newval, oldval) => {
+ if (!newval && carts.isEmpty) {
+ showOrder.value = false;
+ }
+ }
+);