feat: 套餐按钮根据用户会员状态显示

- 当前套餐:绿色disabled按钮
- 已升级:灰色disabled按钮
- 未登录/低等级:显示购买按钮
- pricing路由传递user对象
This commit is contained in:
2026-04-14 18:18:42 +08:00
parent c1e929fc8a
commit bae0ba9a6d
2 changed files with 24 additions and 1 deletions

3
app.py
View File

@@ -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 ====================