统一金额分制重构

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
@@ -26,6 +26,7 @@ import {
writePublishDraft,
} from '@/features/seller/composables/usePublishDraft'
import type { PublishForm } from '@/types/publish'
import { yuanToCent } from '@/shared/utils/money'
import { commonOnlineTimes, dailyLossOptions, formatNumber, roundRatio } from '@/utils/pricing'
const draftSaveDelay = 400
@@ -567,8 +568,8 @@ export function usePublishForm(options: UsePublishFormOptions) {
haf_coin_amount: pricing.coinMAmount.value * 1000000,
asset_summary: buildAssetSummary(),
screenshot_urls: pricing.screenshotUrls.value,
price: pricing.calculatedFinalPrice.value,
deposit_amount: Number(form.deposit_amount),
price_cent: yuanToCent(pricing.calculatedFinalPrice.value),
deposit_amount_cent: yuanToCent(Number(form.deposit_amount)),
agreed_virtual_asset_sale: virtualAssetSaleAgreementChecked.value,
agreed_seller_agreement: sellerAgreementChecked.value,
})
@@ -5,7 +5,7 @@ import { fetchOrders, type Order } from '@/features/orders'
import { useSessionStore } from '@/stores/session'
import { handoffStatusLabel, orderStatusLabel } from '@/utils/statusLabels'
import { formatDateTime } from '@/utils/time'
import { formatMoney } from '@/shared/utils/money'
import { centToYuan, formatMoney } from '@/shared/utils/money'
import { formatListingNo } from '@/utils/listingDisplay'
const session = useSessionStore()
@@ -73,6 +73,10 @@ function actionText(order: Order) {
function money(value: unknown) {
return formatMoney(Number(value || 0))
}
function sellerAmount(order: Order) {
return centToYuan(order.owner_rent_amount_cent ?? order.display_amount_cent)
}
</script>
<template>
@@ -122,7 +126,7 @@ function money(value: unknown) {
<el-table-column prop="order_no" label="订单号" min-width="220" />
<el-table-column prop="title" label="账号" min-width="180" />
<el-table-column label="金额" width="120">
<template #default="{ row }">¥{{ money(row.display_amount) }}</template>
<template #default="{ row }">¥{{ money(sellerAmount(row)) }}</template>
</el-table-column>
<el-table-column label="订单状态" width="150">
<template #default="{ row }">{{ orderStatusLabel(row.status) }}</template>
@@ -9,7 +9,7 @@ import {
submitListingReview,
type Listing,
} from '@/features/listings'
import { formatMoney, formatMoneyWithSymbol } from '@/shared/utils/money'
import { formatCent, formatMoney, formatMoneyWithSymbol } from '@/shared/utils/money'
import { listingReviewStatusLabel, listingStatusLabel } from '@/utils/statusLabels'
import { formatListingCode, getListingSellerPrice } from '@/utils/listingDisplay'
@@ -227,7 +227,7 @@ function isPendingReview(row: Listing) {
</div>
<div>
<span>押金</span>
<strong>¥{{ formatMoney(item.deposit_amount) }}</strong>
<strong>¥{{ formatCent(item.deposit_amount_cent) }}</strong>
</div>
</div>