refactor: 收口跨平台重复业务实现
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
import { Col, Form, Input, Row, Select, Switch, Typography } from 'antd';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
type HuyaConfigScope = 'all' | 'points';
|
||||
|
||||
interface HuyaConfigFieldsProps {
|
||||
scope?: HuyaConfigScope;
|
||||
}
|
||||
|
||||
export default function HuyaConfigFields({ scope = 'all' }: HuyaConfigFieldsProps) {
|
||||
const showAll = scope === 'all';
|
||||
return (
|
||||
<Row gutter={12}>
|
||||
{showAll && (
|
||||
<>
|
||||
<Col span={12}>
|
||||
<Form.Item label="直播间 PID" name="room_pid">
|
||||
<Input placeholder="1199650619883" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="活动 SID(兜底)" name="sid">
|
||||
<Input placeholder="优先自动发现,如 2277" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="外部活动 ID" name="outer_act_id">
|
||||
<Input placeholder="17096" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="绑定 gid" name="bind_gid">
|
||||
<Input placeholder="3203" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="绑定活动 ID" name="bind_act_id">
|
||||
<Input placeholder="9271" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="支付渠道" name="pay_channel">
|
||||
<Select options={[
|
||||
{ value: 'Weixin', label: '微信' },
|
||||
{ value: 'Zfb', label: '支付宝' },
|
||||
]} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</>
|
||||
)}
|
||||
<Col span={12}>
|
||||
<Form.Item label="积分中心 pageCode" name="points_page_code">
|
||||
<Input placeholder="heping_baodian_credit_center_page" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="积分中心 sourceId" name="points_source_id">
|
||||
<Input placeholder="yellowcarlist" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="积分中心 scene" name="points_scene">
|
||||
<Input placeholder="7" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="页签 pageId(可选)" name="points_page_id">
|
||||
<Input placeholder="自动发现,如 343" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="页签 IDs(可选)" name="points_tab_ids">
|
||||
<Input placeholder="自动拉全部,如 431,433" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{showAll && (
|
||||
<Col span={24}>
|
||||
<Form.Item
|
||||
label="兑换使用代理"
|
||||
name="exchange_use_proxy"
|
||||
getValueProps={(value) => ({
|
||||
checked: ['1', 'true', 'on', 'yes'].includes(String(value || '0').toLowerCase()),
|
||||
})}
|
||||
normalize={(checked: boolean) => (checked ? '1' : '0')}
|
||||
extra={<Text type="secondary">默认关闭;开启后仅精英宝典兑换链路使用全局代理配置</Text>}
|
||||
>
|
||||
<Switch checkedChildren="开启" unCheckedChildren="关闭" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
)}
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
type HuyaCollabSummary,
|
||||
type HuyaConfig,
|
||||
} from '../api/modules';
|
||||
import HuyaConfigFields from '../components/HuyaConfigFields';
|
||||
import HuyaCollabShopModal from '../components/HuyaCollabShopModal';
|
||||
import HuyaCollabShopPicker from '../components/HuyaCollabShopPicker';
|
||||
import HuyaCollabHomeImageUploader from '../components/HuyaCollabHomeImageUploader';
|
||||
@@ -3790,33 +3791,7 @@ export default function HuyaCollabPage() {
|
||||
description="保存后回到新建/补资料里点一次「强制刷新礼包」即可拉取最新商品;pageId 和页签 IDs 留空表示自动。"
|
||||
/>
|
||||
<Form form={pointsConfigForm} layout="vertical" disabled={pointsConfigLoading}>
|
||||
<Row gutter={12}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="pageCode" name="points_page_code">
|
||||
<Input placeholder="heping_baodian_credit_center_page" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="sourceId" name="points_source_id">
|
||||
<Input placeholder="yellowcarlist" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="scene" name="points_scene">
|
||||
<Input placeholder="7" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="pageId(可选)" name="points_page_id">
|
||||
<Input placeholder="自动发现,如 343" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="页签 IDs(可选)" name="points_tab_ids">
|
||||
<Input placeholder="自动拉全部,如 431,433" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<HuyaConfigFields scope="points" />
|
||||
</Form>
|
||||
</Space>
|
||||
</Modal>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import type { MouseEvent } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
Button, Card, Input, InputNumber, Modal, QRCode, Select, Space, Spin, Switch, Table, Tag, Tooltip, Typography,
|
||||
Button, Card, Form, Input, InputNumber, Modal, QRCode, Select, Space, Spin, Table, Tag, Tooltip, Typography,
|
||||
} from 'antd';
|
||||
import type { TableProps } from 'antd';
|
||||
import {
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
ReloadOutlined, SearchOutlined, SettingOutlined, ShoppingOutlined, StopOutlined, SwapOutlined, ZoomInOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { huyaApi, type HuyaAccountItem, type HuyaConfig, type HuyaGoodsItem, type HuyaRechargeGoodsItem, type HuyaTaskItem } from '../api/modules';
|
||||
import HuyaConfigFields from '../components/HuyaConfigFields';
|
||||
import HuyaExternalCkImportModal from '../components/HuyaExternalCkImportModal';
|
||||
import RealtimeLogPanel from '../components/RealtimeLogPanel';
|
||||
import { usePermissions } from '../hooks/usePermissions';
|
||||
@@ -27,7 +28,6 @@ const PAGE_SIZE_KEY = 'huya_elite_page_size';
|
||||
const RECHARGE_SPU_KEY = 'huya_elite_recharge_spu';
|
||||
const RECHARGE_COUNT_KEY = 'huya_elite_recharge_count';
|
||||
const ELITE_SPU_KEY = 'huya_elite_elite_spu';
|
||||
const EXCHANGE_PROXY_ENABLED_VALUES = new Set(['1', 'true', 'on', 'yes']);
|
||||
// 与后端 ELITE_HANDBOOK_SPU_IDS 对齐:精英宝典单独一块,不和其他开通商品混在一个下拉里
|
||||
const ELITE_HANDBOOK_SPU_IDS = ['hy-8328015', 'hy-5879340', 'hy-3845257', 'hy-2947756'];
|
||||
const ELITE_HANDBOOK_NAME_KEYWORD = '精英宝典';
|
||||
@@ -235,7 +235,7 @@ export default function HuyaElitePage() {
|
||||
const [zoomPayTask, setZoomPayTask] = useState<HuyaTaskItem | null>(null);
|
||||
const [ckImportOpen, setCkImportOpen] = useState(false);
|
||||
const [config, setConfig] = useState<HuyaConfig | null>(null);
|
||||
const [configDraft, setConfigDraft] = useState<HuyaConfig | null>(null);
|
||||
const [configForm] = Form.useForm<HuyaConfig>();
|
||||
const [configOpen, setConfigOpen] = useState(false);
|
||||
const [configLoading, setConfigLoading] = useState(false);
|
||||
const [configSaving, setConfigSaving] = useState(false);
|
||||
@@ -472,17 +472,26 @@ export default function HuyaElitePage() {
|
||||
const openSettings = async () => {
|
||||
if (!canConfig) return;
|
||||
setConfigOpen(true);
|
||||
if (config) { setConfigDraft({ ...config }); return; }
|
||||
setConfigLoading(true);
|
||||
try { const current = await huyaApi.getConfig(); setConfig(current); setConfigDraft({ ...current }); }
|
||||
try {
|
||||
const current = await huyaApi.getConfig();
|
||||
setConfig(current);
|
||||
configForm.setFieldsValue(current);
|
||||
}
|
||||
catch (error) { setConfigOpen(false); message.error(getErrorMessage(error)); }
|
||||
finally { setConfigLoading(false); }
|
||||
};
|
||||
|
||||
const saveConfig = async () => {
|
||||
if (!configDraft) return;
|
||||
setConfigSaving(true);
|
||||
try { const saved = await huyaApi.updateConfig(configDraft); setConfig(saved); setConfigDraft({ ...saved }); setConfigOpen(false); message.success('配置已保存'); }
|
||||
try {
|
||||
const values = await configForm.validateFields();
|
||||
const saved = await huyaApi.updateConfig(values);
|
||||
setConfig(saved);
|
||||
configForm.setFieldsValue(saved);
|
||||
setConfigOpen(false);
|
||||
message.success('配置已保存');
|
||||
}
|
||||
catch (error) { message.error(getErrorMessage(error)); } finally { setConfigSaving(false); }
|
||||
};
|
||||
|
||||
@@ -663,7 +672,6 @@ export default function HuyaElitePage() {
|
||||
|
||||
const accountsBody = <><Space style={{ marginBottom: 8, width: '100%', justifyContent: 'space-between' }} wrap><Input size="small" allowClear prefix={<SearchOutlined />} placeholder="搜索账号/昵称/游戏名/手机号" value={search} onChange={(event) => { setSearch(event.target.value); setCurrentPage(1); }} style={{ width: 240 }} /><Space><Button size="small" icon={<ImportOutlined />} onClick={() => setImportOpen(true)}>导入账号</Button>{canImport && <Button size="small" icon={<ImportOutlined />} onClick={() => setCkImportOpen(true)}>导入外部 CK</Button>}{selectedIds.length > 0 && <Button size="small" danger onClick={() => void saveAccounts(accounts.map((item) => item.id).filter((id) => !selectedIds.includes(id)))}>移出选中</Button>}{canTransferCollab && selectedIds.length === 1 && <Button size="small" icon={<SwapOutlined />} loading={transferring} onClick={() => void transferToCollab()}>转入外部单协作</Button>}</Space></Space><div className="huya-account-table"><Table rowKey="id" size="small" loading={loading} tableLayout="fixed" rowSelection={{ selectedRowKeys: selectedIds, onChange: (keys) => setSelectedIds(keys.map(Number)), preserveSelectedRowKeys: true }} columns={accountColumns} dataSource={filteredAccounts} locale={{ emptyText: '工作台暂无账号,点击右上角「导入账号」添加' }} pagination={{ current: currentPage, pageSize, total: filteredAccounts.length, showSizeChanger: true, showTotal: (total) => `共 ${total} 条`, onChange: (page, size) => { setCurrentPage(page); if (size !== pageSize) { setPageSize(size); localStorage.setItem(PAGE_SIZE_KEY, String(size)); setCurrentPage(1); } } }} scroll={{ y: 'calc(100vh - 300px)' }} onRow={(row) => ({ onClick: () => { const task = latestTask(tasks, row.id); if (!task?.result) return; if (task.task_type === 'get_bind_qr') void openQrTask(task); else if (task.task_type === 'query_exchange_records' && taskResultRecords(task).length > 0) setRecordsTask(task); else if (['create_recharge_order', 'exchange_goods'].includes(task.task_type)) openPayTasks(task.batch_id); }, onContextMenu: (event) => handleRowContextMenu(row, event), style: { cursor: 'context-menu' }, title: '右键打开账号动作' })} /></div></>;
|
||||
|
||||
const configField = (key: Exclude<keyof HuyaConfig, 'updated_at'>, label: string) => configDraft && <Space key={key} style={{ width: '100%', justifyContent: 'space-between' }}><Text>{label}</Text><Input value={configDraft[key] || ''} onChange={(event) => setConfigDraft({ ...configDraft, [key]: event.target.value })} style={{ width: 300 }} /></Space>;
|
||||
const contextMenuStyle = contextMenu ? {
|
||||
position: 'fixed' as const,
|
||||
zIndex: 1000,
|
||||
@@ -759,7 +767,7 @@ export default function HuyaElitePage() {
|
||||
</div>}
|
||||
</Modal>
|
||||
<Modal open={importOpen} title="导入精英宝典账号" onCancel={() => setImportOpen(false)} onOk={() => { void saveAccounts([...new Set([...accounts.map((item) => item.id), ...importSelected])]).then(() => { setImportSelected([]); setImportOpen(false); }).catch((error) => message.error(getErrorMessage(error))); }} okText="导入" cancelText="取消"><Input.Search allowClear placeholder="搜索账号" value={importSearch} onChange={(event) => setImportSearch(event.target.value)} style={{ marginBottom: 8 }} /><Select allowClear placeholder="标签" value={importTag || undefined} onChange={(value) => setImportTag(value || '')} options={importTags.map((tag) => ({ value: tag, label: tag }))} style={{ width: '100%', marginBottom: 8 }} /><Table rowKey="id" size="small" dataSource={pool.filter((item) => !accounts.some((current) => current.id === item.id) && (!importSearch || [item.uid, item.nickname, item.username].some((value) => String(value || '').includes(importSearch))) && (!importTag || item.tag === importTag))} columns={[{ title: '账号', render: (_value, row) => row.nickname || row.username || row.uid }, { title: '标签', dataIndex: 'tag' }]} pagination={{ pageSize: 8 }} rowSelection={{ selectedRowKeys: importSelected, onChange: (keys) => setImportSelected(keys.map(Number)) }} /></Modal>
|
||||
<Modal open={configOpen} title="精英宝典设置" onCancel={() => setConfigOpen(false)} onOk={() => void saveConfig()} confirmLoading={configSaving} okText="保存" cancelText="取消" width={560}>{configLoading ? <div style={{ padding: 24, textAlign: 'center' }}>加载中...</div> : configDraft && <Space direction="vertical" size={10} style={{ width: '100%' }}>{configField('sid', '活动 SID')}{configField('bind_act_id', '绑定活动 ID')}{configField('outer_act_id', '外部活动 ID')}{configField('bind_gid', '绑定 gid')}{configField('room_pid', '直播间 PID')}{configField('pay_channel', '支付渠道')}{configField('points_page_code', '积分中心 pageCode')}{configField('points_source_id', '积分中心 sourceId')}{configField('points_scene', '积分中心 scene')}{configField('points_page_id', '页签 pageId(可选)')}{configField('points_tab_ids', '页签 IDs(可选)')}<Space style={{ width: '100%', justifyContent: 'space-between' }} align="center"><div><Text>兑换使用代理</Text><br /><Text type="secondary">默认关闭;开启后兑换链路使用全局代理配置</Text></div><Switch checked={EXCHANGE_PROXY_ENABLED_VALUES.has(String(configDraft.exchange_use_proxy || '0').toLowerCase())} onChange={(checked) => setConfigDraft({ ...configDraft, exchange_use_proxy: checked ? '1' : '0' })} /></Space><Space style={{ width: '100%', justifyContent: 'space-between' }}><Text>空闲轮询间隔(秒)</Text><InputNumber min={5} max={60} value={refreshInterval} onChange={(value) => { const next = Math.min(60, Math.max(5, value || 15)); setRefreshInterval(next); localStorage.setItem('huya_elite_refresh_interval', String(next)); }} style={{ width: 300 }} /></Space></Space>}</Modal>
|
||||
<Modal open={configOpen} title="精英宝典设置" onCancel={() => setConfigOpen(false)} onOk={() => void saveConfig()} confirmLoading={configSaving} okText="保存" cancelText="取消" width={680}>{configLoading ? <div style={{ padding: 24, textAlign: 'center' }}>加载中...</div> : <Space direction="vertical" size={10} style={{ width: '100%' }}><Form form={configForm} layout="vertical"><HuyaConfigFields /></Form><Space style={{ width: '100%', justifyContent: 'space-between' }}><Text>空闲轮询间隔(秒)</Text><InputNumber min={5} max={60} value={refreshInterval} onChange={(value) => { const next = Math.min(60, Math.max(5, value || 15)); setRefreshInterval(next); localStorage.setItem('huya_elite_refresh_interval', String(next)); }} style={{ width: 300 }} /></Space></Space>}</Modal>
|
||||
<HuyaExternalCkImportModal open={ckImportOpen} onClose={() => setCkImportOpen(false)} tags={importTags} scope={SCOPE} onImported={(result) => { localStorage.setItem('huya_elite_workbench_account_ids', JSON.stringify(result.account_ids)); void load(); }} />
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
Button, Card, Col, DatePicker, Dropdown, Form, Input, InputNumber, Modal, QRCode, Radio, Row, Select, Space, Table, Tag, Tooltip, Typography, theme,
|
||||
Button, Card, DatePicker, Dropdown, Form, Input, InputNumber, Modal, QRCode, Radio, Select, Space, Table, Tag, Tooltip, Typography, theme,
|
||||
} from 'antd';
|
||||
import { message } from '../utils/antdMessage';
|
||||
import type { MenuProps, TableProps } from 'antd';
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
type HuyaRechargeGoodsItem,
|
||||
type HuyaTaskItem,
|
||||
} from '../api/modules';
|
||||
import HuyaConfigFields from '../components/HuyaConfigFields';
|
||||
import RealtimeLogPanel from '../components/RealtimeLogPanel';
|
||||
import { usePermissions } from '../hooks/usePermissions';
|
||||
import { useWebSocketLogs } from '../hooks/useWebSocketLogs';
|
||||
@@ -282,6 +283,7 @@ export default function HuyaTasksPage() {
|
||||
const [accounts, setAccounts] = useState<HuyaAccountItem[]>([]);
|
||||
const [tasks, setTasks] = useState<HuyaTaskItem[]>([]);
|
||||
const [goods, setGoods] = useState<HuyaGoodsItem[]>([]);
|
||||
const [goodsLoading, setGoodsLoading] = useState(false);
|
||||
const [rechargeGoods, setRechargeGoods] = useState<HuyaRechargeGoodsItem[]>([]);
|
||||
const [taskTypes, setTaskTypes] = useState<Record<string, string>>(FALLBACK_TASK_TYPES);
|
||||
const [tags, setTags] = useState<string[]>([]);
|
||||
@@ -322,6 +324,7 @@ export default function HuyaTasksPage() {
|
||||
const accountTableAreaRef = useRef<HTMLDivElement | null>(null);
|
||||
const [accountTableAreaHeight, setAccountTableAreaHeight] = useState(460);
|
||||
const tasksLoadingRef = useRef(false);
|
||||
const liveGoodsRequestId = useRef(0);
|
||||
const { logs, connected: wsConnected, connect: connectLogs } = useWebSocketLogs();
|
||||
const { can } = usePermissions();
|
||||
|
||||
@@ -403,10 +406,9 @@ export default function HuyaTasksPage() {
|
||||
const loadAll = useCallback(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const [accountResult, taskResult, goodsResult, rechargeGoodsResult, configResult, taskTypeResult, tagResult] = await Promise.allSettled([
|
||||
const [accountResult, taskResult, rechargeGoodsResult, configResult, taskTypeResult, tagResult] = await Promise.allSettled([
|
||||
huyaApi.listAccounts({ include_cookie: false }),
|
||||
huyaApi.listTasks(),
|
||||
huyaApi.listGoods(),
|
||||
huyaApi.listRechargeGoods(),
|
||||
canConfig ? huyaApi.getConfig() : Promise.resolve(null),
|
||||
huyaApi.taskTypes(),
|
||||
@@ -437,7 +439,6 @@ export default function HuyaTasksPage() {
|
||||
setBatchId(null);
|
||||
}
|
||||
}
|
||||
if (goodsResult.status === 'fulfilled') setGoods(goodsResult.value);
|
||||
if (rechargeGoodsResult.status === 'fulfilled') setRechargeGoods(rechargeGoodsResult.value);
|
||||
if (configResult.status === 'fulfilled' && configResult.value) form.setFieldsValue(configResult.value);
|
||||
if (taskTypeResult.status === 'fulfilled') setTaskTypes({ ...FALLBACK_TASK_TYPES, ...taskTypeResult.value });
|
||||
@@ -446,7 +447,6 @@ export default function HuyaTasksPage() {
|
||||
const failedLabels = [
|
||||
accountResult.status === 'rejected' ? `CK 列表: ${getErrorMessage(accountResult.reason)}` : '',
|
||||
taskResult.status === 'rejected' ? `任务记录: ${getErrorMessage(taskResult.reason)}` : '',
|
||||
goodsResult.status === 'rejected' ? `兑换商品: ${getErrorMessage(goodsResult.reason)}` : '',
|
||||
rechargeGoodsResult.status === 'rejected' ? `充值商品: ${getErrorMessage(rechargeGoodsResult.reason)}` : '',
|
||||
configResult.status === 'rejected' ? `虎牙配置: ${getErrorMessage(configResult.reason)}` : '',
|
||||
taskTypeResult.status === 'rejected' ? `任务类型: ${getErrorMessage(taskTypeResult.reason)}` : '',
|
||||
@@ -460,6 +460,38 @@ export default function HuyaTasksPage() {
|
||||
}
|
||||
}, [canConfig, form, rememberExistingPaymentQrcodes, rememberExistingQrcodes]);
|
||||
|
||||
const loadLiveGoods = useCallback(async (accountId: number | null) => {
|
||||
const requestId = ++liveGoodsRequestId.current;
|
||||
if (!accountId) {
|
||||
setGoods([]);
|
||||
setSelectedExchangeGoodsId('');
|
||||
return;
|
||||
}
|
||||
setGoodsLoading(true);
|
||||
try {
|
||||
const result = await huyaApi.listLiveGoods(accountId);
|
||||
if (liveGoodsRequestId.current !== requestId) return;
|
||||
setGoods(result);
|
||||
setSelectedExchangeGoodsId((current) => (
|
||||
result.some((item) => item.product_id === current)
|
||||
? current
|
||||
: result[0]?.product_id || ''
|
||||
));
|
||||
} catch (error) {
|
||||
if (liveGoodsRequestId.current !== requestId) return;
|
||||
setGoods([]);
|
||||
setSelectedExchangeGoodsId('');
|
||||
message.error(`实时商品加载失败:${getErrorMessage(error)}`);
|
||||
} finally {
|
||||
if (liveGoodsRequestId.current === requestId) setGoodsLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const goodsAccountId = selectedIds[0] ?? accounts[0]?.id ?? null;
|
||||
useEffect(() => {
|
||||
void loadLiveGoods(goodsAccountId);
|
||||
}, [goodsAccountId, loadLiveGoods]);
|
||||
|
||||
const loadTasks = useCallback(async () => {
|
||||
if (tasksLoadingRef.current) return;
|
||||
tasksLoadingRef.current = true;
|
||||
@@ -1716,8 +1748,9 @@ export default function HuyaTasksPage() {
|
||||
<Button
|
||||
size="small"
|
||||
icon={<ReloadOutlined />}
|
||||
onClick={() => startTask('refresh_goods')}
|
||||
disabled={!canTask || selectedIds.length === 0 || batchBusy || wsConnected}
|
||||
loading={goodsLoading}
|
||||
onClick={() => void loadLiveGoods(goodsAccountId)}
|
||||
disabled={!canTask || !goodsAccountId || goodsLoading}
|
||||
>
|
||||
刷新
|
||||
</Button>
|
||||
@@ -1738,7 +1771,9 @@ export default function HuyaTasksPage() {
|
||||
<Select
|
||||
showSearch
|
||||
allowClear
|
||||
placeholder="选择兑换商品"
|
||||
loading={goodsLoading}
|
||||
disabled={!goodsAccountId || goodsLoading}
|
||||
placeholder={goodsLoading ? '正在读取实时商品' : !goodsAccountId ? '请先选择账号' : '暂无实时商品'}
|
||||
value={selectedExchangeGoodsId || undefined}
|
||||
onChange={(value) => setSelectedExchangeGoodsId(value || '')}
|
||||
options={goodsOptions}
|
||||
@@ -1834,68 +1869,7 @@ export default function HuyaTasksPage() {
|
||||
)}
|
||||
>
|
||||
<Form form={form} layout="vertical" disabled={!canConfig}>
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="直播间 ID" name="room_pid">
|
||||
<Input placeholder="1199650619883" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="SID" name="sid">
|
||||
<Input placeholder="2203" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="兑换活动 ID" name="outer_act_id">
|
||||
<Input placeholder="9504" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="绑定 gid" name="bind_gid">
|
||||
<Input placeholder="3203" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="绑定 bActId" name="bind_act_id">
|
||||
<Input placeholder="9271" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="积分中心 pageCode" name="points_page_code">
|
||||
<Input placeholder="heping_baodian_credit_center_page" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="积分中心 sourceId" name="points_source_id">
|
||||
<Input placeholder="yellowcarlist" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="积分中心 scene" name="points_scene">
|
||||
<Input placeholder="7" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="页签 pageId(可选)" name="points_page_id">
|
||||
<Input placeholder="留空自动发现,如 343" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item label="页签 IDs(可选,逗号分隔)" name="points_tab_ids">
|
||||
<Input placeholder="留空自动拉全部,如 431,433" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item label="支付渠道" name="pay_channel">
|
||||
<Select
|
||||
options={[
|
||||
{ value: 'Weixin', label: '微信' },
|
||||
{ value: 'Zfb', label: '支付宝' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
<HuyaConfigFields />
|
||||
</Form>
|
||||
</Card>
|
||||
</Space>
|
||||
|
||||
Reference in New Issue
Block a user