feat(huya): 开通支付码多选账号时每个账号各出一个码并排展示
多选账号点「生成开通支付码」只出一个码:create_planned_tasks 把 create_recharge_order 也当成单笔任务(accounts[:1]),前端本来就支持多码并排,是被后端截断的。 - 后端:create_planned_tasks 不再截断 create_recharge_order(refresh_* 仍只建一个,商品快照是全局的),N 个账号 = N 个支付码任务,各自独立下单/监听支付 - 前端:支付码任务的并发取 min(10, max(并发, 账号数)),否则超出并发的码要等前面的码付完/超时才生成 - 前端:支付弹窗改成网格并排展示多个 150px 码,标题显示待扫码数;新增「生成失败(没有二维码)」点名区和「还有 N 个账号在排队生成」提示 - 前端:去掉每个码回包就自动弹支付弹窗的行为(多选时会反复把弹窗顶到最前);不做付完自动跳转 - 测试:多账号生成支付码 → 每账号一个任务,refresh_recharge_goods 仍单任务
This commit is contained in:
@@ -523,12 +523,10 @@ def create_planned_tasks(
|
||||
batch_id = uuid.uuid4().hex[:12]
|
||||
payload = payload or {}
|
||||
accounts = db.query(HuyaAccount).filter(HuyaAccount.id.in_(account_ids)).all()
|
||||
if (
|
||||
task_type
|
||||
in {"refresh_goods", "refresh_recharge_goods", "create_recharge_order"}
|
||||
and accounts
|
||||
):
|
||||
# 全局快照和单笔支付二维码使用一个选中的 CK 即可;兑换商品需要保留多账号批量任务。
|
||||
if task_type in {"refresh_goods", "refresh_recharge_goods"} and accounts:
|
||||
# 商品快照是全局的(不分账号),一个选中的 CK 就够了。
|
||||
# 注意:create_recharge_order 不能截断 —— 一个账号一张支付码,
|
||||
# 多选时要同时生成多个码各自监听支付(前端弹窗并排展示)。
|
||||
accounts = accounts[:1]
|
||||
for account in accounts:
|
||||
db.add(
|
||||
|
||||
Reference in New Issue
Block a user