修复总市值显示错误 & 板块切换数据合并问题
1. 后端: 修正腾讯API字段索引偏移 (total_market_cap [43]→[45], pb [45]→[46]),并处理市值单位转换(亿→元) 2. 前端: 板块切换时同步清空旧数据 + 显示加载态,避免新旧 数据合并闪现 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user