fix: 今日变动显示正负号; 详情页动态显示组合名称
This commit is contained in:
parent
4b2ee7038b
commit
5ef4e76053
@ -977,6 +977,12 @@ const fetchPortfolioData = async () => {
|
|||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
portfolioData.value = response.data;
|
portfolioData.value = response.data;
|
||||||
positions.value = response.data.positions || [];
|
positions.value = response.data.positions || [];
|
||||||
|
|
||||||
|
// 动态设置页面标题
|
||||||
|
if (response.data.name) {
|
||||||
|
uni.setNavigationBarTitle({ title: response.data.name });
|
||||||
|
}
|
||||||
|
|
||||||
console.log('投资组合数据获取成功:', response.data);
|
console.log('投资组合数据获取成功:', response.data);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -137,7 +137,7 @@
|
|||||||
<view class="card-extra" v-if="holding.todayProfit">
|
<view class="card-extra" v-if="holding.todayProfit">
|
||||||
<text class="extra-label">今日变动</text>
|
<text class="extra-label">今日变动</text>
|
||||||
<text class="extra-val" :class="(holding.todayProfit || 0) >= 0 ? 'text-red' : 'text-green'">
|
<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 }) }}
|
{{ (holding.todayProfit || 0) >= 0 ? '+' : '-' }}{{ getCurrencySymbol(holding.todayProfitCurrency || holding.currency) }}{{ Math.abs(holding.todayProfit || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user