This commit is contained in:
薇薇安 2026-02-08 20:38:12 +08:00
parent ecb4b9fc2f
commit 79adc79f98

View File

@ -728,7 +728,8 @@ const StatsDashboard = () => {
<div className="entry-time">开仓时间: {formatEntryTime(trade.entry_time)}</div> <div className="entry-time">开仓时间: {formatEntryTime(trade.entry_time)}</div>
)} )}
</div> </div>
<div className="stop-take-info"> <div className="trade-protection-col">
<div className="stop-take-info">
<div className="stop-loss-info"> <div className="stop-loss-info">
止损: <span className="negative">-{stopLossPercent.toFixed(2)}%</span> 止损: <span className="negative">-{stopLossPercent.toFixed(2)}%</span>
<span className="stop-note">(of margin)</span> <span className="stop-note">(of margin)</span>
@ -753,23 +754,39 @@ const StatsDashboard = () => {
)} )}
</div> </div>
{/* 显示币安实际挂单信息 */} {/* 显示币安实际挂单信息 (优化版) */}
{trade.open_orders && trade.open_orders.length > 0 && ( {trade.open_orders && trade.open_orders.length > 0 && (
<div className="open-orders-info" style={{ marginTop: '8px', borderTop: '1px dashed #eee', paddingTop: '6px' }}> <div className="open-orders-compact">
<div style={{ fontSize: '12px', color: '#666', marginBottom: '4px', fontWeight: 'bold' }}>条件单 (Binance):</div> <div className="open-orders-label">
{trade.open_orders.map(order => ( <span>Binance 挂单</span>
<div key={order.orderId} style={{ display: 'flex', justifyContent: 'space-between', fontSize: '12px', marginBottom: '4px', paddingLeft: '8px' }}> <span style={{fontSize: '10px', fontWeight: 'normal', color: '#adb5bd'}}>({trade.open_orders.length})</span>
<span className={order.side === 'BUY' ? 'positive' : 'negative'} style={{ fontWeight: '500' }}> </div>
{order.type.replace('_MARKET', '')} <div className="order-badges">
</span> {trade.open_orders.map(order => {
<span style={{ fontFamily: 'monospace' }}> //
{order.type.includes('STOP') ? `触发价: ${fmtPrice(order.stopPrice)}` : `价格: ${fmtPrice(order.price)}`} const isSL = order.type.includes('STOP')
</span> const isTP = order.type.includes('TAKE_PROFIT')
<span style={{ color: '#999', fontSize: '11px' }}>{order.status}</span>
</div> //
))} let typeLabel = order.type.replace('_MARKET', '')
if (isSL) typeLabel = '止损'
else if (isTP) typeLabel = '止盈'
//
const priceVal = order.stopPrice > 0 ? order.stopPrice : order.price
return (
<div key={order.orderId} className={`order-badge ${isSL ? 'sl' : isTP ? 'tp' : 'other'}`}>
<span className="badge-type">{typeLabel}</span>
<span className="badge-price">{fmtPrice(priceVal)}</span>
{order.reduceOnly && <span className="badge-tag">R</span>}
</div>
)
})}
</div>
</div> </div>
)} )}
</div>
<div className="trade-actions"> <div className="trade-actions">
<div className={`trade-pnl ${parseFloat(trade.pnl || 0) >= 0 ? 'positive' : 'negative'}`}> <div className={`trade-pnl ${parseFloat(trade.pnl || 0) >= 0 ? 'positive' : 'negative'}`}>