From 41d7ffd073f43ca3311a3d995f652e5854a05c99 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Mon, 12 Oct 2026 17:22:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E8=B5=84=E9=87=91=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E4=B8=9A=E5=8A=A1=E7=B1=BB=E5=9E=8B=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=B9=B6=E4=BF=AE=E6=AD=A3=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - statusLabels 新增 walletBizTypeLabel/walletBizTypeOptions,覆盖 wallet_ledger 全部 16 种 biz_type - 资金流水表格业务类型列改为中文标签 - 筛选下拉原取值(order_freeze 等)在钱包流水中不存在,替换为真实业务类型 - 用户端钱包页复用共享映射,移除重复的本地 map --- .../admin/views/AdminWalletLedgerView.vue | 21 +++++-- .../src/features/wallet/views/WalletView.vue | 27 +-------- frontend/src/shared/utils/statusLabels.ts | 57 +++++++++++++++++++ 3 files changed, 73 insertions(+), 32 deletions(-) diff --git a/frontend/src/features/admin/views/AdminWalletLedgerView.vue b/frontend/src/features/admin/views/AdminWalletLedgerView.vue index 7a2314c..43de068 100644 --- a/frontend/src/features/admin/views/AdminWalletLedgerView.vue +++ b/frontend/src/features/admin/views/AdminWalletLedgerView.vue @@ -13,7 +13,12 @@ import { computed, onMounted, reactive, ref } from 'vue' import { fetchAdminWalletLedger, type AdminWalletLedger } from '@/features/admin/api/adminWallet' import { adminPath } from '@/shared/utils/adminPath' import { formatCentWithSymbol } from '@/shared/utils/money' -import { balanceTypeLabel, ledgerDirectionLabel } from '@/shared/utils/statusLabels' +import { + balanceTypeLabel, + ledgerDirectionLabel, + walletBizTypeLabel, + walletBizTypeOptions, +} from '@/shared/utils/statusLabels' import { formatDateTime } from '@/shared/utils/time' import AdminTablePagination from '../components/AdminTablePagination.vue' @@ -165,10 +170,12 @@ function directionLabel(direction: string) { placeholder="全部业务类型" class="full-control" > - - - - + @@ -222,7 +229,9 @@ function directionLabel(direction: string) { diff --git a/frontend/src/features/wallet/views/WalletView.vue b/frontend/src/features/wallet/views/WalletView.vue index 4c91772..350982c 100644 --- a/frontend/src/features/wallet/views/WalletView.vue +++ b/frontend/src/features/wallet/views/WalletView.vue @@ -19,6 +19,7 @@ import { import { balanceTypeLabel, ledgerDirectionLabel, + walletBizTypeLabel, walletStatusLabel, } from '@/shared/utils/statusLabels' import { formatDateTime } from '@/shared/utils/time' @@ -94,32 +95,6 @@ function handleWithdraw() { router.push('/wallet/withdrawal') } -function walletBizTypeLabel(type: string) { - const map: Record = { - order_pay: '订单支付', - order_lock: '订单冻结', - channel_order_lock: '支付冻结', - order_cancel: '取消解冻', - order_cancel_refund: '取消退款', - admin_order_close: '客服关闭解冻', - admin_order_close_refund: '客服关闭退款', - order_settle: '订单结算', - owner_income: '号主收入', - deposit_compensation: '押金赔付', - rent_refund: '租金退款', - deposit_release: '押金释放', - arbitration_release_frozen: '仲裁解冻', - arbitration_renter_refund: '仲裁退款', - arbitration_owner_income: '仲裁收入', - cancel_refund: '取消退款', - checkout_refund: '结账退款', - channel_deposit_refund: '押金退还', - withdraw_apply: '申请提现', - admin_pickup_settle: '线下提号结算', - } - return map[type] || type || '-' -} - function directionTone(direction: string) { const map: Record = { in: 'success', diff --git a/frontend/src/shared/utils/statusLabels.ts b/frontend/src/shared/utils/statusLabels.ts index 7c75736..30bd77c 100644 --- a/frontend/src/shared/utils/statusLabels.ts +++ b/frontend/src/shared/utils/statusLabels.ts @@ -134,6 +134,59 @@ const balanceTypeMap: Record = { frozen: '冻结余额', } +/** + * 钱包流水业务类型(wallet_ledger.biz_type)中文映射。 + * 取值来源:后端 wallet.AppendEntries 的全部调用点 + 生产库 wallet_ledger 实际枚举。 + * 新增业务类型时请同步维护,避免页面回退展示英文原值。 + */ +const walletBizTypeMap: Record = { + // 订单/收益 + owner_income: '号主收入', + deposit_compensation: '押金赔付', + // 仲裁 + arbitration_owner_income: '仲裁赔付', + arbitration_release_frozen: '仲裁冻结释放', + // 提现 + withdraw_apply: '申请提现', + withdraw_freeze: '提现冻结', + withdraw_complete: '提现成功', + withdraw_cancel: '提现取消', + withdraw_reject: '提现驳回', + // 人工调账 + admin_credit: '管理员加款', + admin_debit: '管理员扣款', + admin_pickup_settle: '提号结算', + admin_pickup_adjustment: '提号结算调整', + // 营销 + invite_rebate: '邀请返利', + // 分销 + distribution_settlement: '分销结算', + distribution_reversal: '分销结算回冲', +} + +/** 钱包流水业务类型下拉选项,与 walletBizTypeMap 保持同一数据源 */ +export const walletBizTypeOptions: { label: string; value: string }[] = Object.entries( + walletBizTypeMap +).map(([value, label]) => ({ value, label })) + +/** 历史遗留的支付/退款业务类型别名,避免老数据回退展示英文 */ +const walletLegacyBizTypeMap: Record = { + order_pay: '订单支付', + order_lock: '订单冻结', + channel_order_lock: '支付冻结', + order_cancel: '取消解冻', + order_cancel_refund: '取消退款', + admin_order_close: '客服关闭解冻', + admin_order_close_refund: '客服关闭退款', + order_settle: '订单结算', + rent_refund: '租金退款', + deposit_release: '押金释放', + arbitration_renter_refund: '仲裁退款', + cancel_refund: '取消退款', + checkout_refund: '结账退款', + channel_deposit_refund: '押金退还', +} + const pickupStatusMap: Record = { picking_up: '提号中', completed: '已完成', @@ -216,6 +269,10 @@ export function balanceTypeLabel(type: string) { return readLabel(balanceTypeMap, type) } +export function walletBizTypeLabel(type: string) { + return readLabel({ ...walletBizTypeMap, ...walletLegacyBizTypeMap }, type) +} + export function pickupStatusLabel(status: string) { return readLabel(pickupStatusMap, status) }