From b7858fd85fcc037e13c3f59a171c6f0a1267b41f Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sun, 29 Mar 2026 18:17:45 +0800 Subject: [PATCH] 1 --- frontend/trading.html | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/frontend/trading.html b/frontend/trading.html index 274c3f1..7012cee 100644 --- a/frontend/trading.html +++ b/frontend/trading.html @@ -391,7 +391,12 @@

暂无历史订单

-
+
+

暂无统计数据

+
+ + +
@@ -437,7 +442,7 @@ -
+
@@ -475,7 +480,7 @@ -
+
@@ -686,7 +691,8 @@ await Promise.all([ this.fetchAccountStatus(), this.fetchStatistics(), - this.fetchOrders() + this.fetchOrders(), + this.fetchLatestPrices() ]); } catch (e) { console.error('刷新数据失败:', e); @@ -700,13 +706,25 @@ await Promise.all([ this.fetchAccountStatus(), this.fetchStatistics(), - this.fetchOrders() + this.fetchOrders(), + this.fetchLatestPrices() ]); } catch (e) { console.error('静默刷新失败:', e); } }, + async fetchLatestPrices() { + try { + const response = await axios.get('/monitor/status'); + if (response.data.success && response.data.latest_prices) { + this.latestPrices = response.data.latest_prices; + } + } catch (error) { + console.error('获取实时价格失败:', error); + } + }, + async fetchAccountStatus() { try { const response = await axios.get('/api/trading/account'); @@ -735,10 +753,6 @@ console.log('API Response:', response.data); if (response.data.success) { this.orders = response.data.orders || []; - // 获取实时价格 - if (response.data.latest_prices) { - this.latestPrices = response.data.latest_prices; - } console.log('Orders loaded:', this.orders.length); console.log('Orders data:', this.orders); console.log('Open positions:', this.orders.filter(o => o.status === 'open'));