fix(订单中心):首页统计数据规则修改

This commit is contained in:
2025-08-04 20:01:45 +08:00
parent 3503558ebc
commit b830b201f7
2 changed files with 77 additions and 18 deletions
@@ -157,6 +157,9 @@ const Welcome: React.FC = () => {
const filterOptions = statistics.filterOptions || {};
// 使用后端返回的基础数据
// 订单总金额:orderStatus=3+orderStatus=8的总金额(包含逻辑删除记录)
// 退款金额:orderStatus=8的总金额(包含逻辑删除记录)
// 净收入:总金额 - 退款金额
const totalAmount = orderStats.totalAmount || 0;
const refundAmount = orderStats.refundAmount || 0;
const netIncome = orderStats.netIncome || 0;
@@ -179,6 +182,16 @@ const Welcome: React.FC = () => {
areaStyle: {
fillOpacity: 0.6,
},
color: ['#1890ff', '#52c41a', '#faad14'],
xAxis: {
type: 'time',
tickCount: 7,
},
yAxis: {
label: {
formatter: (v: any) => `${v}单`,
},
},
};
// 订单分布配置
@@ -339,7 +352,7 @@ const Welcome: React.FC = () => {
<span>收入统计</span>
</div>
<Statistic
title="订单总金额"
title="订单总金额 (完成+退款)"
value={(orderStats.totalAmount || 0) / 100}
precision={2}
prefix="¥"
@@ -395,7 +408,7 @@ const Welcome: React.FC = () => {
{/* 图表展示 */}
<Row gutter={[16, 16]} className={styles.chartsRow}>
<Col xs={24} lg={16}>
<Card title="订单趋势" loading={loading}>
<Card title="订单趋势(创建/完成/退款)" loading={loading}>
<Area {...orderTrendConfig} height={300} />
</Card>
</Col>