feat: 基本信息
This commit is contained in:
55
src/constants/trade.ts
Normal file
55
src/constants/trade.ts
Normal 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';
|
||||
};
|
||||
Reference in New Issue
Block a user