修复前端金额展示并整理依赖
This commit is contained in:
@@ -13,14 +13,14 @@ import {
|
||||
import { fetchPostRentalNotice, type PostRentalNotice } from '@/features/orders/api/orders'
|
||||
import { formatDateMinute } from '@/utils/time'
|
||||
import { uploadFile } from '@/shared/api/files'
|
||||
import { formatCent, formatMoney } from '@/shared/utils/money'
|
||||
import { formatCent } from '@/shared/utils/money'
|
||||
|
||||
const session = useSessionStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
/** 数据项 */
|
||||
const balance = ref(0)
|
||||
const availableBalanceCent = ref(0)
|
||||
const showSettings = ref(false)
|
||||
const showProfileEditor = ref(false)
|
||||
const savingProfile = ref(false)
|
||||
@@ -101,7 +101,7 @@ onMounted(() => {
|
||||
async function loadBalance() {
|
||||
try {
|
||||
const wallet = await fetchWalletBalance()
|
||||
balance.value = wallet.available_balance_cent
|
||||
availableBalanceCent.value = wallet.available_balance_cent
|
||||
} catch {
|
||||
// 失败静默处理,显示为默认0
|
||||
}
|
||||
@@ -317,7 +317,7 @@ function resolveAvatarURL(url: string | undefined | null) {
|
||||
<div class="balance-row">
|
||||
<div class="balance-info">
|
||||
<span class="balance-label">账户可用余额(元)</span>
|
||||
<strong class="balance-value">¥{{ formatMoney(balance) }}</strong>
|
||||
<strong class="balance-value">¥{{ formatCent(availableBalanceCent) }}</strong>
|
||||
</div>
|
||||
<button class="withdraw-btn" @click="handleWithdraw">提现</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user