fix: 持仓详情页显示总盈亏金额+收益率,当日盈亏金额
This commit is contained in:
parent
55d36d1c0c
commit
51309d3142
@ -22,12 +22,17 @@
|
|||||||
|
|
||||||
<view class="card-bottom">
|
<view class="card-bottom">
|
||||||
<view class="stat-item">
|
<view class="stat-item">
|
||||||
<text class="stat-label">历史变化</text>
|
<text class="stat-label">总盈亏</text>
|
||||||
<text class="stat-val" :class="(portfolioData.historicalChange || 0) >= 0 ? 'text-red' : 'text-green'">{{ (portfolioData.historicalChange || 0) >= 0 ? '+' : '' }}{{ (portfolioData.historicalChange || 0).toFixed(2) }}%</text>
|
<text class="stat-val" :class="(portfolioData.totalReturn || 0) >= 0 ? 'text-red' : 'text-green'">
|
||||||
|
{{ (portfolioData.totalReturn || 0) >= 0 ? '+' : '' }}{{ getCurrencySymbol(portfolioData.currency) }}{{ (portfolioData.totalReturn || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
|
||||||
|
<text style="font-size: 24rpx; opacity: 0.9;"> ({{ (portfolioData.historicalChange || 0) >= 0 ? '+' : '' }}{{ (portfolioData.historicalChange || 0).toFixed(2) }}%)</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="stat-item align-right">
|
<view class="stat-item align-right">
|
||||||
<text class="stat-label">日内波动</text>
|
<text class="stat-label">当日盈亏</text>
|
||||||
<text class="stat-val" :class="(portfolioData.dailyVolatility || 0) >= 0 ? 'text-red' : 'text-green'">{{ (portfolioData.dailyVolatility || 0) >= 0 ? '+' : '' }}¥{{ (portfolioData.dailyVolatility || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</text>
|
<text class="stat-val" :class="(portfolioData.todayProfit || 0) >= 0 ? 'text-red' : 'text-green'">
|
||||||
|
{{ (portfolioData.todayProfit || 0) >= 0 ? '+' : '' }}{{ getCurrencySymbol(portfolioData.currency) }}{{ (portfolioData.todayProfit || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user