Show strategy rules in fold; larger nav; notify only when cannot open.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user