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

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

View File

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

View File

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

View File

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