From 29c080f8e0d4263e440ab1d7a19077953fac4178 Mon Sep 17 00:00:00 2001 From: dekun Date: Mon, 20 Jul 2026 12:54:13 +0800 Subject: [PATCH] Desktop calculator: top tabs with input/result dual cards. Co-authored-by: Cursor --- manual_trading_hub/static/app.css | 102 +++++++++-- manual_trading_hub/static/index.html | 250 ++++++++++++++------------- 2 files changed, 223 insertions(+), 129 deletions(-) diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index fa92fc3..3f3a1ac 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -4638,7 +4638,16 @@ body.login-page { display: none; } - /* 行情全屏:竖屏提示转横;横屏吃满 */ + body.hub-phone #page-calculator .calc-result-title, + body.hub-phone #page-calculator .calc-result-placeholder { + display: none !important; + } + + body.hub-phone #page-calculator .calc-result { + margin-top: 14px; + padding-top: 12px; + border-top: 1px solid var(--border-soft); + } @media (orientation: portrait) { body.hub-phone.market-chart-fs-open .market-chart-wrap.is-fullscreen::before { content: "全屏看图请横持手机"; @@ -9569,32 +9578,56 @@ body.funds-fullscreen-open { } } -/* 电脑端计算器改为单页 Tab;手机继续使用原有紧凑 Tab 样式 */ +/* 电脑端计算器:上方 Tab + 左输入 / 右结果双卡;手机端保持原布局 */ .calc-tab-label-desktop { display: none; } +.calc-pane-split { + display: block; +} + +.calc-result-title { + display: none; + margin: 0 0 10px; + font-size: 1rem; + color: var(--text); +} + +.calc-result-placeholder { + display: none; + margin: 0; + color: var(--muted); + font-size: 0.82rem; + line-height: 1.5; +} + +.calc-result-panel:has(.calc-result.hidden) .calc-result-placeholder { + display: block; +} + body:not(.hub-phone) #page-calculator .calc-workspace { - display: grid; - grid-template-columns: 180px minmax(0, 1fr); + display: flex; + flex-direction: column; gap: 14px; - align-items: start; + align-items: stretch; } body:not(.hub-phone) #page-calculator .calc-mobile-tabs { - display: grid; - grid-template-columns: minmax(0, 1fr); + display: flex; + flex-direction: row; + flex-wrap: wrap; gap: 8px; max-width: none; margin: 0; - padding: 5px; + padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--nav-bg); } body:not(.hub-phone) #page-calculator .calc-m-tab { - min-height: 42px; + min-height: 40px; border: 1px solid transparent; border-radius: 9px; background: transparent; @@ -9603,8 +9636,8 @@ body:not(.hub-phone) #page-calculator .calc-m-tab { font-size: 13px; font-weight: 600; cursor: pointer; - text-align: left; - padding: 9px 12px; + text-align: center; + padding: 8px 16px; } body:not(.hub-phone) #page-calculator .calc-m-tab:hover { @@ -9637,9 +9670,54 @@ body:not(.hub-phone) #page-calculator .calc-layout[data-calc-tab="roll"] [data-c display: none; } +body:not(.hub-phone) #page-calculator .calc-card { + padding: 0; + background: transparent; + border: 0; + box-shadow: none; + height: auto; +} + +body:not(.hub-phone) #page-calculator .calc-pane-split { + display: grid; + grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); + gap: 14px; + align-items: start; +} + +body:not(.hub-phone) #page-calculator .calc-input-panel, +body:not(.hub-phone) #page-calculator .calc-result-panel { + padding: 16px 18px; + border-radius: 12px; + background: var(--panel, var(--dash-card-bg, #121820)); + border: 1px solid var(--border-soft, var(--border)); + box-shadow: var(--card-glow, none); + min-height: 280px; +} + +body:not(.hub-phone) #page-calculator .calc-result-title { + display: block; +} + +body:not(.hub-phone) #page-calculator .calc-result { + margin-top: 0; + padding-top: 0; + border-top: 0; +} + +body:not(.hub-phone) #page-calculator .calc-result.hidden { + display: none !important; +} + @media (min-width: 1200px) { body:not(.hub-phone) #page-calculator .calc-form-grid { - grid-template-columns: repeat(5, minmax(0, 1fr)); + grid-template-columns: repeat(3, minmax(0, 1fr)); + } +} + +@media (max-width: 1100px) { + body:not(.hub-phone) #page-calculator .calc-pane-split { + grid-template-columns: minmax(0, 1fr); } } diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index efee556..03529a4 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -16,7 +16,7 @@ - + @@ -812,127 +812,143 @@
-

趋势回调计算器

-

逻辑与实例策略页一致:首仓 50% + 补仓网格;止损金额 = 资金 × 风险%.

-
-
- - -
-
ETH/USDT · 加载合约信息…
-
- - - - - - - - - +
+
+

趋势回调计算器

+

逻辑与实例策略页一致:首仓 50% + 补仓网格;止损金额 = 资金 × 风险%.

+ +
+ + +
+
ETH/USDT · 加载合约信息…
+
+ + + + + + + + + +
+
+ +
+
-
- -
- - + +
-

滚仓计算器

-

首仓按「单次风险」以损定仓;每次滚仓后合并持仓打到新止损 ≈ 单次风险;止盈锁定首仓价不变.最多 3 次滚仓.

-
-
- - -
-
ETH/USDT · 加载合约信息…
-
- - - - - - - +
+
+

滚仓计算器

+

首仓按「单次风险」以损定仓;每次滚仓后合并持仓打到新止损 ≈ 单次风险;止盈锁定首仓价不变.最多 3 次滚仓.

+ +
+ + +
+
ETH/USDT · 加载合约信息…
+
+ + + + + + + +
+
+ 滚仓加仓(最多 3 次) + +
+
+
+ +
+
-
- 滚仓加仓(最多 3 次) - -
-
-
- -
- - -
+ +
+