全仓复利开启时隐藏并禁用单笔预算;关闭后才显示可用打满预算。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-12 10:00:50 +08:00
parent 51e454b0f6
commit a8d6795837
9 changed files with 103 additions and 22 deletions
+14 -7
View File
@@ -286,25 +286,32 @@
const ethEl = document.getElementById("opt-eth-amount");
const hint = document.getElementById("opt-budget-full-hint");
const compoundHint = document.getElementById("opt-compound-full-hint");
const budgetWrap = document.getElementById("opt-size-mode-budget-wrap");
const compoundWrap = document.getElementById("opt-size-mode-compound-wrap");
const capEl = document.getElementById("opt-budget-full-cap");
const compoundCapLine = document.getElementById("opt-compound-cap-line");
const compoundOn = compoundFullEnabled();
if (budgetWrap) {
budgetWrap.hidden = compoundOn;
const radio = budgetWrap.querySelector('input[name="opt-size-mode"]');
if (radio) radio.disabled = compoundOn;
}
if (compoundWrap) {
compoundWrap.hidden = !compoundOn;
const radio = compoundWrap.querySelector('input[name="opt-size-mode"]');
if (radio) radio.disabled = !compoundOn;
if (!compoundOn && mode === "compound_full") {
const sheetsRadio = document.querySelector('input[name="opt-size-mode"][value="sheets"]');
if (sheetsRadio) {
sheetsRadio.checked = true;
}
}
}
if (compoundOn && mode === "budget_full") {
const compoundRadio = document.querySelector('input[name="opt-size-mode"][value="compound_full"]');
if (compoundRadio) compoundRadio.checked = true;
} else if (!compoundOn && mode === "compound_full") {
const sheetsRadio = document.querySelector('input[name="opt-size-mode"][value="sheets"]');
if (sheetsRadio) sheetsRadio.checked = true;
}
const modeNow = currentSizeMode();
if (sheetsEl) sheetsEl.style.display = modeNow === "sheets" ? "" : "none";
if (ethEl) ethEl.style.display = modeNow === "eth_amount" ? "" : "none";
if (hint) hint.style.display = modeNow === "budget_full" ? "" : "none";
if (hint) hint.style.display = modeNow === "budget_full" && !compoundOn ? "" : "none";
if (compoundHint) compoundHint.style.display = modeNow === "compound_full" && compoundOn ? "" : "none";
if (capEl && root && root.dataset.tradeBudget) {
const n = Number(root.dataset.tradeBudget);