From 34a2fecc99f5cf67144af3b8a1aa69eac8f2be6b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 6 Jul 2026 14:55:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20from=20discount.init=20import=20bind=5Fc?= =?UTF-8?q?ustomer,=20=E7=BB=95=E8=BF=87dspy=20bare=20function=20=E6=9F=A5?= =?UTF-8?q?=E6=89=BE=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/promote/index.dspy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wwwroot/promote/index.dspy b/wwwroot/promote/index.dspy index 5b9f211..05fc208 100644 --- a/wwwroot/promote/index.dspy +++ b/wwwroot/promote/index.dspy @@ -2,13 +2,14 @@ # 参数: code=促销码id 或 id=discount_qr id # 已登录: 直接绑定; 未登录: 提示登录/注册 +from discount.init import bind_customer, set_promote_discount + code = params_kw.get('code', '') qr_id = params_kw.get('id', '') user = await get_user() if not user: - # 未登录 - 显示登录/注册引导 back_url = '' if code: back_url = entire_url('./promote/index.dspy') + f'?code={code}' @@ -54,7 +55,6 @@ if not user: ] } elif code: - # 已登录 + 促销码参数 - 绑定促销码 try: bind_params = params_kw.copy() bind_params['promo_code_id'] = code @@ -95,7 +95,6 @@ elif code: "options": {"title": "激活失败", "message": str(e), "type": "error"} } else: - # 已登录 + 折扣二维码参数 - 走旧流程 ret = await set_promote_discount(request, params_kw) result = { "widgettype": "Message",