优化组合明细页:替换变动额/偏离比例为持仓成本/持仓盈亏

This commit is contained in:
claw_bot 2026-03-10 08:43:51 +00:00
parent 221f2428cf
commit 6ab8e4b308

View File

@ -92,15 +92,15 @@
<view class="pos-bottom">
<view class="pnl-item">
<text class="pnl-label">变动额</text>
<text class="pnl-val" :class="(item.changeAmount || 0) >= 0 ? 'text-red' : 'text-green'">
{{ (item.changeAmount || 0) >= 0 ? '+' : '' }}{{ getCurrencySymbol(portfolioData.currency) }}{{ (item.changeAmount || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
<text class="pnl-label">持仓成本</text>
<text class="pnl-val">
{{ getCurrencySymbol(portfolioData.currency) }}{{ (item.averagePrice || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
</text>
</view>
<view class="pnl-item align-right">
<text class="pnl-label">偏离比例</text>
<text class="pnl-val" :class="(item.deviationRatio || 0) >= 0 ? 'text-red' : 'text-green'">
{{ (item.deviationRatio || 0) >= 0 ? '+' : '' }}{{ (item.deviationRatio || 0).toFixed(2) }}%
<text class="pnl-label">持仓盈亏</text>
<text class="pnl-val" :class="(item.profit || 0) >= 0 ? 'text-red' : 'text-green'">
{{ (item.profit || 0) >= 0 ? '+' : '' }}{{ getCurrencySymbol(portfolioData.currency) }}{{ (item.profit || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
</text>
</view>
</view>