feat: 组合卡片显示今日涨跌额

- 当前估值使用组合原始币种
- 新增今日变动行(如有数据)
This commit is contained in:
claw_bot 2026-03-15 23:51:48 +00:00
parent 238d969a36
commit 8f7b64fa7f

View File

@ -113,13 +113,20 @@
<view class="card-bottom"> <view class="card-bottom">
<view class="data-col"> <view class="data-col">
<text class="data-label">当前估值</text> <text class="data-label">当前估值</text>
<text class="data-val">¥ {{ (holding.value || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</text> <text class="data-val">{{ getCurrencySymbol(holding.currency) }}{{ (holding.value || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</text>
</view> </view>
<view class="data-col align-right"> <view class="data-col align-right">
<text class="data-label">历史总变动</text> <text class="data-label">历史总变动</text>
<text class="data-val" :class="holding.returnType === 'positive' ? 'text-red' : 'text-green'">{{ (holding.returnRate || 0) >= 0 ? '+' : '' }}{{ holding.returnRate || 0 }}%</text> <text class="data-val" :class="holding.returnType === 'positive' ? 'text-red' : 'text-green'">{{ (holding.returnRate || 0) >= 0 ? '+' : '' }}{{ holding.returnRate || 0 }}%</text>
</view> </view>
</view> </view>
<view class="card-extra" v-if="holding.todayProfit">
<text class="extra-label">今日变动</text>
<text class="extra-val" :class="(holding.todayProfit || 0) >= 0 ? 'text-red' : 'text-green'">
{{ (holding.todayProfit || 0) >= 0 ? '+' : '' }}{{ getCurrencySymbol(holding.todayProfitCurrency || holding.currency) }}{{ Math.abs(holding.todayProfit || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
</text>
</view>
</view> </view>
<view style="height: 100rpx;"></view> <view style="height: 100rpx;"></view>
@ -659,4 +666,24 @@ onShow(async () => {
font-family: 'DIN Alternate', sans-serif; font-family: 'DIN Alternate', sans-serif;
color: #1F2937; color: #1F2937;
} }
.card-extra {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16rpx;
padding-top: 16rpx;
border-top: 1rpx solid #F3F4F6;
}
.extra-label {
font-size: 22rpx;
color: #9CA3AF;
}
.extra-val {
font-size: 28rpx;
font-weight: 600;
font-family: 'DIN Alternate', sans-serif;
}
</style> </style>