功能: 接入鱼翅供应商直充渠道
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user