feat: 支持第三方卡券收到订单后自动核销
This commit is contained in:
@@ -46,11 +46,13 @@ const MODE_OPTIONS: Record<
|
||||
Array<{ value: VoucherConsumeMode; label: string }>
|
||||
> = {
|
||||
affiliate_dash: [
|
||||
{ value: 'after_order_received', label: '收到订单后' },
|
||||
{ value: 'after_link_generated', label: '领取链接生成后' },
|
||||
{ value: 'after_task_created', label: '履约任务创建后' },
|
||||
{ value: 'manual', label: '人工核销' },
|
||||
],
|
||||
work_order: [
|
||||
{ value: 'after_order_received', label: '收到订单后' },
|
||||
{ value: 'after_work_order_published_or_assigned', label: '发布或指派后' },
|
||||
{ value: 'after_work_order_published', label: '仅发布后' },
|
||||
{ value: 'after_work_order_assigned', label: '仅指派后' },
|
||||
@@ -58,10 +60,14 @@ const MODE_OPTIONS: Record<
|
||||
{ value: 'manual', label: '人工核销' },
|
||||
],
|
||||
manual: [
|
||||
{ value: 'after_order_received', label: '收到订单后' },
|
||||
{ value: 'after_task_created', label: '人工任务创建后' },
|
||||
{ value: 'manual', label: '人工核销' },
|
||||
],
|
||||
third_party_voucher: [{ value: 'manual', label: '未接入自动核销' }],
|
||||
third_party_voucher: [
|
||||
{ value: 'after_order_received', label: '收到订单后' },
|
||||
{ value: 'manual', label: '人工核销' },
|
||||
],
|
||||
}
|
||||
|
||||
type PolicyRow = {
|
||||
@@ -186,7 +192,6 @@ export default function VoucherConsumePolicyPanel() {
|
||||
<Switch
|
||||
size="small"
|
||||
checked={row.policy.enabled}
|
||||
disabled={row.channel === 'third_party_voucher'}
|
||||
onChange={(enabled) => updateChannel(row.provider, row.channel, { enabled })}
|
||||
/>
|
||||
),
|
||||
@@ -198,7 +203,7 @@ export default function VoucherConsumePolicyPanel() {
|
||||
<Select
|
||||
value={row.policy.mode}
|
||||
options={MODE_OPTIONS[row.channel]}
|
||||
disabled={row.channel === 'third_party_voucher' || !row.policy.enabled}
|
||||
disabled={!row.policy.enabled}
|
||||
onChange={(mode) => updateChannel(row.provider, row.channel, { mode })}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
@@ -213,7 +218,7 @@ export default function VoucherConsumePolicyPanel() {
|
||||
max={3600}
|
||||
precision={0}
|
||||
value={row.policy.delaySeconds}
|
||||
disabled={row.channel === 'third_party_voucher' || !row.policy.enabled}
|
||||
disabled={!row.policy.enabled}
|
||||
onChange={(value) =>
|
||||
updateChannel(row.provider, row.channel, {
|
||||
delaySeconds: Math.max(0, Number(value || 0)),
|
||||
|
||||
Reference in New Issue
Block a user