feat: 个股添加个股列表弹窗

This commit is contained in:
zdl
2025-12-04 11:51:21 +08:00
parent a712392218
commit 0a2fff0ffc
4 changed files with 378 additions and 45 deletions

13
app.py
View File

@@ -12284,13 +12284,20 @@ def get_daily_top_concepts():
top_concepts = []
for concept in data.get('results', []):
# 保持与 /concept-api/search 相同的字段结构
top_concepts.append({
'concept_id': concept.get('concept_id'),
'concept_name': concept.get('concept'),
'concept': concept.get('concept'), # 原始字段名
'concept_name': concept.get('concept'), # 兼容旧字段名
'description': concept.get('description'),
'change_percent': concept.get('price_info', {}).get('avg_change_pct', 0),
'stock_count': concept.get('stock_count', 0),
'stocks': concept.get('stocks', [])[:5] # 只返回前5只股票
'score': concept.get('score'),
'match_type': concept.get('match_type'),
'price_info': concept.get('price_info', {}), # 完整的价格信息
'change_percent': concept.get('price_info', {}).get('avg_change_pct', 0), # 兼容旧字段
'happened_times': concept.get('happened_times', []), # 历史触发时间
'stocks': concept.get('stocks', []), # 返回完整股票列表
'hot_score': concept.get('hot_score')
})
# 格式化日期为 YYYY-MM-DD