diff --git a/embed_templates/embed_page_fragment.html b/embed_templates/embed_page_fragment.html index 685a5f6..cfd11eb 100644 --- a/embed_templates/embed_page_fragment.html +++ b/embed_templates/embed_page_fragment.html @@ -24,6 +24,7 @@ {% elif page == 'trade' %}
+ {% if not order_popup %}

实盘下单监控

{% if focus_order_id %} @@ -32,6 +33,7 @@ 暂无持仓可放大 {% endif %}
+ {% endif %} {% include order_rule_tips_tpl %}
diff --git a/embed_templates/embed_shell.html b/embed_templates/embed_shell.html index 14b19a9..cf72e07 100644 --- a/embed_templates/embed_shell.html +++ b/embed_templates/embed_shell.html @@ -21,9 +21,10 @@ data-price-refresh-ms="{{ price_refresh_seconds * 1000 }}" > {% if order_popup %} - + {% endif %}
+ {% if not order_popup %}

{% if order_popup %}{{ exchange_display }} · 实盘下单{% else %}加密货币|交易监控 + AI复盘一体化{% endif %}

@@ -43,6 +44,7 @@
+ {% endif %} {% if not order_popup %}
- {% if include_transfer_block %} + {% if include_transfer_block and not order_popup %} {% include 'gate_transfer_block.html' %} {% endif %} @@ -124,6 +126,6 @@ {% include 'embed_boot_scripts.html' %} - + diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index 8688dba..038a3c0 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -2527,8 +2527,9 @@ button.btn-sm { } .order-popup-modal .order-popup-card { - width: min(920px, calc(100vw - 24px)); - max-height: calc(100vh - 32px); + width: min(980px, calc(100vw - 20px)); + max-width: none; + max-height: calc(100vh - 20px); display: flex; flex-direction: column; padding: 0; @@ -2536,7 +2537,7 @@ button.btn-sm { } .order-popup-head { - padding: 12px 14px; + padding: 10px 14px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; } @@ -2549,19 +2550,21 @@ button.btn-sm { .order-popup-frame-wrap { position: relative; - flex: 1; - min-height: 420px; - max-height: calc(100vh - 120px); + flex: 0 0 auto; + width: 100%; + min-height: 0; + overflow: hidden; background: #0b0d14; } .order-popup-frame { width: 100%; - height: 100%; - min-height: 420px; + height: 520px; + min-height: 0; border: 0; display: block; background: #0b0d14; + overflow: hidden; } .order-popup-loading { diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index ec29333..a6447c3 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -458,12 +458,30 @@ modal.classList.toggle("is-loading", !!loading); } + function applyOrderPopupFrameHeight(height) { + const frame = document.getElementById("order-popup-frame"); + const wrap = document.querySelector(".order-popup-frame-wrap"); + if (!frame || !wrap) return; + const maxH = Math.max(320, window.innerHeight - 96); + const h = Math.min(Math.max(Number(height) || 0, 320), maxH); + frame.style.height = h + "px"; + wrap.style.height = h + "px"; + } + + function resetOrderPopupFrameHeight() { + const frame = document.getElementById("order-popup-frame"); + const wrap = document.querySelector(".order-popup-frame-wrap"); + if (frame) frame.style.height = ""; + if (wrap) wrap.style.height = ""; + } + function closeOrderPopup() { const modal = document.getElementById("order-popup-modal"); const frame = document.getElementById("order-popup-frame"); orderPopupUrl = ""; orderPopupCtx = null; if (frame) frame.src = "about:blank"; + resetOrderPopupFrameHeight(); if (modal) { modal.classList.add("hidden"); modal.setAttribute("aria-hidden", "true"); @@ -556,7 +574,13 @@ window.__hubOrderPopupMsgBound = true; window.addEventListener("message", (ev) => { const d = ev.data; - if (!d || d.type !== "hub-order-popup-done") return; + if (!d || typeof d !== "object") return; + if (d.type === "hub-order-popup-resize") { + applyOrderPopupFrameHeight(d.height); + setOrderPopupLoading(false); + return; + } + if (d.type !== "hub-order-popup-done") return; refreshMonitorBoardNow(); showToast( d.message || (d.ok ? "开仓请求已提交,请查看监控区" : "开仓提交可能失败,请查看表单提示"), diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index 2cde47c..5bbd9de 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -1016,7 +1016,7 @@ 加载实例下单页…
- + diff --git a/static/embed_order_popup.css b/static/embed_order_popup.css index d895947..72bdbf8 100644 --- a/static/embed_order_popup.css +++ b/static/embed_order_popup.css @@ -1,24 +1,14 @@ -/* 中控弹窗 iframe:仅保留实盘下单表单区 */ +/* 中控弹窗 iframe:紧凑表单,无内部滚动条 */ +html:has(body[data-order-popup="1"]), body[data-order-popup="1"] { - overflow-x: hidden; + overflow: hidden !important; + height: auto !important; } body[data-order-popup="1"] .container.embed-order-popup-shell { max-width: 100%; - padding: 10px 12px 16px; -} - -body[data-order-popup="1"] .embed-order-popup-head { - margin-bottom: 8px; -} - -body[data-order-popup="1"] .embed-order-popup-head h1 { - font-size: 1rem; - margin: 0; -} - -body[data-order-popup="1"] .header-row { - margin-top: 6px; + padding: 8px 10px 10px; + overflow: hidden; } body[data-order-popup="1"] .embed-order-popup-hide { @@ -32,12 +22,35 @@ body[data-order-popup="1"] .order-popup-trade-grid { body[data-order-popup="1"] .order-popup-form-card { margin: 0; + padding: 10px 12px 12px; } -body[data-order-popup="1"] .order-popup-form-card h2 { - font-size: 0.95rem; +body[data-order-popup="1"] .order-popup-form-card .tip-collapse { + margin-bottom: 4px; } -body[data-order-popup="1"] .order-popup-form-card > div:first-child span.btn-del { - display: none; +body[data-order-popup="1"] .order-popup-form-card .tip-collapse-summary { + padding: 6px 8px; + font-size: 12px; +} + +body[data-order-popup="1"] #add-order-form { + gap: 6px 8px; + flex-wrap: wrap; + align-items: center; +} + +body[data-order-popup="1"] #add-order-form input, +body[data-order-popup="1"] #add-order-form select, +body[data-order-popup="1"] #add-order-form button[type="submit"] { + max-width: 100%; +} + +body[data-order-popup="1"] #add-order-form label, +body[data-order-popup="1"] #add-order-form > span { + font-size: 0.78rem !important; +} + +body[data-order-popup="1"] .order-plan-preview-bar { + margin-top: 8px; } diff --git a/static/instance_embed.js b/static/instance_embed.js index 26d04a3..a1a8af1 100644 --- a/static/instance_embed.js +++ b/static/instance_embed.js @@ -35,6 +35,22 @@ } catch (_) {} } + function reportOrderPopupSize() { + if (!isOrderPopup()) return; + const root = document.querySelector(".embed-order-popup-shell") || document.body; + const h = Math.ceil( + Math.max( + root.scrollHeight, + root.offsetHeight, + document.documentElement.scrollHeight, + document.body.scrollHeight + ) + ); + try { + window.parent.postMessage({ type: "hub-order-popup-resize", height: h }, "*"); + } catch (_) {} + } + function prefillOrderSymbolFromQuery() { if (!isOrderPopup()) return; let sym = ""; @@ -109,6 +125,7 @@ if (typeof global.refreshPriceSnapshotConditional === "function") { global.refreshPriceSnapshotConditional(); } + reportOrderPopupSize(); } function injectFragment(html) { @@ -280,6 +297,17 @@ patchHardNavigations(); bindNav(); runPageInit(getTab()); + reportOrderPopupSize(); + if (isOrderPopup()) { + window.setTimeout(reportOrderPopupSize, 120); + window.setTimeout(reportOrderPopupSize, 450); + if (typeof ResizeObserver !== "undefined") { + const root = document.querySelector(".embed-order-popup-shell") || document.body; + try { + new ResizeObserver(() => reportOrderPopupSize()).observe(root); + } catch (_) {} + } + } try { window.parent.postMessage({ type: "instance-frame-ready" }, "*"); } catch (_) {}