2
0

feat:仪表盘无套餐时显示修改

This commit is contained in:
zhongzm
2025-02-15 15:12:03 +08:00
parent d18d8bf393
commit 97c8e41b95

View File

@@ -87,7 +87,8 @@ const baseData = ref<GaugeDisplayData[]>([
max: 100,
unit: t('page.headerbanner.money'),
description: t('page.headerbanner.monthphonebill'),
subTitle: t('page.headerbanner.deviceCount') + `: 0${t('page.headerbanner.device')}`
subTitle: t('page.headerbanner.deviceCount') + `: 0${t('page.headerbanner.device')}`,
displayValue: '-'
},
{
id: 1,
@@ -294,7 +295,7 @@ async function mockDataUpdate() {
// 更新套餐信息
packageInfo.value = {
packageName: response.packageName || t('page.headerbanner.nopackage'),
price: response.price ? formatBalance(response.price) : '-'
price: response.packageName ? formatBalance(response.price) : '-' // 有套餐时才格式化价格
};
// 更新余额和设备数据
@@ -303,7 +304,7 @@ async function mockDataUpdate() {
...baseData.value[0],
value: numBalance,
max: Math.max(numBalance, 100),
displayValue: formatBalance(response.balance),
displayValue: response.packageName ? formatBalance(response.balance) : '-',
unit: t('page.headerbanner.money'),
subTitle: t('page.headerbanner.deviceCount') + `: ${
response.packageName ? (
@@ -497,7 +498,7 @@ const getDeviceCount = (subTitle?: string, clientNumEnable?: boolean): string =>
</div>
<div class="info-item">
<span class="info-label">{{ t('page.headerbanner.price') }}</span>
<span class="info-value">¥{{ packageInfo.price || '-' }}</span>
<span class="info-value">{{ packageInfo.price === '-' ? '-' : '¥' + packageInfo.price }}</span>
</div>
<div class="info-item">
<span class="info-label">{{ t('page.headerbanner.monthflowr') }}</span>
@@ -524,7 +525,7 @@ const getDeviceCount = (subTitle?: string, clientNumEnable?: boolean): string =>
<div class="info-group">
<div class="info-item">
<span class="info-label">{{ t('page.headerbanner.Remainingcredit') }}</span>
<span class="info-value">¥{{ baseData[0].displayValue }}</span>
<span class="info-value">{{ baseData[0].displayValue === '-' ? '-' : '¥' + baseData[0].displayValue }}</span>
</div>
<div class="info-item">
<span class="info-label">{{ t('page.headerbanner.client') }}</span>