From d930756130eeb1b663afba54bbc9c8010ecb98e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=96=B9=E6=88=90?= Date: Thu, 18 Dec 2025 15:06:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=AE=A2=E5=8D=95):=20=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加订单详情页路由配置 开发订单详情页UI及交互逻辑 对接订单详情和取消订单API 更新文档记录开发进度 优化订单状态显示逻辑 --- components/PaymentPopup.vue | 7 + pages.json | 6 + pages/orders/detail.vue | 645 ++++++++++++++++++++++++++++++++++++ pages/orders/index.vue | 3 +- 说明文档.md | 2 + 5 files changed, 662 insertions(+), 1 deletion(-) create mode 100644 pages/orders/detail.vue diff --git a/components/PaymentPopup.vue b/components/PaymentPopup.vue index 24f0afa..179bdd2 100644 --- a/components/PaymentPopup.vue +++ b/components/PaymentPopup.vue @@ -21,6 +21,7 @@ 优惠券 道具卡 + + + + + 加载中... + + + + + ⚠️ + {{ error }} + + + + + + + + + + + + + + + + {{ getStatusIcon(order) }} + + + {{ statusText(order) }} + 请在 15 分钟内完成支付 + 订单已取消 + 感谢您的购买,期待再次光临 + + + + + + + + 商品清单 + 共 {{ order.items ? order.items.length : 0 }} 件 + + + + + + + + 中奖 + + + {{ order.reward_level }}赏 + + + + + {{ item.title || '商品' }} + + {{ order.activity_name }} + + + + ¥ + {{ formatPrice(item.price) }} + + x{{ item.quantity }} + + + + + + + + + + 订单编号 + + {{ order.order_no }} + 复制 + + + + 下单时间 + {{ formatTime(order.created_at) }} + + + 支付时间 + {{ formatTime(order.paid_at) }} + + + 取消时间 + {{ formatTime(order.cancelled_at) }} + + + 订单来源 + {{ getSourceTypeText(order.source_type) }} + + + + + + + 商品总额 + ¥{{ formatPrice(order.total_amount) }} + + + 优惠金额 + -¥{{ formatPrice(order.discount_amount) }} + + + + 实付款 + + ¥ + {{ formatPrice(order.actual_amount) }} + + + + + + + + 取消订单 + 立即支付 + + + + + + + diff --git a/pages/orders/index.vue b/pages/orders/index.vue index c1c2f48..ce20baa 100644 --- a/pages/orders/index.vue +++ b/pages/orders/index.vue @@ -247,7 +247,8 @@ function switchTab(tab) { } function apiStatus() { - return currentTab.value === 'pending' ? 'pending' : 'completed' + // 1: 待付款, 2: 已完成 + return currentTab.value === 'pending' ? 1 : 2 } // 过滤掉 source_type=3 的发奖订单 diff --git a/说明文档.md b/说明文档.md index 5416049..ca8712b 100644 --- a/说明文档.md +++ b/说明文档.md @@ -31,5 +31,7 @@ * [x] 2025-12-17: 修复 `pages/login/index.vue` 等多处 `$border-color` 未定义错误,在 `uni.scss` 中增加变量别名。 * [x] 2025-12-17: 修复 `pages/mine/index.vue` 编译错误,在 `api/appUser.js` 中补充 `getUserInfo`, `getUserTasks`, `getInviteRecords` 导出。 * [x] 2025-12-17: 将 dev 分支代码强制推送至 main 分支 (Deployment/Sync)。 +* [x] 2025-12-18: 实现订单详情 API 与取消订单 API (后端接口对接)。 +* [x] 2025-12-18: 开发订单详情页 UI 及交互逻辑。 * [ ] 2025-12-17: 进行中 - 优化 `pages/activity/yifanshang/index.vue` 及相关组件。 * [ ] 2025-12-17: 待开始 - 优化 `pages/login/index.vue` 视觉细节。