fix(订单中心):首页统计优化,智创商户支付调试,景区商户模式调试,文件冷热数据切换逻辑,携程优惠券调试

This commit is contained in:
2025-08-02 02:19:02 +08:00
parent ba869b62a5
commit 3a48b6f34f
17 changed files with 1176 additions and 60 deletions
@@ -43,10 +43,8 @@ interface Statistics {
todayOrders: number;
orderGrowth: number;
completionRate: number;
// 新增对账维度
// 对账相关字段
totalAmount: number; // 订单总金额(分)
platformAmount: number; // 平台分账金额(分)
tourismAmount: number; // 景区分账金额(分)
refundAmount: number; // 退款金额(分)
netIncome: number; // 净收入(分)
};
@@ -158,8 +156,12 @@ const Welcome: React.FC = () => {
const chartStats = statistics.chartStats || {};
const filterOptions = statistics.filterOptions || {};
// 动态分账金额计算
// 使用后端返回的基础数据
const totalAmount = orderStats.totalAmount || 0;
const refundAmount = orderStats.refundAmount || 0;
const netIncome = orderStats.netIncome || 0;
// 动态分账金额计算(基于净收入和分账比例)
const platformAmount = Math.round(netIncome * platformRate);
const tourismAmount = netIncome - platformAmount;
@@ -196,7 +198,7 @@ const Welcome: React.FC = () => {
data: [
{ type: '平台分账', value: platformAmount / 100 },
{ type: '景区分账', value: tourismAmount / 100 },
{ type: '退款金额', value: (orderStats.refundAmount || 0) / 100 },
{ type: '退款金额', value: refundAmount / 100 },
],
xField: 'type',
yField: 'value',
@@ -211,6 +213,18 @@ const Welcome: React.FC = () => {
return (
<PageContainer className={styles.container}>
{/* 演示数据提示 */}
<Card style={{ marginBottom: 16, backgroundColor: '#fff7e6', borderColor: '#ffd591' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ color: '#d46b08', fontWeight: 'bold', marginRight: '8px' }}>📊 演示数据提示:</span>
<span style={{ color: '#d46b08' }}>
二维码 82772e16-2398-45cd-83a4-d83e674447db 在 2025-07-24 至 2025-07-31 期间的数据已翻倍显示,用于演示目的
</span>
</div>
</div>
</Card>
{/* 筛选条件 */}
<Card style={{ marginBottom: 16 }}>
<Space size="large">
@@ -250,6 +264,9 @@ const Welcome: React.FC = () => {
<span style={{ color: '#666', fontSize: '12px' }}>
(当前:平台{Math.round(platformRate * 100)}% | 景区{Math.round((1 - platformRate) * 100)}%)
</span>
<span style={{ color: '#999', fontSize: '11px', marginLeft: '8px' }}>
(二维码分账逻辑已弃用,使用动态计算)
</span>
{/* 快速选择常用分账比例 */}
<Space size="small">
<span style={{ color: '#666', fontSize: '12px' }}>快速选择:</span>
@@ -381,6 +398,9 @@ const Welcome: React.FC = () => {
status="active"
format={(percent) => `分账率 ${percent?.toFixed(1)}%`}
/>
<div style={{ fontSize: '12px', color: '#666', marginTop: '8px' }}>
基于动态分账比例计算
</div>
</div>
</Card>
</Col>
@@ -148,8 +148,6 @@ declare namespace ORDERS {
completionRate: number;
// 对账相关字段
totalAmount: number; // 订单总金额(分)
platformAmount: number; // 平台分账金额(分)
tourismAmount: number; // 景区分账金额(分)
refundAmount: number; // 退款金额(分)
netIncome: number; // 净收入(分)
};