149 lines
3.6 KiB
TypeScript
149 lines
3.6 KiB
TypeScript
const listingStatusMap: Record<string, string> = {
|
|
draft: '草稿',
|
|
published: '已上架',
|
|
rented: '租用中',
|
|
offline: '已下架',
|
|
abnormal: '异常',
|
|
}
|
|
|
|
const listingReviewStatusMap: Record<string, string> = {
|
|
none: '未提交',
|
|
pending: '待审核',
|
|
approved: '已通过',
|
|
rejected: '已拒绝',
|
|
}
|
|
|
|
const orderStatusMap: Record<string, string> = {
|
|
pending_confirm: '待确认',
|
|
pending_payment: '待支付',
|
|
pending_handoff: '待交接',
|
|
renting: '使用中',
|
|
overdue: '已逾期',
|
|
pending_return_confirm: '待归还确认',
|
|
completed: '已完成',
|
|
cancelled: '已取消',
|
|
closed: '已关闭',
|
|
disputing: '申诉中',
|
|
abnormal: '异常',
|
|
}
|
|
|
|
const handoffStatusMap: Record<string, string> = {
|
|
pending_owner: '待号主交接',
|
|
pending_renter_confirm: '待租客确认',
|
|
received: '已确认收号',
|
|
pending_owner_return_confirm: '待号主确认归还',
|
|
returned: '已归还',
|
|
cancelled: '已取消',
|
|
owner_timeout: '号主交接超时',
|
|
renter_confirm_timeout: '租客确认超时',
|
|
return_overdue: '归还逾期',
|
|
owner_return_confirm_timeout: '号主确认归还超时',
|
|
admin_closed: '客服关闭',
|
|
admin_abnormal: '客服标记异常',
|
|
arbitrated: '已仲裁',
|
|
}
|
|
|
|
const settlementStatusMap: Record<string, string> = {
|
|
unsettled: '未结算',
|
|
pending: '待结算',
|
|
frozen: '冻结中',
|
|
settled: '已结算',
|
|
refunded: '已退款',
|
|
cancelled: '已取消',
|
|
closed: '已关闭',
|
|
arbitrated: '已仲裁',
|
|
}
|
|
|
|
const realnameStatusMap: Record<string, string> = {
|
|
unverified: '未认证',
|
|
pending: '认证中',
|
|
verified: '已认证',
|
|
rejected: '认证失败',
|
|
}
|
|
|
|
const userStatusMap: Record<string, string> = {
|
|
active: '正常',
|
|
frozen: '已冻结',
|
|
disabled: '已禁用',
|
|
}
|
|
|
|
const riskStatusMap: Record<string, string> = {
|
|
normal: '正常',
|
|
watch: '观察',
|
|
restricted: '受限',
|
|
blocked: '已拦截',
|
|
}
|
|
|
|
const disputeStatusMap: Record<string, string> = {
|
|
open: '待处理',
|
|
processing: '处理中',
|
|
resolved: '已处理',
|
|
closed: '已关闭',
|
|
}
|
|
|
|
const walletStatusMap: Record<string, string> = {
|
|
active: '正常',
|
|
frozen: '已冻结',
|
|
disabled: '已禁用',
|
|
}
|
|
|
|
const ledgerDirectionMap: Record<string, string> = {
|
|
in: '收入',
|
|
out: '支出',
|
|
freeze: '冻结',
|
|
unfreeze: '解冻',
|
|
}
|
|
|
|
const balanceTypeMap: Record<string, string> = {
|
|
available: '可用余额',
|
|
frozen: '冻结余额',
|
|
}
|
|
|
|
export function listingStatusLabel(status: string) {
|
|
return listingStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function listingReviewStatusLabel(status: string) {
|
|
return listingReviewStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function orderStatusLabel(status: string) {
|
|
return orderStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function handoffStatusLabel(status: string) {
|
|
return handoffStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function settlementStatusLabel(status: string) {
|
|
return settlementStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function realnameStatusLabel(status: string) {
|
|
return realnameStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function userStatusLabel(status: string) {
|
|
return userStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function riskStatusLabel(status: string) {
|
|
return riskStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function disputeStatusLabel(status: string) {
|
|
return disputeStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function walletStatusLabel(status: string) {
|
|
return walletStatusMap[status] || status || '-'
|
|
}
|
|
|
|
export function ledgerDirectionLabel(direction: string) {
|
|
return ledgerDirectionMap[direction] || direction || '-'
|
|
}
|
|
|
|
export function balanceTypeLabel(type: string) {
|
|
return balanceTypeMap[type] || type || '-'
|
|
}
|