From b79f309c5b2856e00f18e91427a9e11b1dfff0f2 Mon Sep 17 00:00:00 2001 From: dekun Date: Sun, 4 Oct 2026 07:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=8C=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E5=8D=96=E5=9B=9E=E3=80=8D=E6=8C=89=E9=92=AE=EF=BC=9A=E6=9C=89?= =?UTF-8?q?=E6=8C=81=E4=BB=93=E6=97=B6=E6=AD=A3=E7=A1=AE=E9=9A=90=E8=97=8F?= =?UTF-8?q?=EF=BC=8C=E6=A0=87=E7=9A=84=E6=8C=89=20BTC/ETH=20=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E4=B8=8E=E5=BD=93=E5=89=8D=E9=80=89=E6=8B=A9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- lib/common/static/instance_theme.css | 4 ++++ lib/common/static/options_panel.js | 16 +++++++++++++--- lib/instance/templates/embed_shell.html | 2 +- lib/instance/templates/index.html | 2 +- lib/options/templates/options_panel.html | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 0a7f532..5bca2f4 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -5513,6 +5513,10 @@ html[data-theme="light"] .opt-source-badge--oo { gap: 10px; flex-wrap: wrap; } +/* display:flex 会盖掉 UA [hidden] */ +.opt-spot-sell-head[hidden] { + display: none !important; +} .opt-spot-sell-avail { font-size: 0.78rem; color: #c9d6f5; diff --git a/lib/common/static/options_panel.js b/lib/common/static/options_panel.js index bdfdd1e..b710246 100644 --- a/lib/common/static/options_panel.js +++ b/lib/common/static/options_panel.js @@ -2270,13 +2270,21 @@ } function spotSellUnderlying(ss) { - if (!ss) return (state.underlying || "ETH").toUpperCase(); - if (ss.bridge_underlying) return String(ss.bridge_underlying).toUpperCase(); + const selected = (state.underlying || "ETH").toUpperCase(); + if (!ss) return selected; + const bridgeUly = String(ss.bridge_underlying || "").trim().toUpperCase(); const eth = Number(ss.trading_eth || 0); const btc = Number(ss.trading_btc || 0); + // 待卖回桥优先;否则优先当前选中标的上的残留,再比大小 + if (bridgeUly === "BTC" || bridgeUly === "ETH") { + if (ss.bridge_status === "pending_sell_spot") return bridgeUly; + } + if (selected === "BTC" && btc > 1e-12) return "BTC"; + if (selected === "ETH" && eth > 1e-12) return "ETH"; if (btc > eth && btc > 1e-12) return "BTC"; if (eth > 1e-12) return "ETH"; - return (ss.default_underly || state.underlying || "ETH").toUpperCase(); + if (bridgeUly === "BTC" || bridgeUly === "ETH") return bridgeUly; + return (ss.default_underly || selected || "ETH").toUpperCase(); } function paintSpotSellBanner(d, positions) { @@ -2784,6 +2792,8 @@ btn.classList.add("active"); state.underlying = btn.getAttribute("data-uly"); loadChain(); + // 切换 ETH/BTC 时重刷持仓区,以便「重试卖回」标的与当前选择同步 + refreshAllPositions(); }); }); diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index 9e06848..a75f619 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -9,7 +9,7 @@ - + diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index e863262..df35108 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -19,7 +19,7 @@ {{ pwa_app_name }} - + @@ -356,4 +356,4 @@ - +