feat: 迭代
This commit is contained in:
@@ -5,15 +5,20 @@ import { getFinancialOverview, getPlatformTransactions } from '@/api/finance';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
|
||||
interface FinancialOverview {
|
||||
systemTotalAmount: number;
|
||||
totalUserPaid: number;
|
||||
totalRefund: number;
|
||||
totalWithdrawn: number;
|
||||
platformBalance: number;
|
||||
platformTotalIncome: number;
|
||||
platformTotalExpense: number;
|
||||
totalUserBalance: number;
|
||||
totalMerchantBalance: number;
|
||||
userCount: number;
|
||||
merchantCount: number;
|
||||
todayIncome: number;
|
||||
todayExpense: number;
|
||||
monthIncome: number;
|
||||
monthExpense: number;
|
||||
pendingWithdrawals: number;
|
||||
pendingSettlements: number;
|
||||
todayOrders: number;
|
||||
}
|
||||
|
||||
interface Transaction {
|
||||
@@ -108,18 +113,21 @@ const FinanceDashboard: React.FC = () => {
|
||||
|
||||
{overview && (
|
||||
<>
|
||||
{/* 平台总账户余额 - 突出显示 */}
|
||||
{/* 系统总账户金额 - 突出显示 */}
|
||||
<Card style={{ marginBottom: 24, background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)' }}>
|
||||
<Statistic
|
||||
title={<span style={{ color: '#fff', fontSize: 16 }}>平台总账户余额</span>}
|
||||
value={Number(overview.platformBalance || 0) + Number(overview.totalMerchantBalance || 0) + Number(overview.totalUserBalance || 0)}
|
||||
title={<span style={{ color: '#fff', fontSize: 16 }}>系统总账户金额</span>}
|
||||
value={Number(overview.systemTotalAmount || 0)}
|
||||
prefix={<WalletOutlined style={{ color: '#fff' }} />}
|
||||
suffix={<span style={{ color: '#fff' }}>元</span>}
|
||||
precision={2}
|
||||
valueStyle={{ color: '#fff', fontSize: 36, fontWeight: 'bold' }}
|
||||
/>
|
||||
<div style={{ color: 'rgba(255,255,255,0.8)', fontSize: 12, marginTop: 8 }}>
|
||||
平台内所有未提现的资金总额(包含平台钱包、商家账户、用户账户)
|
||||
用户实付(¥{Number(overview.totalUserPaid || 0).toFixed(2)})- 退款(¥{Number(overview.totalRefund || 0).toFixed(2)})- 提现(¥{Number(overview.totalWithdrawn || 0).toFixed(2)})
|
||||
</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.6)', fontSize: 11, marginTop: 4 }}>
|
||||
= 商家账户余额(¥{Number(overview.totalMerchantBalance || 0).toFixed(2)})+ 用户账户余额(¥{Number(overview.totalUserBalance || 0).toFixed(2)})+ 平台净收益(¥{Number(overview.platformBalance || 0).toFixed(2)})
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -127,13 +135,16 @@ const FinanceDashboard: React.FC = () => {
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="平台账户余额"
|
||||
title="平台净收益"
|
||||
value={overview.platformBalance}
|
||||
precision={2}
|
||||
prefix={<WalletOutlined />}
|
||||
suffix="元"
|
||||
valueStyle={{ color: '#1890ff' }}
|
||||
/>
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
|
||||
服务费收入 - 邀请返现
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
@@ -146,6 +157,9 @@ const FinanceDashboard: React.FC = () => {
|
||||
suffix="元"
|
||||
valueStyle={{ color: '#52c41a' }}
|
||||
/>
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
|
||||
{overview.userCount} 个用户账户
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
@@ -158,23 +172,25 @@ const FinanceDashboard: React.FC = () => {
|
||||
suffix="元"
|
||||
valueStyle={{ color: '#faad14' }}
|
||||
/>
|
||||
<div style={{ fontSize: 12, color: '#999', marginTop: 8 }}>
|
||||
{overview.merchantCount} 个商家账户
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="待处理提现"
|
||||
value={overview.pendingWithdrawals}
|
||||
precision={2}
|
||||
suffix="元"
|
||||
valueStyle={{ color: '#ff4d4f' }}
|
||||
title="今日订单数"
|
||||
value={overview.todayOrders}
|
||||
suffix="单"
|
||||
valueStyle={{ color: '#722ed1' }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={24} style={{ marginBottom: 24 }}>
|
||||
<Col span={6}>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="今日收入"
|
||||
@@ -186,7 +202,7 @@ const FinanceDashboard: React.FC = () => {
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="今日支出"
|
||||
@@ -198,6 +214,19 @@ const FinanceDashboard: React.FC = () => {
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="今日净收益"
|
||||
value={Number(overview.todayIncome || 0) - Number(overview.todayExpense || 0)}
|
||||
precision={2}
|
||||
suffix="元"
|
||||
valueStyle={{
|
||||
color: (Number(overview.todayIncome || 0) - Number(overview.todayExpense || 0)) >= 0 ? '#52c41a' : '#ff4d4f'
|
||||
}}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
|
||||
Reference in New Issue
Block a user