feat: 完成权益到期与续期闭环
This commit is contained in:
@@ -31,7 +31,18 @@ const usageText = computed(() => {
|
||||
if (props.entitlement) return `已使用 ${displayUsed.value}/${displayLimit.value} 个主题`;
|
||||
return `今日 ${displayUsed.value}/${displayLimit.value}`;
|
||||
});
|
||||
function formatDate(value?: string | null) {
|
||||
if (!value) return "";
|
||||
const date = new Date(value);
|
||||
return Number.isNaN(date.getTime()) ? value : date.toLocaleDateString("zh-CN");
|
||||
}
|
||||
const guidanceText = computed(() => {
|
||||
if (props.entitlement?.lifecycleStatus === "expired_fallback") {
|
||||
return `原${props.entitlement.previousPlanName ? `“${props.entitlement.previousPlanName}”` : "权益"}已于 ${formatDate(props.entitlement.previousExpiredAt)} 到期,当前已自动切换为${props.entitlement.name},已有对话与回顾仍会保留。`;
|
||||
}
|
||||
if (props.entitlement?.lifecycleStatus === "expiring_7" || props.entitlement?.lifecycleStatus === "expiring_30") {
|
||||
return `当前权益将于 ${formatDate(props.entitlement.expiredAt)} 到期;如需继续使用,可提前联系运营老师确认续期。`;
|
||||
}
|
||||
if (exhausted.value) return "本月深度主题使用较多,建议先完成已有功课;如需继续高频陪伴,可联系运营老师确认权益。";
|
||||
if (nearLimit.value) return "本月深度主题接近上限,可以先沉淀已有主题,再继续新的议题。";
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user