From 3c3159d5d8c10ee92c22b536a11f0db3edcaaf9e Mon Sep 17 00:00:00 2001 From: BAKEYi <16298417+bakeyi@user.noreply.gitee.com> Date: Tue, 26 May 2026 13:58:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E9=94=80=E6=9C=AA=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2+=E6=89=AB=E7=A0=81=E5=85=A8=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 6 + pages/shop/verify/manual-verify.vue | 26 +- pages/shop/verify/verify-fail.vue | 105 +++++ pages/shop/verify/verify-order-detail.vue | 457 ++++++++++++++++++++++ pages/shop/verify/verify-order.nvue | 26 +- 5 files changed, 600 insertions(+), 20 deletions(-) create mode 100644 pages/shop/verify/verify-fail.vue create mode 100644 pages/shop/verify/verify-order-detail.vue diff --git a/pages.json b/pages.json index 8fc687b..eda9f0c 100644 --- a/pages.json +++ b/pages.json @@ -602,6 +602,12 @@ "navigationStyle": "custom" } }, + { + "path": "pages/shop/verify/verify-fail", + "style": { + "navigationStyle": "custom" + } + }, { "path": "pages/shop/verify/verify-order-detail", "style": { diff --git a/pages/shop/verify/manual-verify.vue b/pages/shop/verify/manual-verify.vue index 3f3a5b3..26f883d 100644 --- a/pages/shop/verify/manual-verify.vue +++ b/pages/shop/verify/manual-verify.vue @@ -67,19 +67,27 @@ export default { uni.showToast({ title: '请输入6位核销码', icon: 'none' }); return; } - request.post('/sj/poster/useOrderServerCode', { - server_code: this.code, - id: this.orderId, - order_type: this.orderType + + uni.showLoading({ title: '查询订单中...', mask: true }); + + // 统一调用查询接口,不要在这里调用核销接口 + request.post('/sj/poster/getOrderByCode', { + server_code: this.code }).then(res => { - if (res.code === 200) { - uni.showToast({ title: '核销成功' }); - setTimeout(() => uni.navigateBack(), 1500); + uni.hideLoading(); + if (res.code === 200 && res.data) { + // 查询成功,带上数据跳 detail 页 + const orderDataStr = encodeURIComponent(JSON.stringify(res.data)); + uni.navigateTo({ + url: `/pages/shop/verify/verify-order-detail?data=${orderDataStr}` + }); } else { - uni.showToast({ title: res.msg || '核销失败', icon: 'none' }); + // 查询不到,跳 fail 页 + uni.navigateTo({ url: '/pages/shop/verify/verify-fail' }); } }).catch(() => { - uni.showToast({ title: '网络异常', icon: 'none' }); + uni.hideLoading(); + uni.navigateTo({ url: '/pages/shop/verify/verify-fail' }); }); } } diff --git a/pages/shop/verify/verify-fail.vue b/pages/shop/verify/verify-fail.vue new file mode 100644 index 0000000..7a9f822 --- /dev/null +++ b/pages/shop/verify/verify-fail.vue @@ -0,0 +1,105 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/verify/verify-order-detail.vue b/pages/shop/verify/verify-order-detail.vue new file mode 100644 index 0000000..8d93cec --- /dev/null +++ b/pages/shop/verify/verify-order-detail.vue @@ -0,0 +1,457 @@ + + + + + \ No newline at end of file diff --git a/pages/shop/verify/verify-order.nvue b/pages/shop/verify/verify-order.nvue index 911dc25..4e6e8c8 100644 --- a/pages/shop/verify/verify-order.nvue +++ b/pages/shop/verify/verify-order.nvue @@ -2,6 +2,7 @@ { this.isProcessing = false; }, 1000); } else { - // 如果无效,立即退出页面回首页 - uni.showToast({ title: result.msg, icon: 'none' }); - - // 延迟 500ms 让用户看到 Toast,然后自动退回主页 - setTimeout(() => { - uni.navigateBack({ delta: 1 }); - }, 500); + // 失败直接跳 fail 页 + this.isProcessing = false; // 必须马上重置,保证退回该页时能继续扫 + uni.navigateTo({ url: '/pages/shop/verify/verify-fail' }); } }).catch((err) => { uni.hideLoading(); - uni.showToast({ title: '请求失败,退出重试', icon: 'none' }); - setTimeout(() => { - uni.navigateBack({ delta: 1 }); - }, 800); + this.isProcessing = false; + uni.navigateTo({ url: '/pages/shop/verify/verify-fail' }); }); },