4 Commits

Author SHA1 Message Date
XingQue
9dbca25b4d fix: dshyhq 返回会员卡片图 card_image/card_bg
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 16:42:14 +08:00
XingQue
aaf0c95925 feat: 会员充值页卡片图与 miniapp 背景图配置 2026-07-05 16:25:42 +08:00
XingQue
3b91fb09ea merge: 合并 origin/main 视图拆分 (c5ae305) 2026-07-05 16:17:51 +08:00
XingQue
26dcbc1dc9 fix: 商家老板可绑定为其他店子客服
允许已是商家老板的用户担任其他商家子客服,禁止绑自己的店。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 20:48:12 +08:00
6 changed files with 58 additions and 0 deletions

View File

@@ -204,6 +204,8 @@ class UpdateMemberView(APIView):
'trial_days': request.data.get('trial_days'),
'trial_guanshifc': request.data.get('trial_guanshifc'),
'trial_zuzhangfc': request.data.get('trial_zuzhangfc'),
'card_image': request.data.get('card_image'),
'card_bg': request.data.get('card_bg'),
}
data, err = update_member_for_club(
request, huiyuan_id, jieshao, jiage, guanshifc, zuzhangfc, jtjieshao, extra=extra,

View File

@@ -0,0 +1,27 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jituan', '0008_dashou_exam'),
]
operations = [
migrations.AddField(
model_name='clubhuiyuanprice',
name='card_image',
field=models.CharField(
blank=True, default='', max_length=500,
verbose_name='充值页会员卡片装饰图(相对URL)',
),
),
migrations.AddField(
model_name='clubhuiyuanprice',
name='card_bg',
field=models.CharField(
blank=True, default='', max_length=500,
verbose_name='充值页会员卡片背景图(相对URL,可选)',
),
),
]

View File

@@ -111,6 +111,12 @@ class ClubHuiyuanPrice(QModel):
trial_zuzhangfc = models.DecimalField(
max_digits=10, decimal_places=2, default=Decimal('0.00'), verbose_name='体验组长分成',
)
card_image = models.CharField(
max_length=500, blank=True, default='', verbose_name='充值页会员卡片装饰图(相对URL)',
)
card_bg = models.CharField(
max_length=500, blank=True, default='', verbose_name='充值页会员卡片背景图(相对URL,可选)',
)
is_enabled = models.BooleanField(default=True)
bankuai_id = models.IntegerField(null=True, blank=True)
CreateTime = models.DateTimeField(auto_now_add=True)

View File

@@ -31,6 +31,8 @@ def _price_row_to_dict(row):
'trial_days': int(row.trial_days or 0),
'trial_guanshifc': str(row.trial_guanshifc or 0),
'trial_zuzhangfc': str(row.trial_zuzhangfc or 0),
'card_image': (row.card_image or '').strip(),
'card_bg': (row.card_bg or '').strip(),
}
@@ -211,6 +213,10 @@ def update_member_for_club(request, huiyuan_id, jieshao, jiage, guanshifc, zuzha
row.is_enabled = True
for k, v in trial_fields.items():
setattr(row, k, v)
if 'card_image' in extra:
row.card_image = (extra.get('card_image') or '').strip()
if 'card_bg' in extra:
row.card_bg = (extra.get('card_bg') or '').strip()
row.save()
if club_id == CLUB_ID_DEFAULT:

View File

@@ -26,6 +26,9 @@ MINIAPP_ICON_META = [
('merchant_refresh', '我的页-刷新'),
('fighter_recharge_member', '打手中心-会员充值横幅(左侧)'),
('fighter_recharge_deposit', '打手中心-保证金充值横幅(右侧)'),
('fighter_recharge_vip_bg', '打手会员充值页-顶部背景图'),
('fighter_deposit_bg', '打手保证金页-顶部背景图'),
('fighter_deposit_hero', '打手保证金页-卡片右侧装饰图'),
('mine_pindao', '频道入口'),
('icon_refresh', '通用刷新'),
('guanshi_poster_bg', '管事推广海报背景'),
@@ -52,6 +55,9 @@ MINIAPP_ICON_DEFAULTS['merchant_home_notice'] = 'beijing/shangjiaduan/home/notic
MINIAPP_ICON_DEFAULTS['merchant_home_stat_bg'] = 'beijing/shangjiaduan/stat_card_bg.png'
MINIAPP_ICON_DEFAULTS['fighter_recharge_member'] = f'{ICON_FOLDER}/fighter_recharge_member.png'
MINIAPP_ICON_DEFAULTS['fighter_recharge_deposit'] = f'{ICON_FOLDER}/fighter_recharge_deposit.png'
MINIAPP_ICON_DEFAULTS['fighter_recharge_vip_bg'] = f'{ICON_FOLDER}/fighter_recharge_vip_bg.png'
MINIAPP_ICON_DEFAULTS['fighter_deposit_bg'] = f'{ICON_FOLDER}/fighter_deposit_bg.png'
MINIAPP_ICON_DEFAULTS['fighter_deposit_hero'] = f'{ICON_FOLDER}/fighter_deposit_hero.png'
MINIAPP_ICON_DEFAULTS['mine_pindao'] = 'beijing/tubiao/grzx_guanzhualong.jpg'
MINIAPP_ICON_DEFAULTS['guanshi_poster_bg'] = 'beijing/haibaobeijing.jpg'
MINIAPP_ICON_DEFAULTS['zuzhang_poster_bg'] = 'beijing/zuzhangbeijing.jpg'

View File

@@ -275,6 +275,12 @@ class DashouHuiyuanList(APIView):
'huiyuan_id', 'jieshao', 'jtjieshao', 'jiage',
).order_by('jiage')
from jituan.models import ClubHuiyuanPrice
club_rows = {
r.huiyuan_id: r
for r in ClubHuiyuanPrice.query.filter(club_id=club_id, is_enabled=True)
}
huiyuan_list = []
yonghuid = request.user.UserUID
for huiyuan in huiyuan_queryset:
@@ -287,6 +293,9 @@ class DashouHuiyuanList(APIView):
trial_sellable, trial_price, trial_days = club_huiyuan_sellable(
club_id, huiyuan.huiyuan_id, is_trial=True,
)
club_row = club_rows.get(huiyuan.huiyuan_id)
card_image = (club_row.card_image or '').strip() if club_row else ''
card_bg = (club_row.card_bg or '').strip() if club_row else ''
huiyuan_list.append({
'id': huiyuan.huiyuan_id,
'mingzi': huiyuan.jieshao,
@@ -297,6 +306,8 @@ class DashouHuiyuanList(APIView):
'trial_price': format_yuan(trial_price) if trial_sellable else '0.00',
'trial_days': trial_days if trial_sellable else 0,
'can_buy_trial': bool(trial_ok and trial_sellable),
'card_image': card_image,
'card_bg': card_bg,
})
# 5. 返回数据