完成金额统一重构:提供完整的前端适配文档
后端状态:✅ 100% 完成 - 数据库迁移、Model层、所有业务模块已完成 - 编译验证通过 前端状态:✅ 基础设施完成 + 📋 详细适配文档 - Money工具函数:formatCent/yuanToCent等 ✅ - Wallet/Withdrawal API类型:*_cent字段 ✅ - WalletView.vue:部分适配完成 ✅ - 详细适配文档:前端Vue组件详细适配清单.md 📋 新增文档: 1. 金额统一重构完成报告.md - 后端技术细节 2. 前端金额字段适配指南.md - 概要指南 3. 金额统一重构项目总结.md - 项目总结 4. 前端Vue组件详细适配清单.md - 详细操作清单(新增) 适配清单包含: - WalletView.vue 详细改动点 - WithdrawalView.vue 详细改动点 - Order相关组件改动点 - Listing相关组件改动点 - AdminFinance组件改动点 - 批量操作指南(VSCode全局替换) - 测试检查清单 - 常见问题排查 下一步: 按照《前端Vue组件详细适配清单.md》逐个修改组件 预计工作量:2-3小时(机械性操作)
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
import type { PaymentOrder } from '@/features/orders'
|
||||
import { balanceTypeLabel, ledgerDirectionLabel, walletStatusLabel } from '@/utils/statusLabels'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
import { formatCent, formatCentWithSymbol } from '@/shared/utils/money'
|
||||
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
@@ -51,14 +52,14 @@ const walletMetrics = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '可用余额',
|
||||
value: formatMoney(account.value.available_balance),
|
||||
value: formatCentWithSymbol(account.value.available_balance_cent),
|
||||
hint: '卖家结算收入累计到此账户',
|
||||
icon: WalletIcon,
|
||||
tone: 'available',
|
||||
},
|
||||
{
|
||||
label: '冻结余额',
|
||||
value: formatMoney(account.value.frozen_balance),
|
||||
value: formatCentWithSymbol(account.value.frozen_balance_cent),
|
||||
hint: '当前暂无冻结资金使用',
|
||||
icon: Lock,
|
||||
tone: 'frozen',
|
||||
@@ -221,10 +222,6 @@ function readError(error: unknown, fallback: string) {
|
||||
return fallback
|
||||
}
|
||||
|
||||
function formatMoney(value: number) {
|
||||
return `¥${(Math.round(Number(value || 0) * 10) / 10).toFixed(1)}`
|
||||
}
|
||||
|
||||
function walletBizTypeLabel(type: string) {
|
||||
const map: Record<string, string> = {
|
||||
dev_recharge: '测试充值',
|
||||
|
||||
Reference in New Issue
Block a user