feat: 套餐权益列表从后台UserTypeConfig动态读取

- 权益列表从数据库配置读取
- 支持按用户类型显示/状态
- 更新各等级用户权益配置
This commit is contained in:
2026-04-14 18:42:21 +08:00
parent ee5e672901
commit 1d36888488
2 changed files with 68 additions and 32 deletions

View File

@@ -49,13 +49,9 @@
<div class="price my-3">¥0<small>/永久</small></div>
<ul class="features text-start">
<li>✅ 每日翻译10次</li>
<li>✅ 单文件最大50页</li>
<li>✅ 翻译历史记录</li>
<li>✅ 不满意重新翻译</li>
<li>✅ 导出PDF格式</li>
<li class="text-muted">❌ 原文译文对比</li>
<li class="text-muted">❌ 批量翻译</li>
{% for feat in free_features %}
<li>{% if feat.has %}✅{% else %}<span class="text-muted"></span>{% endif %} {{ feat.name }}</li>
{% endfor %}
</ul>
{% if user and user.user_type in ['free', 'vip_basic', 'vip_pro', 'vip_enterprise', 'admin'] %}
@@ -89,6 +85,12 @@
<p class="text-muted">{{ plan.description }}</p>
<ul class="features text-start">
{% for feat in plan_features.get(plan.plan_key, []) %}
<li>✅ {{ feat.name }}</li>
{% endfor %}
</ul>
{% if user and user.user_type == plan.user_type_key %}
<span class="btn btn-success w-100 mt-3 disabled">当前套餐</span>
{% elif user and user.user_type in ['vip_enterprise', 'admin'] %}