Restructure live order form into labeled rows for clearer hierarchy.

Group policy selects, SL/RR fields, options, and submit so the unlabeled RR input and scrambled checkbox/price row no longer fight for space.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 09:24:17 +08:00
parent 1c2c012dd7
commit 28a329cb63
7 changed files with 160 additions and 103 deletions
+11 -5
View File
@@ -1279,6 +1279,12 @@ if(fullMarginEl){
}
const sltpModeEl = document.getElementById("sltp-mode");
function setOmFieldVisible(inputEl, show){
if(!inputEl) return;
inputEl.style.display = show ? "" : "none";
const wrap = inputEl.closest(".om-field");
if(wrap) wrap.style.display = show ? "" : "none";
}
function toggleSltpMode(){
const mode = sltpModeEl ? sltpModeEl.value : "fixed_rr";
const slEl = document.getElementById("order-sl");
@@ -1289,14 +1295,14 @@ function toggleSltpMode(){
if(!slEl || !tpEl || !slPctEl || !tpPctEl){ return; }
const pct = mode === "pct";
const fixed = mode === "fixed_rr";
slEl.style.display = pct ? "none" : "";
tpEl.style.display = (pct || fixed) ? "none" : "";
if(fixedRrEl) fixedRrEl.style.display = fixed ? "" : "none";
setOmFieldVisible(slEl, !pct);
setOmFieldVisible(tpEl, !(pct || fixed));
setOmFieldVisible(fixedRrEl, fixed);
slEl.required = !pct;
tpEl.required = !pct && !fixed;
if(fixedRrEl) fixedRrEl.required = fixed;
slPctEl.style.display = pct ? "" : "none";
tpPctEl.style.display = pct ? "" : "none";
setOmFieldVisible(slPctEl, pct);
setOmFieldVisible(tpPctEl, pct);
slPctEl.required = pct;
tpPctEl.required = pct;
refreshOrderTpPreview();