diff --git a/components/TrafficCard.vue b/components/TrafficCard.vue index 53ea746..4d37bb2 100644 --- a/components/TrafficCard.vue +++ b/components/TrafficCard.vue @@ -108,17 +108,13 @@ // 只有一个生效中的套餐 const activePackage = data.items[0]; - if (activePackage.enable_virtual_data) { - // 启用虚流量 +if (activePackage.enable_virtual_data) { usedMB.value = activePackage.virtual_used_mb || 0; - totalMB.value = activePackage.data_limit_mb || 0; - remainMB.value = activePackage.virtual_remain_mb || 0; } else { - // 未启用虚流量,使用真流量 usedMB.value = activePackage.data_usage_mb || 0; - totalMB.value = activePackage.data_limit_mb || 0; - remainMB.value = totalMB.value - usedMB.value; } + totalMB.value = activePackage.data_limit_mb || 0; + remainMB.value = totalMB.value - usedMB.value; // 将套餐信息(包括到期时间)传递给父组件 emit('packageLoaded', activePackage);