forked from gxwebsoft/mp-10550
feat(tickets): 优化水票页面显示和订单状态逻辑
- 集成 dayjs 库用于时间格式化 - 将下单时间格式化为 YYYY年MM月DD日 HH:mm:ss 格式 - 重新设计水票数量展示布局,突出显示可用、已用和剩余赠票 - 更新核销记录标题为票号显示 - 修改二维码扫描页面显示票号而非模板名称 - 添加订单完成状态判断函数 - 在待发货和待收货状态中排除已完成订单 - 移除已完成订单状态下的操作按钮
This commit is contained in:
@@ -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 && (
|
||||
<View className="mt-1">
|
||||
<Text className="text-xs text-gray-400">下单时间:{item.createTime}</Text>
|
||||
<Text className="text-xs text-gray-400">下单时间:{dayjs(item.createTime).format('YYYY年MM月DD日 HH:mm:ss')}</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
@@ -372,28 +373,17 @@ const UserTicketList = () => {
|
||||
</View>
|
||||
|
||||
<View className="mt-3 flex justify-between">
|
||||
<View className="flex flex-col">
|
||||
<Text className="text-xs text-gray-500">可用</Text>
|
||||
<Text className="text-lg font-bold text-blue-600">{item.availableQty ?? 0}</Text>
|
||||
<View className="flex flex-col items-center">
|
||||
<Text className="text-lg font-bold text-blue-600 text-center">{item.availableQty ?? 0}</Text>
|
||||
<Text className="text-xs text-gray-500">可用水票</Text>
|
||||
</View>
|
||||
<View className="flex flex-col items-center">
|
||||
<Text className="text-xs text-gray-500">总量</Text>
|
||||
<Text className="text-sm text-gray-900">{item.totalQty ?? 0}</Text>
|
||||
<Text className="text-lg text-gray-900 text-center">{item.usedQty ?? 0}</Text>
|
||||
<Text className="text-xs text-gray-500">已用水票</Text>
|
||||
</View>
|
||||
<View className="flex flex-col items-end">
|
||||
<Text className="text-xs text-gray-500">已用</Text>
|
||||
<Text className="text-sm text-gray-900">{item.usedQty ?? 0}</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className="mt-2 flex justify-between">
|
||||
<View className="flex flex-col">
|
||||
<Text className="text-xs text-gray-500">冻结</Text>
|
||||
<Text className="text-sm text-gray-900">{item.frozenQty ?? 0}</Text>
|
||||
</View>
|
||||
<View className="flex flex-col items-end">
|
||||
<Text className="text-xs text-gray-500">已释放</Text>
|
||||
<Text className="text-sm text-gray-900">{item.releasedQty ?? 0}</Text>
|
||||
<View className="flex flex-col items-center">
|
||||
<Text className="text-lg text-gray-900 text-center">{item.frozenQty ?? 0}</Text>
|
||||
<Text className="text-xs text-gray-500">剩余赠票</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
@@ -426,7 +416,7 @@ const UserTicketList = () => {
|
||||
<View className="flex items-start justify-between">
|
||||
<View className="flex-1 pr-3">
|
||||
<Text className="text-base font-semibold text-gray-900">
|
||||
核销记录
|
||||
票号:{item.userTicketId}
|
||||
</Text>
|
||||
{item.createTime && (
|
||||
<View className="mt-1">
|
||||
@@ -500,8 +490,8 @@ const UserTicketList = () => {
|
||||
{qrTicket && (
|
||||
<View className="bg-gray-50 rounded-lg p-3 mb-4">
|
||||
<View className="flex justify-between mb-2">
|
||||
<Text className="text-sm text-gray-600">水票</Text>
|
||||
<Text className="text-sm text-gray-900">{qrTicket.templateName || '水票'}</Text>
|
||||
<Text className="text-sm text-gray-600">票号</Text>
|
||||
<Text className="text-sm text-gray-900">{qrTicket.id}</Text>
|
||||
</View>
|
||||
<View className="flex justify-between">
|
||||
<Text className="text-sm text-gray-600">可用次数</Text>
|
||||
|
||||
Reference in New Issue
Block a user