- 新建 admin_pickups 表独立于 rental_orders,不污染订单状态机与财务统计口径 - 提号中/已完成/已取消三态:创建锁定账号,完成时给卖家钱包加可用余额并下架 listing,取消解锁账号 - 完成时 listing 置 completed,复用现有 listingLockedForOwnerMutation 拦截再上架 - 管理端提号管理页(列表/创建/完成/取消/可提号账号搜索)+ 卖家端提号记录页 - 财务仪表盘新增线下提号独立统计块,与正常订单口径分离 - 钱包流水 label、状态标签、菜单入口同步补齐 - 优化卖家服务悬浮菜单为一行四个,尺寸与配色对齐买家服务
202 lines
5.0 KiB
TypeScript
202 lines
5.0 KiB
TypeScript
import type {
|
|
BalanceType,
|
|
DisputeStatus,
|
|
HandoffStatus,
|
|
LedgerDirection,
|
|
ListingReviewStatus,
|
|
ListingStatus,
|
|
OrderStatus,
|
|
RealnameStatusValue,
|
|
RiskStatus,
|
|
SettlementStatus,
|
|
UserStatus,
|
|
WalletStatus,
|
|
} from '@/shared/types/status'
|
|
|
|
const listingStatusMap: Record<ListingStatus, string> = {
|
|
draft: '草稿',
|
|
published: '已上架',
|
|
rented: '租用中',
|
|
offline: '已下架',
|
|
completed: '已完成',
|
|
abnormal: '异常',
|
|
sealed: '已封存',
|
|
}
|
|
|
|
const listingReviewStatusMap: Record<ListingReviewStatus, string> = {
|
|
none: '未提交',
|
|
pending: '待审核',
|
|
approved: '已通过',
|
|
rejected: '已拒绝',
|
|
}
|
|
|
|
const orderStatusMap: Record<OrderStatus, string> = {
|
|
pending_confirm: '待确认',
|
|
pending_payment: '待支付',
|
|
pending_handoff: '待交接',
|
|
renting: '使用中',
|
|
overdue: '已逾期',
|
|
pending_return_confirm: '待结账确认',
|
|
pending_checkout_confirm: '待号主确认结账',
|
|
pending_checkout_accept: '待租客确认修正',
|
|
checkout_disputing: '结账争议中',
|
|
completed: '已完成',
|
|
cancelled: '租客已取消',
|
|
closed: '客服已关闭',
|
|
disputing: '申诉中',
|
|
abnormal: '客服介入',
|
|
}
|
|
|
|
const handoffStatusMap: Record<HandoffStatus, string> = {
|
|
pending_owner: '待号主交接',
|
|
pending_renter_confirm: '待租客确认',
|
|
received: '租客已收号',
|
|
pending_owner_return_confirm: '待号主确认结账',
|
|
pending_owner_checkout: '待号主确认结账',
|
|
pending_renter_checkout: '待租客确认修正',
|
|
checkout_disputed: '结账争议中',
|
|
returned: '已归还',
|
|
cancelled: '租客已取消',
|
|
owner_timeout: '号主交接超时',
|
|
renter_confirm_timeout: '租客确认超时',
|
|
return_overdue: '归还逾期',
|
|
owner_return_confirm_timeout: '号主确认结账超时',
|
|
owner_checkout_confirm_timeout: '号主确认结账超时',
|
|
admin_closed: '客服已关闭',
|
|
admin_abnormal: '客服介入',
|
|
arbitrated: '已仲裁',
|
|
}
|
|
|
|
const settlementStatusMap: Record<SettlementStatus, string> = {
|
|
unsettled: '未结算',
|
|
pending: '待结算',
|
|
frozen: '冻结中',
|
|
settled: '已结算',
|
|
refunded: '已退款',
|
|
cancelled: '结算已取消',
|
|
closed: '结算已关闭',
|
|
disputed: '争议中',
|
|
arbitrated: '已仲裁',
|
|
}
|
|
|
|
const refundStatusMap: Record<string, string> = {
|
|
none: '未退款',
|
|
pending_review: '待客服审核退款',
|
|
pending: '待退款',
|
|
refunding: '退款中',
|
|
refunded: '已退款',
|
|
failed: '退款失败',
|
|
}
|
|
|
|
const realnameStatusMap: Partial<Record<RealnameStatusValue, string>> = {
|
|
unverified: '未认证',
|
|
pending: '认证中',
|
|
verified: '已认证',
|
|
rejected: '认证失败',
|
|
}
|
|
|
|
const userStatusMap: Record<UserStatus, string> = {
|
|
active: '正常',
|
|
frozen: '已冻结',
|
|
disabled: '已禁用',
|
|
}
|
|
|
|
const riskStatusMap: Record<RiskStatus, string> = {
|
|
normal: '正常',
|
|
watch: '观察',
|
|
restricted: '受限',
|
|
blocked: '已拦截',
|
|
}
|
|
|
|
const disputeStatusMap: Record<DisputeStatus, string> = {
|
|
open: '待处理',
|
|
processing: '处理中',
|
|
resolved: '已处理',
|
|
closed: '已关闭',
|
|
cancelled: '已取消',
|
|
}
|
|
|
|
const walletStatusMap: Record<WalletStatus, string> = {
|
|
active: '正常',
|
|
frozen: '已冻结',
|
|
disabled: '已禁用',
|
|
}
|
|
|
|
const ledgerDirectionMap: Record<LedgerDirection, string> = {
|
|
in: '收入',
|
|
out: '支出',
|
|
freeze: '冻结',
|
|
unfreeze: '解冻',
|
|
}
|
|
|
|
const balanceTypeMap: Record<BalanceType, string> = {
|
|
available: '可用余额',
|
|
frozen: '冻结余额',
|
|
}
|
|
|
|
const pickupStatusMap: Record<string, string> = {
|
|
picking_up: '提号中',
|
|
completed: '已完成',
|
|
cancelled: '已取消',
|
|
}
|
|
|
|
function readLabel(map: Record<string, string>, value: string) {
|
|
return map[value] || value || '-'
|
|
}
|
|
|
|
export function listingStatusLabel(status: string) {
|
|
return readLabel(listingStatusMap, status)
|
|
}
|
|
|
|
export function listingReviewStatusLabel(status: string) {
|
|
return readLabel(listingReviewStatusMap, status)
|
|
}
|
|
|
|
export function orderStatusLabel(status: string) {
|
|
return readLabel(orderStatusMap, status)
|
|
}
|
|
|
|
export function handoffStatusLabel(status: string) {
|
|
return readLabel(handoffStatusMap, status)
|
|
}
|
|
|
|
export function settlementStatusLabel(status: string) {
|
|
return readLabel(settlementStatusMap, status)
|
|
}
|
|
|
|
export function refundStatusLabel(status: string) {
|
|
return readLabel(refundStatusMap, status)
|
|
}
|
|
|
|
export function realnameStatusLabel(status: string) {
|
|
return readLabel(realnameStatusMap, status)
|
|
}
|
|
|
|
export function userStatusLabel(status: string) {
|
|
return readLabel(userStatusMap, status)
|
|
}
|
|
|
|
export function riskStatusLabel(status: string) {
|
|
return readLabel(riskStatusMap, status)
|
|
}
|
|
|
|
export function disputeStatusLabel(status: string) {
|
|
return readLabel(disputeStatusMap, status)
|
|
}
|
|
|
|
export function walletStatusLabel(status: string) {
|
|
return readLabel(walletStatusMap, status)
|
|
}
|
|
|
|
export function ledgerDirectionLabel(direction: string) {
|
|
return readLabel(ledgerDirectionMap, direction)
|
|
}
|
|
|
|
export function balanceTypeLabel(type: string) {
|
|
return readLabel(balanceTypeMap, type)
|
|
}
|
|
|
|
export function pickupStatusLabel(status: string) {
|
|
return readLabel(pickupStatusMap, status)
|
|
}
|