From 7f9d55f2883a8bf704e6675ea00a1dcdcb56541f Mon Sep 17 00:00:00 2001 From: Lxy Date: Sat, 23 May 2026 15:30:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E4=BF=AE=E5=A4=8DAI=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=8D=A1=E7=89=87=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/futures_analysis.css | 86 ++++++++++++ app/static/futures_analysis.html | 30 +++-- app/static/futures_analysis.js | 217 ++++++++++++++++++++++++++----- 3 files changed, 289 insertions(+), 44 deletions(-) diff --git a/app/static/futures_analysis.css b/app/static/futures_analysis.css index b600b01..8df7931 100644 --- a/app/static/futures_analysis.css +++ b/app/static/futures_analysis.css @@ -546,6 +546,35 @@ body { overflow: hidden; } +.futures-card.no-ai-data { + opacity: 0.85; + border-style: dashed; +} + +.futures-card.no-ai-data:hover { + opacity: 1; + border-color: var(--purple, #8b5cf6); +} + +.ai-hint { + text-align: center; + padding: 8px; + margin: 8px 0; + background: rgba(139, 92, 246, 0.08); + border: 1px dashed rgba(139, 92, 246, 0.3); + border-radius: 8px; + color: var(--purple, #8b5cf6); + font-size: 12px; + display: flex; + align-items: center; + justify-content: center; + gap: 6px; +} + +.ai-hint i { + font-size: 14px; +} + .futures-card::before { content: ''; position: absolute; @@ -2521,6 +2550,63 @@ body.theme-minimal .watch-btn.active { background: rgba(6, 182, 212, 0.1); } +.card-ai-btn { + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + background: none; + border: 1px solid var(--purple-soft, rgba(139, 92, 246, 0.3)); + border-radius: 8px; + color: var(--purple, #8b5cf6); + cursor: pointer; + transition: all 0.2s; + font-size: 12px; +} + +.card-ai-btn:hover { + border-color: var(--purple, #8b5cf6); + background: rgba(139, 92, 246, 0.1); +} + +.card-ai-btn.analyzing { + color: var(--amber); + border-color: var(--amber); + animation: pulse 1s infinite; +} + +.ai-analyze-all-btn { + padding: 8px 16px; + display: flex; + align-items: center; + gap: 8px; + background: linear-gradient(135deg, var(--purple, #8b5cf6), #6d28d9); + border: none; + border-radius: 8px; + color: white; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; +} + +.ai-analyze-all-btn:hover { + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); +} + +.ai-analyze-all-btn:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none; +} + +@keyframes pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.5; } +} + body.theme-minimal .card-refresh-btn { border-radius: 9999px; background: var(--bg-card); diff --git a/app/static/futures_analysis.html b/app/static/futures_analysis.html index 98f5637..f89ccf0 100644 --- a/app/static/futures_analysis.html +++ b/app/static/futures_analysis.html @@ -118,19 +118,23 @@
- -
- -
-
+ + +
+ +
+ diff --git a/app/static/futures_analysis.js b/app/static/futures_analysis.js index 68517a6..6b12847 100644 --- a/app/static/futures_analysis.js +++ b/app/static/futures_analysis.js @@ -73,6 +73,9 @@ function initEventListeners() { // 刷新全部按钮 document.getElementById('refresh-all-btn').addEventListener('click', refreshAllSymbols); + // 全部AI分析按钮 + document.getElementById('ai-analyze-all-btn').addEventListener('click', analyzeAllSymbols); + // 详情页刷新按钮 document.getElementById('refresh-symbol-btn').addEventListener('click', function() { if (currentSymbol) { @@ -224,7 +227,10 @@ async function loadFuturesList() { const response = await fetch(`${API_BASE}/list`); const data = await response.json(); if (data.success) { - allFuturesData = data.data; + allFuturesData = data.data.map(item => ({ + ...item, + hasAIAnalysis: false // 默认没有AI分析数据 + })); renderFuturesGrid(allFuturesData); updateStats(allFuturesData); } @@ -289,8 +295,10 @@ function renderFuturesGrid(data) { grid.innerHTML = data.map(item => { const isWatched = watchedSymbols.includes(item.symbol); + const hasAI = item.hasAIAnalysis; + return ` -
+
${item.symbol.replace(/[0-9]/g, '').substring(0, 2)}
@@ -307,7 +315,7 @@ function renderFuturesGrid(data) {
- ${item.suggestion} + ${hasAI ? item.suggestion : '--'}
成功率 @@ -320,21 +328,25 @@ function renderFuturesGrid(data) { ${item.trendScore}
-