Show strategy rules in fold; larger nav; notify only when cannot open.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 18:12:26 +08:00
parent a5945f0837
commit 71b5fcae79
6 changed files with 76 additions and 12 deletions
+2
View File
@@ -228,6 +228,8 @@ export type PlanState = {
premium_exit_multiple: number;
exit_target_usdt: number;
leverage: number;
perp_qty_eth?: number;
option_qty_eth?: number;
min_option_hours: number;
min_option_leverage: number;
atm_open_offset_enabled?: boolean;
+29 -4
View File
@@ -149,6 +149,13 @@ export default function PlanPage() {
? `权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
: `固定 ${fmt(plan?.net_profit_target ?? 15)} U`;
const phaseLabel = PHASE_ZH[plan?.phase || ""] || plan?.phase || "—";
const atmRule = plan?.atm_open_offset_enabled
? `ATM偏差≤${fmt(plan?.max_atm_open_offset ?? 3, 0)}`
: "ATM偏差关";
const exitDetail =
exitMode === "premium_multiple"
? `净盈利≥初始权利金×${fmt(plan?.premium_exit_multiple ?? 1, 2)}`
: `净盈利≥${fmt(plan?.net_profit_target ?? 15)} U`;
const expiryMs =
pos?.expiry_ms ?? expiryMsFromYmd(pos?.expiry_ymd) ?? null;
const countdown =
@@ -213,10 +220,28 @@ export default function PlanPage() {
<div className="plan-rules-fold">
<details>
<summary></summary>
<p className="meta plan-rules-body">
{String(plan?.exchange || "okx").toUpperCase()} · ETH-USDT-SWAP ·
(/) ·
</p>
<div className="plan-rules-body">
<p>
<span className="plan-rules-k"></span>
{String(plan?.exchange || "okx").toUpperCase()} · ETH-USDT-SWAP
</p>
<p>
<span className="plan-rules-k"></span>
{fmt(plan?.perp_qty_eth ?? 1, 2)} ETH / {fmt(plan?.leverage, 0)}x
· {fmt(plan?.option_qty_eth ?? 2, 2)} ETH ·
{fmt(plan?.min_option_hours, 0)}h ·
{fmt(plan?.min_option_leverage, 0)}x · {atmRule}
{plan?.skip_weekends ? " · 周末跳过开仓" : ""}
</p>
<p>
<span className="plan-rules-k"></span>
{exitDetail}
</p>
<p>
<span className="plan-rules-k"></span>
{plan?.rest_seconds ?? "—"}s ·
</p>
</div>
</details>
</div>
+25 -5
View File
@@ -149,13 +149,14 @@ input {
}
.top-nav a {
padding: 6px 10px;
padding: 8px 14px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--bg-elev);
color: var(--muted);
text-decoration: none;
font-size: 13px;
font-size: 15px;
font-weight: 600;
white-space: nowrap;
}
@@ -307,7 +308,7 @@ input {
.plan-rules-fold summary {
cursor: pointer;
color: var(--muted);
font-size: 13px;
font-size: 12px;
user-select: none;
}
@@ -317,7 +318,26 @@ input {
.plan-rules-body {
margin: 8px 0 0;
line-height: 1.45;
font-size: 11px;
line-height: 1.5;
color: var(--muted);
}
.plan-rules-body p {
margin: 0 0 4px;
}
.plan-rules-body p:last-child {
margin-bottom: 0;
}
.plan-rules-k {
display: inline-block;
min-width: 2.2em;
margin-right: 6px;
color: var(--text);
font-weight: 600;
opacity: 0.85;
}
.open-cap-row {
@@ -485,7 +505,7 @@ input {
min-height: 48px;
text-decoration: none;
color: var(--muted);
font-size: 13px;
font-size: 14px;
font-weight: 600;
border-radius: 8px;
}