功能: 接入鱼翅供应商直充渠道

This commit is contained in:
yml2213
2026-08-13 21:11:20 +08:00
parent 420ee3d95c
commit 902e669614
14 changed files with 586 additions and 15 deletions
+3
View File
@@ -354,6 +354,9 @@ export interface DouyuConfig {
xpd_act_id: string;
xpd_rid: string;
gold_pay_type: number;
gold_recharge_channel: 'wechat_qr' | 'supplier_api';
gold_api_product_id: string;
gold_api_account_template_name: string;
gift_id: string;
skin_id: string;
updated_at: string | null;
+49 -2
View File
@@ -1626,6 +1626,10 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
}, [configOpen, config]);
const payUrl = resultText(payTask?.result, 'pay_url');
const goldAmountLabel = '充值金额';
const isSupplierGoldRecharge = config?.gold_recharge_channel === 'supplier_api';
const goldRechargeChannelLabel = isSupplierGoldRecharge ? '供应商 API 直充' : '微信扫码';
const goldRechargeButtonLabel = isSupplierGoldRecharge ? 'API直充鱼翅' : '扫码充值鱼翅';
const payAccountName = payTask
? (payTask.account_nickname || payTask.account_username || payTask.account_uid || `#${payTask.account_id}`)
: '';
@@ -1785,12 +1789,14 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
<span></span>
</div>
<Space direction="vertical" style={{ width: '100%' }} size={6}>
<Tag color={isSupplierGoldRecharge ? 'green' : 'blue'}>{`当前渠道:${goldRechargeChannelLabel}`}</Tag>
<Space.Compact style={{ width: '100%' }}>
<InputNumber
size="small"
min={1}
value={goldAmount}
onChange={(v) => setGoldAmount(v || 1)}
addonBefore={goldAmountLabel}
style={{ width: '100%' }}
/>
<Button
@@ -1799,7 +1805,7 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
onClick={() => startTask('create_gold_qr')}
disabled={actionDisabled('create_gold_qr')}
>
{goldRechargeButtonLabel}
</Button>
</Space.Compact>
<InputNumber
@@ -1849,12 +1855,14 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
</div>
<Space direction="vertical" style={{ width: '100%' }} size={6}>
{renderActionButton('create_elite_qr', 'primary')}
<Tag color={isSupplierGoldRecharge ? 'green' : 'blue'}>{`当前渠道:${goldRechargeChannelLabel}`}</Tag>
<Space.Compact style={{ width: '100%' }}>
<InputNumber
size="small"
min={1}
value={goldAmount}
onChange={(v) => setGoldAmount(v || 1)}
addonBefore={goldAmountLabel}
style={{ width: '100%' }}
/>
<Button
@@ -1863,7 +1871,7 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
onClick={() => startTask('create_gold_qr')}
disabled={actionDisabled('create_gold_qr')}
>
{goldRechargeButtonLabel}
</Button>
</Space.Compact>
<Space.Compact style={{ width: '100%' }}>
@@ -2198,6 +2206,45 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
>
{configFormValues && (
<Space direction="vertical" style={{ width: '100%' }} size={8}>
{!isPeaceHandbook && (
<>
<Space style={{ width: '100%', justifyContent: 'space-between' }}>
<Text></Text>
<Select
style={{ width: 300 }}
value={configFormValues.gold_recharge_channel}
options={[
{ value: 'wechat_qr', label: '微信扫码' },
{ value: 'supplier_api', label: '供应商 API 直充' },
]}
onChange={(value) => setConfigFormValues((prev) => prev ? {
...prev,
gold_recharge_channel: value,
} : prev)}
/>
</Space>
{configFormValues.gold_recharge_channel === 'supplier_api' && (
<>
{[
{ label: '供应商商品 ID', key: 'gold_api_product_id' },
{ label: '充值账号模板名', key: 'gold_api_account_template_name' },
].map(({ label, key }) => (
<Space key={key} style={{ width: '100%', justifyContent: 'space-between' }}>
<Text>{label}</Text>
<Input
style={{ width: 300 }}
value={String(configFormValues[key as keyof DouyuConfig] ?? '')}
onChange={(e) => setConfigFormValues((prev) => prev ? {
...prev,
[key]: e.target.value,
} : prev)}
/>
</Space>
))}
</>
)}
</>
)}
{(isPeaceHandbook ? [
{ label: '小店活动代号', key: 'xpd_act_alias' },
{ label: '道聚城活动 ID', key: 'xpd_act_id' },