fix: 接单池/充值背景按俱乐部下发更稳健,并返回 club_id 便于排查

配置型大图在已上传或路径非默认时均下发;payload 带 club_id,避免后台与小程序俱乐部不一致导致空白。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-25 21:08:05 +08:00
parent 0f7e5c503c
commit ccd0149897

View File

@@ -195,13 +195,20 @@ def get_miniapp_icons_dict(club_id: str) -> dict:
result = {} result = {}
for key, _label in MINIAPP_ICON_META: for key, _label in MINIAPP_ICON_META:
row = rows.get(key) row = rows.get(key)
if row and row.is_uploaded and (row.image_path or '').strip(): path = (row.image_path if row else '') or ''
result[key] = row.image_path.strip() path = path.strip()
# 已上传:必须下发(含接单池卡背景 / 充值页大图)
if row and path and row.is_uploaded:
result[key] = path
continue continue
if key in CONFIG_ONLY_DELIVERY_KEYS: 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 continue
if row and (row.image_path or '').strip(): if row and path:
result[key] = row.image_path.strip() result[key] = path
else: else:
result[key] = default_icon_path(key) result[key] = default_icon_path(key)
return result return result
@@ -250,6 +257,7 @@ def get_poster_payload(club_id: str) -> dict:
def build_miniapp_assets_payload(request) -> dict: def build_miniapp_assets_payload(request) -> dict:
club_id = _display_club_id(request) club_id = _display_club_id(request)
return { return {
'club_id': club_id,
'icons': get_miniapp_icons_dict(club_id), 'icons': get_miniapp_icons_dict(club_id),
'pindao': get_pindao_payload(club_id), 'pindao': get_pindao_payload(club_id),
'poster': get_poster_payload(club_id), 'poster': get_poster_payload(club_id),