feat: 基本信息

This commit is contained in:
2025-10-17 17:43:42 +08:00
parent 3c7473f8d1
commit 263a7d3e20
20 changed files with 1745 additions and 492 deletions

55
src/constants/trade.ts Normal file
View File

@@ -0,0 +1,55 @@
import type { BadgeProps } from 'antd';
export enum OrderStatus {
All = 1,
PendingPayment = 10,
PendingConfirmation = 20,
PendingService = 30,
PendingAcceptance = 40,
Completed = 50,
Cancelled = 60,
Refunded = 70,
}
export const OrderBtnLableMap: Record<OrderStatus, string> = {
[OrderStatus.PendingPayment]: '取消订单',
[OrderStatus.PendingConfirmation]: '接单确定',
[OrderStatus.PendingService]: '准备完成 开始服务',
[OrderStatus.PendingAcceptance]: '服务完成上报',
[OrderStatus.All]: '',
[OrderStatus.Completed]: '',
[OrderStatus.Cancelled]: '',
[OrderStatus.Refunded]: '',
};
// 状态标签映射
export const OrderStatusLabels: Record<
OrderStatus,
{ label: string; color: string }
> = {
[OrderStatus.All]: { label: '所有订单', color: 'default' },
[OrderStatus.PendingPayment]: { label: '等待付款', color: 'danger' },
[OrderStatus.PendingConfirmation]: { label: '等待确定', color: 'warning' },
[OrderStatus.PendingService]: { label: '等待服务', color: 'primary' },
[OrderStatus.PendingAcceptance]: { label: '等待验收', color: 'success' },
[OrderStatus.Completed]: { label: '已完成', color: 'secondary' },
[OrderStatus.Cancelled]: { label: '已取消', color: 'secondary' },
[OrderStatus.Refunded]: { label: '已退款', color: 'secondary' },
};
export const mapOrderStatusToBadgeStatus = (
statusColor: string,
): BadgeProps['status'] => {
const statusMap: Record<string, BadgeProps['status']> = {
success: 'success',
processing: 'processing',
default: 'default',
error: 'error',
warning: 'warning',
primary: 'processing',
danger: 'error',
secondary: 'default',
};
return statusMap[statusColor] || 'default';
};