fix: remove inline estimated TP preview from fixed RR order form

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-06 00:40:16 +08:00
parent e526d6af76
commit 5137d5ed17
6 changed files with 1 additions and 61 deletions
@@ -766,20 +766,6 @@ function calcTpFromFixedRr(direction, entry, sl, rr){
return e + (e - s) * r;
}
function refreshOrderTpPreview(entryPx){
const mode = (document.getElementById("sltp-mode")||{}).value || "fixed_rr";
const preview = document.getElementById("order-tp-preview");
if(!preview) return;
if(mode !== "fixed_rr"){
preview.style.display = "none";
return;
}
preview.style.display = "";
const direction = (document.getElementById("order-direction")||{}).value || "long";
const sl = Number((document.getElementById("order-sl")||{}).value);
const rr = Number((document.getElementById("order-fixed-rr")||{}).value) || MANUAL_FIXED_RR_DEFAULT;
const entry = entryPx != null && Number.isFinite(Number(entryPx)) ? Number(entryPx) : sl;
const tp = calcTpFromFixedRr(direction, entry, sl, rr);
preview.textContent = tp == null ? "预估止盈:—" : ("预估止盈:" + formatPriceForInput(tp));
if(window.ManualOrderRrPreview) ManualOrderRrPreview.schedule();
}
function calcClientRr(direction, entry, sl, tp){
@@ -67,7 +67,6 @@
<span class="symbol-live-price-note">下单成交价以交易所成交回报为准</span>
<input id="order-sl" name="sl" step="any" placeholder="止损价格" required>
<input id="order-fixed-rr" name="fixed_rr" type="number" min="0.01" step="0.01" placeholder="盈亏比(默认1.5)" value="1.5" title="止盈距离=止损距离×盈亏比">
<span id="order-tp-preview" style="display:none;font-size:.8rem;color:#8fc8ff;align-self:center">预估止盈:—</span>
<input id="order-tp" name="tgt" step="any" placeholder="止盈价格" style="display:none">
<input id="order-sl-pct" name="sl_pct" type="number" min="0.01" step="0.01" placeholder="止损%" style="display:none">
<input id="order-tp-pct" name="tp_pct" type="number" min="0.01" step="0.01" placeholder="止盈%" style="display:none">