统一金额分制重构

This commit is contained in:
yml
2026-06-09 19:04:11 +08:00
parent 87673288ef
commit 5cd3ead4bd
69 changed files with 886 additions and 1277 deletions
@@ -15,7 +15,7 @@ import {
type RefundStatus,
} from '@/features/orders'
import { fetchAdminPayments, type AdminPayment } from '@/features/admin/api/adminPayments'
import { centToYuan, formatMoney, formatMoneyWithSymbol } from '@/shared/utils/money'
import { centToYuan, formatCentWithSymbol, formatMoney } from '@/shared/utils/money'
import { handoffStatusLabel, orderStatusLabel } from '@/utils/statusLabels'
import { formatDateTime } from '@/utils/time'
import { formatListingNo } from '@/utils/listingDisplay'
@@ -111,9 +111,9 @@ function money(value: unknown) {
return formatMoney(Number(value || 0))
}
function amountYuan(cent: unknown, legacyYuan?: unknown) {
function amountYuan(cent: unknown) {
if (cent !== undefined && cent !== null) return centToYuan(Number(cent || 0))
return Number(legacyYuan || 0)
return 0
}
async function handleRefund() {
@@ -173,7 +173,7 @@ function paymentBizTypeLabel(type: string) {
}
function moneyCent(value: number) {
return formatMoneyWithSymbol(Number(value || 0) / 100)
return formatCentWithSymbol(value)
}
function formatHandoffRecordType(type: string) {
@@ -232,15 +232,15 @@ function formatHandoffRecordType(type: string) {
</div>
<div class="metric-card">
<span>订单金额</span>
<strong>¥{{ money(amountYuan(order.rent_amount_cent, order.rent_amount)) }}</strong>
<strong>¥{{ money(amountYuan(order.rent_amount_cent)) }}</strong>
</div>
<div class="metric-card">
<span>平台费用</span>
<strong>¥{{ money(amountYuan(order.platform_fee_cent, order.platform_fee)) }}</strong>
<strong>¥{{ money(amountYuan(order.platform_fee_cent)) }}</strong>
</div>
<div class="metric-card">
<span>押金</span>
<strong>¥{{ money(amountYuan(order.deposit_amount_cent, order.deposit_amount)) }}</strong>
<strong>¥{{ money(amountYuan(order.deposit_amount_cent)) }}</strong>
</div>
<div v-if="refundStatus" class="metric-card">
<span>退款状态</span>