From 3350b56f5cd1cd3412e656f23ff69b434a4df41d Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sat, 25 Jul 2026 11:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E4=BA=A4=E4=BA=92=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/backend/services/douyu_service.py | 2 +- web/frontend/src/pages/DouyuTasksPage.tsx | 183 ++++++++++++++++------ web/frontend/src/pages/HuyaTasksPage.tsx | 128 +++++++-------- 3 files changed, 197 insertions(+), 116 deletions(-) diff --git a/web/backend/services/douyu_service.py b/web/backend/services/douyu_service.py index f5af109..06c7466 100644 --- a/web/backend/services/douyu_service.py +++ b/web/backend/services/douyu_service.py @@ -24,7 +24,7 @@ SUPPORTED_DOUYU_TASK_TYPES = { "query_game_name": "一键获取游戏名", "query_change_bind_time": "一键查询换绑时间", "query_limited_goods": "一键查询限兑商品", - "query_gold_balance": "一键查询鱼刺余额", + "query_gold_balance": "一键查询鱼翅余额", "refresh_goods": "刷新商品列表", "query_exchange_records": "一键查询兑换记录", "prefetch_csrf_token": "一键获取兑换 CSRF Token", diff --git a/web/frontend/src/pages/DouyuTasksPage.tsx b/web/frontend/src/pages/DouyuTasksPage.tsx index b7968ca..f648586 100644 --- a/web/frontend/src/pages/DouyuTasksPage.tsx +++ b/web/frontend/src/pages/DouyuTasksPage.tsx @@ -38,6 +38,9 @@ const QUICK_ACTIONS = [ { key: 'donate_elite_gift', icon: }, ]; +const BIND_ACTION_KEYS = ['get_bind_qr', 'confirm_bind', 'query_game_name', 'query_change_bind_time']; +const QUERY_ACTION_KEYS = ['query_points', 'query_limited_goods', 'query_gold_balance']; + const STATUS_COLORS: Record = { planned: 'default', pending: 'default', running: 'processing', success: 'success', failed: 'error', error: 'error', stopped: 'warning', @@ -680,6 +683,48 @@ export default function DouyuTasksPage() { const payAccountName = payTask ? (payTask.account_nickname || payTask.account_username || payTask.account_uid || `#${payTask.account_id}`) : ''; + const selectedText = selectedIds.length > 0 ? `已选 ${selectedIds.length} 个账号` : '请先勾选账号'; + const actionByKey = useMemo(() => new Map(QUICK_ACTIONS.map((item) => [item.key, item])), []); + const actionDisabled = (taskType: string) => { + if (batchBusy || selectedIds.length === 0) return true; + if (taskType === 'exchange_goods') return !selectedGoodsId; + return false; + }; + const renderActionButton = (taskType: string, type: 'default' | 'primary' = 'default') => { + const item = actionByKey.get(taskType); + return ( + + ); + }; + const sectionStyle = { + border: '1px solid #f0f0f0', + borderRadius: 6, + padding: 8, + background: '#fff', + }; + const sectionTitleStyle = { + display: 'flex', + alignItems: 'center', + gap: 6, + marginBottom: 8, + fontWeight: 600, + }; + const actionGridStyle = { + display: 'grid', + gridTemplateColumns: '1fr 1fr', + gap: 6, + }; return (
@@ -765,63 +810,113 @@ export default function DouyuTasksPage() { {/* Right: operations + logs */}
- + {selectedText}} + styles={{ body: { padding: 8 } }} + > - - {selectedIds.length > 0 ? `已选 ${selectedIds.length} 个账号` : '点击/右键选择账号'} - setConcurrency(v || 1)} style={{ width: 70 }} addonBefore="并发" /> - - - {QUICK_ACTIONS.map((item) => ( - - ))} - - - + + + setConcurrency(v || 1)} + style={{ width: '100%' }} + /> + + +
+
+ + 绑定与角色 +
+
+ {BIND_ACTION_KEYS.map((key) => renderActionButton(key))} +
+
+ +
+
+ + 查询 +
+ + {QUERY_ACTION_KEYS.map((key) => renderActionButton(key))} + +
+ +
+
+ + 兑换 +
+