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' }); }); },