From ccd01498970d0e81cac5c02427488b1a52b4e2da Mon Sep 17 00:00:00 2001 From: XingQue Date: Sat, 25 Jul 2026 21:08:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A5=E5=8D=95=E6=B1=A0/=E5=85=85?= =?UTF-8?q?=E5=80=BC=E8=83=8C=E6=99=AF=E6=8C=89=E4=BF=B1=E4=B9=90=E9=83=A8?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E6=9B=B4=E7=A8=B3=E5=81=A5=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=20club=5Fid=20=E4=BE=BF=E4=BA=8E=E6=8E=92?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配置型大图在已上传或路径非默认时均下发;payload 带 club_id,避免后台与小程序俱乐部不一致导致空白。 Co-authored-by: Cursor --- jituan/services/miniapp_assets.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/jituan/services/miniapp_assets.py b/jituan/services/miniapp_assets.py index 345fb0b..ef73496 100644 --- a/jituan/services/miniapp_assets.py +++ b/jituan/services/miniapp_assets.py @@ -195,13 +195,20 @@ def get_miniapp_icons_dict(club_id: str) -> dict: result = {} for key, _label in MINIAPP_ICON_META: row = rows.get(key) - if row and row.is_uploaded and (row.image_path or '').strip(): - result[key] = row.image_path.strip() + path = (row.image_path if row else '') or '' + path = path.strip() + # 已上传:必须下发(含接单池卡背景 / 充值页大图) + if row and path and row.is_uploaded: + result[key] = path continue if key in CONFIG_ONLY_DELIVERY_KEYS: + # 兼容:有非默认路径但 is_uploaded 标志异常时仍下发 + default_path = default_icon_path(key) + if row and path and path != default_path: + result[key] = path continue - if row and (row.image_path or '').strip(): - result[key] = row.image_path.strip() + if row and path: + result[key] = path else: result[key] = default_icon_path(key) return result @@ -250,6 +257,7 @@ def get_poster_payload(club_id: str) -> dict: def build_miniapp_assets_payload(request) -> dict: club_id = _display_club_id(request) return { + 'club_id': club_id, 'icons': get_miniapp_icons_dict(club_id), 'pindao': get_pindao_payload(club_id), 'poster': get_poster_payload(club_id),