diff --git a/app.py b/app.py index a1f841d..aea6239 100644 --- a/app.py +++ b/app.py @@ -206,7 +206,8 @@ def history(): @app.route('/pricing') def pricing(): """会员定价页""" - return render_template('pricing.html', plans=MEMBERSHIP_PLANS) + user = get_current_user() + return render_template('pricing.html', plans=MEMBERSHIP_PLANS, user=user) # ==================== 路由: API ==================== diff --git a/templates/pricing.html b/templates/pricing.html index 920e6ea..847a1e5 100644 --- a/templates/pricing.html +++ b/templates/pricing.html @@ -40,7 +40,13 @@
  • ❌ 批量翻译
  • + {% if user and user.user_type in ['free', 'vip_basic', 'vip_pro', 'vip_enterprise', 'admin'] %} + + {% if user.user_type == 'free' %}当前套餐{% else %}已升级{% endif %} + + {% else %} 免费注册 + {% endif %} @@ -62,7 +68,13 @@
  • ✅ 优先处理队列
  • + {% if user and user.user_type == 'vip_basic' %} + 当前套餐 + {% elif user and user.user_type in ['vip_pro', 'vip_enterprise', 'admin'] %} + 已升级 + {% else %} + {% endif %} @@ -86,7 +98,13 @@
  • ✅ 自定义术语库
  • + {% if user and user.user_type == 'vip_pro' %} + 当前套餐 + {% elif user and user.user_type in ['vip_enterprise', 'admin'] %} + 已升级 + {% else %} + {% endif %} @@ -106,7 +124,11 @@
  • ✅ API接口调用
  • + {% if user and user.user_type in ['vip_enterprise', 'admin'] %} + 当前套餐 + {% else %} + {% endif %}