diff --git a/static/index.html b/static/index.html index 5e55ee0..8070d32 100644 --- a/static/index.html +++ b/static/index.html @@ -362,38 +362,54 @@ let marketRefreshInterval = null; function refreshMarketData() { const el = document.getElementById('tab-market'); if (!el || el.classList.contains('hidden')) return; - fetchJSON('/api/market').then(d => { - const sectors = d.sectors || []; - const insights = d.insights || []; - const potentials = d.potential_stocks || []; + Promise.all([ + fetchJSON('/api/market'), + fetchJSON('/api/signals'), + ]).then(([mkt, signals]) => { + const sectors = mkt.sectors || []; + const sigs = signals || []; + const xiaoguo = sigs.filter(s => s.source === 'xiaoguo'); + const trend = sigs.filter(s => s.source !== 'xiaoguo'); el.innerHTML = ` -
+
-

🏭 行业热点

- ${sectors.length ? sectors.map(s => ` -
- ${s.name} - - ${(s.change||0)>=0?'+':''}${(s.change||0).toFixed(2)}% - +

🏭 行业热点

+ ${sectors.length ? sectors.slice(0,8).map(s => ` +
+ ${s.name} + ${(s.change||0)>=0?'+':''}${(s.change||0).toFixed(1)}%
- `).join('') : '
暂无行业数据
'} + `).join('') : '
暂无
'}
-

💡 知微洞察

- ${insights.length ? insights.map(i => - `
${i}
` - ).join('') : '
暂无洞察
'} +

📡 趋势信号 (${trend.length})

+ ${trend.length ? trend.slice(0,6).map(s => ` +
+ ${s.overall_sentiment||'中性'} + ${s.sector} ${(s.summary||'').slice(0,60)} +
+ `).join('') : '
暂无
'} +
+
+

🔍 小果扫描 (${xiaoguo.length})

+ ${xiaoguo.length ? xiaoguo.slice(0,6).map(s => ` +
+ ${s.overall_sentiment||'中性'} + ${s.sector} ${(s.summary||'').slice(0,60)} +
+ `).join('') : '
暂无
'}
-
-

🔍 潜力股挖掘

- ${potentials.length ? potentials.map(p => ` -
- ${p.name||p.code} - ${p.reason||''} -
- `).join('') : '
暂无挖掘
'} +
+

📋 全部板块排行(${sectors.length})

+
+ ${sectors.map(s => ` +
+ ${s.name} + ${(s.change||0)>=0?'+':''}${(s.change||0).toFixed(1)}% +
+ `).join('')} +
`; });