修复总市值显示错误 & 板块切换数据合并问题

1. 后端: 修正腾讯API字段索引偏移 (total_market_cap [43]→[45],
   pb [45]→[46]),并处理市值单位转换(亿→元)
2. 前端: 板块切换时同步清空旧数据 + 显示加载态,避免新旧
   数据合并闪现

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Sakurasan
2026-07-13 20:07:21 +08:00
co-authored by Claude
parent aaa618b15d
commit 20b2afb0fc
2 changed files with 13 additions and 6 deletions
+7 -1
View File
@@ -75,7 +75,13 @@ function SectorsPage() {
{TABS.map((t) => (
<button
key={t.key}
onClick={() => setTab(t.key)}
onClick={() => {
if (t.key !== tab) {
setData([]);
setLoading(true);
setTab(t.key);
}
}}
className={`flex-1 py-1.5 text-sm font-medium rounded-md transition-colors ${
tab === t.key
? "bg-background text-foreground shadow-sm"