feat: 完成权益到期与续期闭环
This commit is contained in:
@@ -84,6 +84,14 @@ function settlementStatusLabel(status: string) {
|
||||
</nav>
|
||||
|
||||
<div v-if="activeSection === 'overview'" class="center-section">
|
||||
<aside v-if="entitlement?.lifecycleStatus === 'expired_fallback'" class="entitlement-notice expired">
|
||||
<strong>权益已平稳切换</strong>
|
||||
<span>原“{{ entitlement.previousPlanName || '专属权益' }}”已于 {{ formatDate(entitlement.previousExpiredAt) }} 到期,当前已自动切换为“{{ entitlement.name }}”。已有聊天、实修回顾和卡片记录仍会保留。</span>
|
||||
</aside>
|
||||
<aside v-else-if="entitlement?.lifecycleStatus === 'expiring_7' || entitlement?.lifecycleStatus === 'expiring_30'" class="entitlement-notice">
|
||||
<strong>权益即将到期</strong>
|
||||
<span>当前权益有效至 {{ formatDate(entitlement.expiredAt) }}。如需继续使用,可提前联系运营老师确认续期。</span>
|
||||
</aside>
|
||||
<article class="plan-card">
|
||||
<div class="section-heading">
|
||||
<PackageCheck :size="18" aria-hidden="true" />
|
||||
@@ -224,6 +232,10 @@ function settlementStatusLabel(status: string) {
|
||||
.center-tabs button { min-height: 36px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--chat-muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
|
||||
.center-tabs button[aria-selected="true"] { background: #fff; color: var(--chat-brand-dark); box-shadow: 0 3px 12px rgba(27, 68, 55, 0.08); }
|
||||
.center-section { display: grid; gap: 15px; }
|
||||
.entitlement-notice { display: grid; gap: 4px; padding: 11px 13px; border: 1px solid #e7dcb9; border-radius: 12px; background: #fffaf0; color: #735f30; }
|
||||
.entitlement-notice.expired { border-color: #e6d1cc; background: #fff7f5; color: #76504a; }
|
||||
.entitlement-notice strong { font-size: 12px; }
|
||||
.entitlement-notice span { font-size: 11px; line-height: 1.6; }
|
||||
.plan-card, .review-card, .usage-card, .compact-record, .report-record { border: 1px solid var(--chat-border); border-radius: 14px; background: #fff; }
|
||||
.plan-card { padding: 14px; background: linear-gradient(145deg, #f2f8f5, #fff); }
|
||||
.section-heading { display: flex; align-items: center; gap: 9px; color: var(--chat-brand-dark); }
|
||||
|
||||
@@ -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 "";
|
||||
|
||||
@@ -32,6 +32,10 @@ export interface UserEntitlementSummary {
|
||||
effectiveAt?: string | null;
|
||||
expiredAt?: string | null;
|
||||
source: string;
|
||||
lifecycleStatus: "active" | "long_term" | "expiring_7" | "expiring_30" | "expired_fallback" | "default" | "legacy" | string;
|
||||
daysUntilExpiry?: number | null;
|
||||
previousPlanName?: string | null;
|
||||
previousExpiredAt?: string | null;
|
||||
}
|
||||
|
||||
export interface TopicSummary {
|
||||
|
||||
Reference in New Issue
Block a user