This commit is contained in:
薇薇安 2026-01-15 21:01:28 +08:00
parent f7fdc77758
commit 9442fb632b
2 changed files with 59 additions and 0 deletions

View File

@ -288,6 +288,45 @@
font-weight: 500;
}
.param-item.order-type {
grid-column: span 2;
}
.order-type-badge {
display: inline-block;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.order-type-badge.limit {
background-color: #2196F3;
color: white;
}
.order-type-badge.market {
background-color: #FF9800;
color: white;
}
.param-item.limit-price {
grid-column: span 2;
}
.limit-price-value {
display: flex;
flex-direction: column;
gap: 4px;
}
.price-diff {
font-size: 11px;
color: #666;
font-weight: normal;
font-style: italic;
}
.card-actions {
display: flex;
gap: 10px;

View File

@ -343,6 +343,26 @@ function Recommendations() {
</div>
<div className="suggested-params">
<div className="param-item order-type">
<label>订单类型:</label>
<span className={`order-type-badge ${(rec.order_type || 'LIMIT').toLowerCase()}`}>
{rec.order_type === 'LIMIT' ? '限价单' : '市价单'}
</span>
</div>
{rec.order_type === 'LIMIT' && rec.suggested_limit_price && (
<div className="param-item limit-price">
<label>建议挂单价:</label>
<span className="limit-price-value">
{parseFloat(rec.suggested_limit_price || 0).toFixed(4)} USDT
{rec.current_price && (
<span className="price-diff">
({rec.direction === 'BUY' ? '低于' : '高于'}当前价
{Math.abs(((rec.suggested_limit_price - rec.current_price) / rec.current_price) * 100).toFixed(2)}%)
</span>
)}
</span>
</div>
)}
<div className="param-item">
<label>建议止损:</label>
<span>{parseFloat(rec.suggested_stop_loss || 0).toFixed(4)}</span>