From 76e76c62ef4c444d04137e7f3c611eac96ea1fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sat, 7 Mar 2026 02:01:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(withdraw):=20=E4=BF=AE=E5=A4=8D=E7=BB=8F?= =?UTF-8?q?=E9=94=80=E5=95=86=E6=8F=90=E7=8E=B0=E9=A1=B5=E9=9D=A2=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E4=B9=89=E5=92=8C=E6=B8=B2=E6=9F=93=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 activeTab 状态类型从 string | number 限定为 string - 统一 Tab 切换处理中的值转换逻辑,避免类型不一致问题 - 修复条件判断中的字符串比较,确保类型安全 - 调整组件渲染方式,改为按需渲染当前选中的标签页内容 - 更新骑手页面工资统计标题为配送提成以匹配实际业务逻辑 --- src/dealer/withdraw/index.tsx | 10 +++++----- src/rider/index.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dealer/withdraw/index.tsx b/src/dealer/withdraw/index.tsx index 881de55..8bd92f5 100644 --- a/src/dealer/withdraw/index.tsx +++ b/src/dealer/withdraw/index.tsx @@ -98,7 +98,7 @@ const normalizeMoneyString = (money: unknown) => { } const DealerWithdraw: React.FC = () => { - const [activeTab, setActiveTab] = useState('0') + const [activeTab, setActiveTab] = useState('0') const [loading, setLoading] = useState(false) const [refreshing, setRefreshing] = useState(false) const [submitting, setSubmitting] = useState(false) @@ -114,10 +114,11 @@ const DealerWithdraw: React.FC = () => { // Tab 切换处理函数 const handleTabChange = (value: string | number) => { console.log('Tab切换到:', value) - setActiveTab(value) + const next = String(value) + setActiveTab(next) // 如果切换到提现记录页面,刷新数据 - if (String(value) === '1') { + if (next === '1') { fetchWithdrawRecords() } } @@ -628,13 +629,12 @@ const DealerWithdraw: React.FC = () => { - {renderWithdrawForm()} - {renderWithdrawRecords()} + {activeTab === '0' ? renderWithdrawForm() : renderWithdrawRecords()} ) } diff --git a/src/rider/index.tsx b/src/rider/index.tsx index 665800e..a77aef6 100644 --- a/src/rider/index.tsx +++ b/src/rider/index.tsx @@ -130,7 +130,7 @@ const DealerIndex: React.FC = () => { {dealerUser && ( - 工资统计 + 配送提成