95 lines
3.1 KiB
TypeScript
95 lines
3.1 KiB
TypeScript
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>
|
|
);
|
|
}
|