修复「重试卖回」按钮:有持仓时正确隐藏,标的按 BTC/ETH 残留与当前选择显示。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=4">
|
||||
<link rel="stylesheet" href="/static/instance_page.css?v=23">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=125">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=126">
|
||||
<script src="/static/account_risk_badge.js?v=4"></script>
|
||||
<script src="/static/open_submit_gate.js?v=1"></script>
|
||||
<meta name="theme-color" content="#0b0d14">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<link rel="manifest" href="/static/icons/manifest.webmanifest">
|
||||
<title>{{ pwa_app_name }}</title>
|
||||
<link rel="stylesheet" href="/static/instance_page.css?v=23">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=125">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=126">
|
||||
|
||||
</head>
|
||||
<body
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
<div class="options-pos-head-actions">
|
||||
<div id="opt-spot-sell-head" class="opt-spot-sell-head" hidden>
|
||||
<span class="opt-spot-sell-avail" id="opt-spot-sell-avail-text"></span>
|
||||
<button type="button" class="btn-primary opt-spot-sell-retry-btn" id="opt-spot-sell-retry-btn">重试卖回 ETH</button>
|
||||
<button type="button" class="btn-primary opt-spot-sell-retry-btn" id="opt-spot-sell-retry-btn">重试卖回</button>
|
||||
</div>
|
||||
<button type="button" class="btn-secondary opt-pos-refresh-btn" id="opt-refresh-positions" title="刷新" aria-label="刷新">↻</button>
|
||||
</div>
|
||||
@@ -356,4 +356,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/options_expiry_countdown.js?v=1"></script>
|
||||
<script src="/static/options_panel.js?v=66"></script>
|
||||
<script src="/static/options_panel.js?v=67"></script>
|
||||
|
||||
Reference in New Issue
Block a user