diff --git a/components/TrafficCard.vue b/components/TrafficCard.vue index 37107f9..42855ad 100644 --- a/components/TrafficCard.vue +++ b/components/TrafficCard.vue @@ -47,6 +47,8 @@ identifier: { type: String, default: '' } }); + const emit = defineEmits(['packageLoaded']); + const userStore = useUserStore(); // 流量数据 @@ -117,11 +119,15 @@ totalMB.value = activePackage.data_limit_mb || 0; remainMB.value = totalMB.value - usedMB.value; } + + // 将套餐信息(包括到期时间)传递给父组件 + emit('packageLoaded', activePackage); } else { // 没有生效中的套餐 usedMB.value = 0; totalMB.value = 0; remainMB.value = 0; + emit('packageLoaded', null); } } catch (e) { console.error('加载套餐流量数据失败', e); diff --git a/pages/auth/auth.vue b/pages/auth/auth.vue index 9c6b5da..3cfe637 100644 --- a/pages/auth/auth.vue +++ b/pages/auth/auth.vue @@ -32,7 +32,7 @@