修复前端金额展示并整理依赖

This commit is contained in:
yml
2026-06-09 20:32:17 +08:00
parent 4c2199df58
commit 684e30862d
20 changed files with 129 additions and 194 deletions
+3 -1
View File
@@ -44,7 +44,9 @@ export async function fetchWalletLedger(page = 1, pageSize = 20) {
export async function rechargeWallet(amountYuan: number) {
const amount_cent = yuanToCent(amountYuan)
const { data } = await apiClient.post<ApiResponse<WalletAccount>>('/wallet/recharge', { amount_cent })
const { data } = await apiClient.post<ApiResponse<WalletAccount>>('/wallet/recharge', {
amount_cent,
})
return data.data
}
-1
View File
@@ -2,4 +2,3 @@
export * from './api/wallet'
export * from './api/withdrawal'
export * from './composables/useWallet'
export type * from './types'
-18
View File
@@ -1,18 +0,0 @@
// Wallet 模块类型定义
export interface WalletBalance {
balance: number
frozenBalance: number
}
export interface WalletTransaction {
id: number
type: string
amount: number
balance: number
description: string
createdAt: string
}
export interface RechargeRequest {
amount: number
}
@@ -276,7 +276,9 @@ function amountPrefix(direction: string) {
</div>
<div class="wallet-hero-action">
<span>当前可用</span>
<strong>{{ account ? formatCentWithSymbol(account.available_balance_cent) : '¥0.0' }}</strong>
<strong>{{
account ? formatCentWithSymbol(account.available_balance_cent) : '¥0.0'
}}</strong>
<el-button class="withdraw-button" :icon="Money" type="primary" @click="handleWithdraw">
申请提现
</el-button>
@@ -377,7 +379,9 @@ function amountPrefix(direction: string) {
{{ amountPrefix(row.direction) }}{{ formatCentWithSymbol(row.amount_cent) }}
</span>
<span class="ledger-cell muted-cell">{{ balanceTypeLabel(row.balance_type) }}</span>
<span class="ledger-cell align-right">{{ formatCentWithSymbol(row.balance_after_cent) }}</span>
<span class="ledger-cell align-right">{{
formatCentWithSymbol(row.balance_after_cent)
}}</span>
<span class="ledger-cell" :title="row.remark">{{ row.remark || '-' }}</span>
<span class="ledger-cell">{{ formatDateTime(row.created_at) }}</span>
</div>
@@ -186,9 +186,7 @@ function accountTypeLabel(type: string) {
<el-icon><Money /></el-icon>
冻结余额
</div>
<div class="balance-value frozen">
¥{{ formatCent(account?.frozen_balance_cent) }}
</div>
<div class="balance-value frozen">¥{{ formatCent(account?.frozen_balance_cent) }}</div>
</div>
</div>
</el-card>
@@ -261,7 +259,9 @@ function accountTypeLabel(type: string) {
<el-alert
v-if="
withdrawForm.amount > 0 && account && yuanToCent(withdrawForm.amount) > account.available_balance_cent
withdrawForm.amount > 0 &&
account &&
yuanToCent(withdrawForm.amount) > account.available_balance_cent
"
type="error"
:closable="false"
@@ -312,7 +312,9 @@ function accountTypeLabel(type: string) {
<el-table-column prop="withdraw_no" label="提现单号" min-width="180" />
<el-table-column label="提现金额" width="120">
<template #default="{ row }">
<span style="color: #f56c6c; font-weight: 600"> ¥{{ formatCent(row.amount_cent) }} </span>
<span style="color: #f56c6c; font-weight: 600">
¥{{ formatCent(row.amount_cent) }}
</span>
</template>
</el-table-column>
<el-table-column label="收款方式" width="150">