feat: 完善周期报告与用户行为分析

- 支持可配置周报月报模板与登录后异步补生成\n- 增加用户行为埋点和后台分析页面\n- 移除主题额度并保留实修回顾结算\n- 修复历史会话续聊上下文丢失
This commit is contained in:
2026-08-19 11:53:34 +08:00
parent 833763c461
commit efe835be81
75 changed files with 3325 additions and 578 deletions

View File

@@ -18,15 +18,13 @@ defineEmits<{
}>();
const hasEntitlement = computed(() => Boolean(props.entitlement));
const displayUsed = computed(() => props.entitlement?.monthlyTopicUsed ?? props.used);
const displayLimit = computed(() => props.entitlement?.monthlyTopicLimit ?? props.limit);
const exhausted = computed(() => displayLimit.value !== null && displayLimit.value > 0 && displayUsed.value >= displayLimit.value);
const nearLimit = computed(() => displayLimit.value !== null && displayLimit.value > 0 && displayUsed.value / displayLimit.value >= 0.8);
const title = computed(() => props.entitlement ? "本月主题使用情况" : "今日陪伴使用情况");
const displayUsed = computed(() => props.used);
const displayLimit = computed(() => props.limit);
const exhausted = computed(() => displayLimit.value > 0 && displayUsed.value >= displayLimit.value);
const title = computed(() => "今日问答使用情况");
const usageText = computed(() => {
if (displayLimit.value === null) return props.entitlement ? "本月不限" : "不限";
if (props.entitlement) return `已使用 ${displayUsed.value}/${displayLimit.value} 个主题`;
return `今日 ${displayUsed.value}/${displayLimit.value}`;
if (displayLimit.value <= 0) return "今日不可用";
return `今日 ${displayUsed.value}/${displayLimit.value} `;
});
function formatDate(value?: string | null) {
if (!value) return "";
@@ -40,8 +38,7 @@ const guidanceText = computed(() => {
if (props.entitlement?.lifecycleStatus === "expiring_7" || props.entitlement?.lifecycleStatus === "expiring_30") {
return `当前权益将于 ${formatDate(props.entitlement.expiredAt)} 到期;如需继续使用,可提前联系运营老师确认续期。`;
}
if (exhausted.value) return "本月新主题额度已用完;当前对话仍受每日聊天额度管理,如需开启新议题可联系运营老师确认权益。";
if (nearLimit.value) return "本月新主题接近上限;只有主动创建新对话才会计入新主题,继续当前对话不会重复扣减。";
if (exhausted.value) return "今日问答次数已用完,次日会自动恢复;如需继续使用,可联系运营老师确认权益。";
return "";
});
</script>