2 Commits

Author SHA1 Message Date
84bd151431 fix: 调整免费用户权益
- 新增:不满意重新翻译、导出PDF格式
- 移除:原文译文对比查看(改为VIP专属)
2026-04-14 18:06:11 +08:00
ad4f86b507 feat: 导航栏下方添加显眼会员状态栏
- guest: 灰色提示登录注册
- free: 蓝色提示升级
- vip_basic: 绿色显示权益和到期
- vip_pro: 金色显示权益和升级提示
- vip_enterprise: 深色显示无限权益
- admin: 红色显示后台入口
2026-04-14 18:02:42 +08:00
2 changed files with 40 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ USER_LIMITS = {
"daily_translations": 10, "daily_translations": 10,
"max_pages": 50, "max_pages": 50,
"max_file_size": 30 * 1024 * 1024, # 30MB "max_file_size": 30 * 1024 * 1024, # 30MB
"features": ["basic_translate", "compare_view", "retranslate", "history"], "features": ["basic_translate", "retranslate", "export_pdf", "history"],
}, },
"vip_basic": { # 基础会员 (月付 ¥29) "vip_basic": { # 基础会员 (月付 ¥29)
"daily_translations": 50, "daily_translations": 50,

View File

@@ -37,6 +37,45 @@
</div> </div>
</nav> </nav>
<!-- 会员状态栏 -->
{% if user %}
{% if user.user_type == 'vip_enterprise' %}
<div class="alert alert-dark py-2 mb-0 text-center">
<strong>👑 企业会员</strong> |
无限翻译次数 | 到期:{{ user.membership_expire.strftime('%Y-%m-%d') if user.membership_expire else '永久' }}
</div>
{% elif user.user_type == 'vip_pro' %}
<div class="alert alert-warning py-2 mb-0 text-center">
<strong>⭐ 专业会员</strong> |
每日200次 · 最多500页 | 到期:{{ user.membership_expire.strftime('%Y-%m-%d') if user.membership_expire else '永久' }}
| <a href="/pricing" class="alert-link">升级企业会员享无限</a>
</div>
{% elif user.user_type == 'vip_basic' %}
<div class="alert alert-success py-2 mb-0 text-center">
<strong>💚 基础会员</strong> |
每日50次 · 最多100页 | 到期:{{ user.membership_expire.strftime('%Y-%m-%d') if user.membership_expire else '永久' }}
| <a href="/pricing" class="alert-link">升级享更多权益</a>
</div>
{% elif user.user_type == 'free' %}
<div class="alert alert-info py-2 mb-0 text-center">
<strong>👤 免费用户</strong> |
每日10次 · 最多50页 | <a href="/pricing" class="alert-link">升级会员解锁更多功能</a>
</div>
{% elif user.user_type == 'admin' %}
<div class="alert alert-danger py-2 mb-0 text-center">
<strong>🔧 管理员</strong> |
完整权限 | <a href="/admin" class="alert-link">进入后台管理</a>
</div>
{% endif %}
{% else %}
<div class="alert alert-secondary py-2 mb-0 text-center">
<strong>👁 访客模式</strong> |
每日仅3次 · 最多20页 · 功能受限 |
<a href="/login" class="alert-link">登录获取更多权益</a>
<a href="/register" class="alert-link">免费注册</a>
</div>
{% endif %}
<!-- 主内容 --> <!-- 主内容 -->
<main class="container my-5"> <main class="container my-5">
<!-- 用户信息卡片 --> <!-- 用户信息卡片 -->