From 24354a38c5d4795f81b6a106efd299b56b237607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 5 Feb 2026 12:03:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(tickets):=20=E4=BC=98=E5=8C=96=E6=B0=B4?= =?UTF-8?q?=E7=A5=A8=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=92=8C=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 集成 dayjs 库用于时间格式化 - 将下单时间格式化为 YYYY年MM月DD日 HH:mm:ss 格式 - 重新设计水票数量展示布局,突出显示可用、已用和剩余赠票 - 更新核销记录标题为票号显示 - 修改二维码扫描页面显示票号而非模板名称 - 添加订单完成状态判断函数 - 在待发货和待收货状态中排除已完成订单 - 移除已完成订单状态下的操作按钮 --- src/user/order/components/OrderList.tsx | 25 +++----------- src/user/ticket/index.tsx | 46 ++++++++++--------------- 2 files changed, 22 insertions(+), 49 deletions(-) diff --git a/src/user/order/components/OrderList.tsx b/src/user/order/components/OrderList.tsx index e5110aa..de553ee 100644 --- a/src/user/order/components/OrderList.tsx +++ b/src/user/order/components/OrderList.tsx @@ -149,6 +149,8 @@ function OrderList(props: OrderListProps) { return '未知状态'; }; + const isOrderCompleted = (order: ShopOrder) => order.orderStatus === 1 || order.formId === 10074; + // 获取订单状态颜色 const getOrderStatusColor = (order: ShopOrder) => { // 优先检查订单状态 @@ -812,7 +814,7 @@ function OrderList(props: OrderListProps) { )} {/* 待发货状态:显示申请退款 */} - {item.payStatus && item.deliveryStatus === 10 && item.orderStatus !== 2 && item.orderStatus !== 4 && ( + {item.payStatus && item.deliveryStatus === 10 && item.orderStatus !== 2 && item.orderStatus !== 4 && !isOrderCompleted(item) && ( - {/**/} - - - - )} - {/* 退款/售后状态:显示查看进度和撤销申请 */} {(item.orderStatus === 4 || item.orderStatus === 7) && ( diff --git a/src/user/ticket/index.tsx b/src/user/ticket/index.tsx index 0f1dedb..caad438 100644 --- a/src/user/ticket/index.tsx +++ b/src/user/ticket/index.tsx @@ -19,6 +19,7 @@ import type { GltUserTicket } from '@/api/glt/gltUserTicket/model'; import { pageGltUserTicketLog } from '@/api/glt/gltUserTicketLog'; import type { GltUserTicketLog } from '@/api/glt/gltUserTicketLog/model'; import { BaseUrl } from '@/config/app'; +import dayjs from "dayjs"; const PAGE_SIZE = 10; @@ -99,11 +100,11 @@ const UserTicketList = () => { lines.push(`冻结:${ticket.frozenQty ?? 0}`); lines.push(`已释放:${ticket.releasedQty ?? 0}`); if (ticket.orderNo) lines.push(`订单号:${ticket.orderNo}`); - Taro.showModal({ - title: '水票详情', - content: lines.join('\n'), - showCancel: false - }); + // Taro.showModal({ + // title: '水票详情', + // content: lines.join('\n'), + // showCancel: false + // }); }; const reloadTickets = async (isRefresh = true, keywords?: string) => { @@ -348,7 +349,7 @@ const UserTicketList = () => { )} {item.createTime && ( - 下单时间:{item.createTime} + 下单时间:{dayjs(item.createTime).format('YYYY年MM月DD日 HH:mm:ss')} )} @@ -372,28 +373,17 @@ const UserTicketList = () => { - - 可用 - {item.availableQty ?? 0} + + {item.availableQty ?? 0} + 可用水票 - 总量 - {item.totalQty ?? 0} + {item.usedQty ?? 0} + 已用水票 - - 已用 - {item.usedQty ?? 0} - - - - - - 冻结 - {item.frozenQty ?? 0} - - - 已释放 - {item.releasedQty ?? 0} + + {item.frozenQty ?? 0} + 剩余赠票 @@ -426,7 +416,7 @@ const UserTicketList = () => { - 核销记录 + 票号:{item.userTicketId} {item.createTime && ( @@ -500,8 +490,8 @@ const UserTicketList = () => { {qrTicket && ( - 水票 - {qrTicket.templateName || '水票'} + 票号 + {qrTicket.id} 可用次数