个人中心页面,收支数据渲染

This commit is contained in:
WindowBird 2025-08-19 11:58:06 +08:00
parent 754d825bee
commit d006184496
4 changed files with 22 additions and 26 deletions

View File

@ -26,7 +26,7 @@ import { getUserFinancialData } from '@/api/user/user.js'
const response = await getUserFinancialData()
if (response.code === 200) {
const financialData = response.data
// financialData包含withdrawable, pending, withdrawing, withdrawn
// financialData包含balance, waitBalance, withdrawBalance, withdrawedBalance
}
```
@ -74,12 +74,10 @@ const response = await updateUserInfo(userData)
### 财务数据 (FinancialData)
```javascript
{
withdrawable: '18079.29', // 可提现金额
pending: '399.59', // 待入账金额
withdrawing: '9.59', // 提现中金额
withdrawn: '999.59', // 已提现金额
totalIncome: '20000.00', // 总收入
totalExpense: '1521.72' // 总支出
balance: 10000.00, // 可提现金额
waitBalance: 0, // 待入账金额
withdrawBalance: 0, // 提现中金额
withdrawedBalance: 0 // 已提现金额
}
```

View File

@ -12,12 +12,10 @@ export const mockUserInfo = {
}
export const mockFinancialData = {
withdrawable: '18079.29',
pending: '399.59',
withdrawing: '9.59',
withdrawn: '999.59',
totalIncome: '20000.00',
totalExpense: '1521.72',
balance: 10000.00,
waitBalance: 0,
withdrawBalance: 0,
withdrawedBalance: 0,
}
export const mockUserStats = {

View File

@ -23,7 +23,7 @@ export function getUserInfo() {
*/
export function getUserFinancialData() {
return request({
url: '/app/user/financial',
url: '/app/user/getBill',
method: 'GET',
showLoading: false,
}).catch(error => {

View File

@ -40,7 +40,7 @@
<view class="financial-summary">
<image :src="commonEnum.COIN_BACKGROUND" class="coin-background" mode="width"></image>
<view class="main-amount">
<text class="amount-number">{{ financialData.withdrawable || '0.00' }}</text>
<text class="amount-number">{{ financialData.balance || '0.00' }}</text>
<text class="amount-label">可提现()</text>
</view>
<view class="action-buttons">
@ -53,15 +53,15 @@
</view>
<view class="financial-stats">
<view class="stat-item">
<text class="stat-number">{{ financialData.pending || '0.00' }}</text>
<text class="stat-number">{{ financialData.waitBalance || '0.00' }}</text>
<text class="stat-label">待入账()</text>
</view>
<view class="stat-item">
<text class="stat-number">{{ financialData.withdrawing || '0.00' }}</text>
<text class="stat-number">{{ financialData.withdrawBalance || '0.00' }}</text>
<text class="stat-label">提现中()</text>
</view>
<view class="stat-item">
<text class="stat-number">{{ financialData.withdrawn || '0.00' }}</text>
<text class="stat-number">{{ financialData.withdrawedBalance || '0.00' }}</text>
<text class="stat-label">已提现()</text>
</view>
</view>
@ -140,10 +140,10 @@ export default {
userId: '',
},
financialData: {
withdrawable: '0.00',
pending: '0.00',
withdrawing: '0.00',
withdrawn: '0.00',
balance: 0.00,
waitBalance: 0,
withdrawBalance: 0,
withdrawedBalance: 0,
},
userStats: {
users: 0,
@ -241,10 +241,10 @@ export default {
return {
code: 200,
data: {
withdrawable: '18079.29',
pending: '399.59',
withdrawing: '9.59',
withdrawn: '999.59'
balance: 10000.00,
waitBalance: 0,
withdrawBalance: 0,
withdrawedBalance: 0
}
}
}