校验核销码会先检查 余额
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"token": "rEX46KZqfspDZ5CVtDcyLuo9GF5PUqsp2TOHvLuleA3zdQev8sgLJOOHiTjxxo2NLXEm6VrxNx6i9hhEdbFJQwSI",
|
"token": "P1ifGvDcxYchECzx51cqL2TzBkntjQtRwxpetU7RDMMjsSCmC8kHU751bJ4rJMSSjQN73QveARqGLIWe078nKvnA",
|
||||||
"baseUrl": "https://123.207.217.176",
|
"baseUrl": "https://123.207.217.176",
|
||||||
"username": "17665234375",
|
"username": "17665234375",
|
||||||
"phone": "17665234375",
|
"phone": "17665234375",
|
||||||
"loggedInAt": "2026-05-02T15:19:01.258Z",
|
"loggedInAt": "2026-05-14T05:47:42.507Z",
|
||||||
"deviceId": "-",
|
"deviceId": "-",
|
||||||
"deviceType": 0
|
"deviceType": 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,14 +97,31 @@ export async function verifyKuaishouCloudClaimTicket(token, payload = {}) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedTask = await updateTask(context.task.id, {
|
const preparedFlow = normalizeKuaishouCloudFlow(nextContext.kuaishouCloudFulfillment)
|
||||||
|
if (preparedFlow.binding.prepareStatus !== 'ready' || !preparedFlow.binding.bindUrl) {
|
||||||
|
await prepareKuaishouCloudFulfillmentTask({
|
||||||
|
...context.task,
|
||||||
|
context_json: JSON.stringify(nextContext),
|
||||||
|
}, {
|
||||||
|
source: 'claim_page_ticket_verified',
|
||||||
|
actor: { source: 'claim_page' },
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
await updateTask(context.task.id, {
|
||||||
claim_token: context.claimToken.token,
|
claim_token: context.claimToken.token,
|
||||||
claim_expires_at: context.claimToken.expired_at,
|
claim_expires_at: context.claimToken.expired_at,
|
||||||
claimed_at: context.task.claimed_at || now,
|
|
||||||
context_json: JSON.stringify(nextContext),
|
context_json: JSON.stringify(nextContext),
|
||||||
last_error: '',
|
last_error: '',
|
||||||
updated_at: now,
|
updated_at: now,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context.task.claimed_at) {
|
||||||
|
await updateTask(context.task.id, {
|
||||||
|
claimed_at: now,
|
||||||
|
updated_at: now,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
await createTaskEvent(context.task.id, 'kuaishou_cloud_ticket_verified', {
|
await createTaskEvent(context.task.id, 'kuaishou_cloud_ticket_verified', {
|
||||||
ticketCodeMasked: maskCode(detailResult.eTicketId || ticketCode),
|
ticketCodeMasked: maskCode(detailResult.eTicketId || ticketCode),
|
||||||
@@ -113,14 +130,6 @@ export async function verifyKuaishouCloudClaimTicket(token, payload = {}) {
|
|||||||
goodsTitle: String(detailResult.goods?.itemTitle || '').trim(),
|
goodsTitle: String(detailResult.goods?.itemTitle || '').trim(),
|
||||||
}, now)
|
}, now)
|
||||||
|
|
||||||
const preparedFlow = normalizeKuaishouCloudFlow(nextContext.kuaishouCloudFulfillment)
|
|
||||||
if (preparedFlow.binding.prepareStatus !== 'ready' || !preparedFlow.binding.bindUrl) {
|
|
||||||
await prepareKuaishouCloudFulfillmentTask(updatedTask, {
|
|
||||||
source: 'claim_page_ticket_verified',
|
|
||||||
actor: { source: 'claim_page' },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return getClaimDetail(token, { includeQrImage: false })
|
return getClaimDetail(token, { includeQrImage: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ const task = computed(() => detail.value?.task || null)
|
|||||||
const roleName = computed(() => flow.value?.binding.roleName || flow.value?.role.name || '')
|
const roleName = computed(() => flow.value?.binding.roleName || flow.value?.role.name || '')
|
||||||
const roleId = computed(() => flow.value?.binding.roleId || flow.value?.role.rid || '')
|
const roleId = computed(() => flow.value?.binding.roleId || flow.value?.role.rid || '')
|
||||||
const isTicketVerified = computed(() => flow.value?.ticket.status === 'verified')
|
const isTicketVerified = computed(() => flow.value?.ticket.status === 'verified')
|
||||||
const isBindingPrepared = computed(() => flow.value?.binding.prepareStatus === 'ready')
|
const isBindingPrepared = computed(() => flow.value?.binding.prepareStatus === 'ready' && Boolean(String(flow.value?.binding.bindUrl || '').trim()))
|
||||||
const isBindingPreparing = computed(() => flow.value?.binding.prepareStatus === 'pending')
|
const isBindingPreparing = computed(() => flow.value?.binding.prepareStatus === 'pending')
|
||||||
|
const canEnterBindingStep = computed(() => isTicketVerified.value && isBindingPrepared.value)
|
||||||
const isRoleReady = computed(() => Boolean(roleName.value || roleId.value))
|
const isRoleReady = computed(() => Boolean(roleName.value || roleId.value))
|
||||||
const isRoleConfirmed = computed(() => String(task.value?.status || '').trim() === 'role_confirmed')
|
const isRoleConfirmed = computed(() => String(task.value?.status || '').trim() === 'role_confirmed')
|
||||||
const isDispatched = computed(() => String(flow.value?.dispatch.status || '').trim() === 'success')
|
const isDispatched = computed(() => String(flow.value?.dispatch.status || '').trim() === 'success')
|
||||||
@@ -56,7 +57,7 @@ const currentStep = computed(() => {
|
|||||||
return 3
|
return 3
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTicketVerified.value) {
|
if (canEnterBindingStep.value) {
|
||||||
return 2
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ const progressText = computed(() => {
|
|||||||
return '角色已确认,等待兑换'
|
return '角色已确认,等待兑换'
|
||||||
}
|
}
|
||||||
if (isTicketVerified.value) {
|
if (isTicketVerified.value) {
|
||||||
return isBindingPrepared.value ? '请完成扫码绑定' : '系统正在准备绑定资源'
|
return isBindingPrepared.value ? '请完成扫码绑定' : '绑定资源未准备完成,请重新验证核销码'
|
||||||
}
|
}
|
||||||
return '等待提交核销码'
|
return '等待提交核销码'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user