移除快手小店以及 api
This commit is contained in:
@@ -1088,11 +1088,11 @@ function KuaishouCloudPanel({
|
||||
const checklist = [
|
||||
{
|
||||
key: 'ticket',
|
||||
label: '核销码校验',
|
||||
label: '凭证确认',
|
||||
status: flow.ticket.status || 'pending',
|
||||
detail: flow.ticket.verifiedAt
|
||||
? `已于 ${formatAdminDateTime(flow.ticket.verifiedAt)} 校验`
|
||||
: '等待客户提交并校验核销码',
|
||||
? `已于 ${formatAdminDateTime(flow.ticket.verifiedAt)} 确认`
|
||||
: '等待电子凭证同步确认',
|
||||
},
|
||||
{
|
||||
key: 'bind',
|
||||
@@ -1129,11 +1129,11 @@ function KuaishouCloudPanel({
|
||||
},
|
||||
{
|
||||
key: 'consume',
|
||||
label: '快手核销',
|
||||
label: '电子凭证收口',
|
||||
status: flow.consume.status || 'pending',
|
||||
detail: flow.consume.consumedAt
|
||||
? `已于 ${formatAdminDateTime(flow.consume.consumedAt)} 完成核销`
|
||||
: flow.consume.errorMessage || '等待退号后核销收口',
|
||||
? `已于 ${formatAdminDateTime(flow.consume.consumedAt)} 完成收口`
|
||||
: flow.consume.errorMessage || '等待退号后收口',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from '@ant-design/icons'
|
||||
import {
|
||||
Alert,
|
||||
Avatar,
|
||||
Button,
|
||||
Card,
|
||||
Empty,
|
||||
@@ -39,20 +38,16 @@ import {
|
||||
fetchAdminCloudtentaclesAsset,
|
||||
fetchAdminCloudtentaclesSkuList,
|
||||
fetchAdminCloudtentaclesSourceConfig,
|
||||
fetchAdminKuaishouEticketSourceConfig,
|
||||
fetchAdminKuaishouFeifeiConfig,
|
||||
fetchAdminKuaishouIndustrySourceConfig,
|
||||
fetchAdminNinetyoneOrders,
|
||||
fetchAdminNotificationConfig,
|
||||
fetchAdminScheduledJobsConfig,
|
||||
matchAdminKuaishouFeifeiProduct,
|
||||
queryAdminKuaishouEticketDetail,
|
||||
queryAdminKuaishouEticketShopInfo,
|
||||
refreshAdminKuaishouIndustryAccessToken,
|
||||
retryAdminNinetyoneOrder,
|
||||
runAdminScheduledJob,
|
||||
saveAdminCloudtentaclesSourceConfig,
|
||||
saveAdminKuaishouEticketSourceConfig,
|
||||
saveAdminKuaishouFeifeiConfig,
|
||||
saveAdminKuaishouIndustrySourceConfig,
|
||||
saveAdminNotificationConfig,
|
||||
@@ -66,10 +61,6 @@ import {
|
||||
import type {
|
||||
AdminCloudtentaclesSourceConfigResponse,
|
||||
AdminCloudtentaclesSourceItem,
|
||||
AdminKuaishouEticketDetailResult,
|
||||
AdminKuaishouEticketShopConfigItem,
|
||||
AdminKuaishouEticketShopInfoResult,
|
||||
AdminKuaishouEticketSourceConfig,
|
||||
AdminKuaishouIndustryConfigResponse,
|
||||
AdminKuaishouIndustryShopConfig,
|
||||
AdminKuaishouIndustrySourceConfig,
|
||||
@@ -91,7 +82,6 @@ import { formatAdminDateTime } from '@/utils/admin-time'
|
||||
type PlatformTab =
|
||||
| 'ninetyone'
|
||||
| 'notifications'
|
||||
| 'kuaishouEticket'
|
||||
| 'kuaishouIndustry'
|
||||
| 'kuaishouFeifei'
|
||||
| 'cloudtentacles'
|
||||
@@ -119,7 +109,6 @@ type ScheduledJobsState = {
|
||||
const platformTabs: PlatformTab[] = [
|
||||
'ninetyone',
|
||||
'notifications',
|
||||
'kuaishouEticket',
|
||||
'kuaishouIndustry',
|
||||
'kuaishouFeifei',
|
||||
'cloudtentacles',
|
||||
@@ -132,10 +121,6 @@ export default function AdminPlatformShopsPage() {
|
||||
const [errorMessage, setErrorMessage] = useState('')
|
||||
const [notificationConfig, setNotificationConfig] = useState<NotificationConfigResponse | null>(null)
|
||||
const [scheduledJobs, setScheduledJobs] = useState<ScheduledJobsState | null>(null)
|
||||
const [eticketConfig, setEticketConfig] = useState<{
|
||||
filePath: string
|
||||
source: AdminKuaishouEticketSourceConfig
|
||||
} | null>(null)
|
||||
const [industryConfig, setIndustryConfig] = useState<AdminKuaishouIndustryConfigResponse | null>(null)
|
||||
const [feifeiConfig, setFeifeiConfig] = useState<AdminKuaishouFeifeiConfigResponse | null>(null)
|
||||
const [cloudtentaclesConfig, setCloudtentaclesConfig] =
|
||||
@@ -159,7 +144,6 @@ export default function AdminPlatformShopsPage() {
|
||||
const [
|
||||
notificationResponse,
|
||||
scheduledJobsResponse,
|
||||
eticketResponse,
|
||||
industryResponse,
|
||||
feifeiResponse,
|
||||
cloudtentaclesResponse,
|
||||
@@ -167,7 +151,6 @@ export default function AdminPlatformShopsPage() {
|
||||
] = await Promise.all([
|
||||
fetchAdminNotificationConfig(),
|
||||
fetchAdminScheduledJobsConfig(),
|
||||
fetchAdminKuaishouEticketSourceConfig(),
|
||||
fetchAdminKuaishouIndustrySourceConfig(),
|
||||
fetchAdminKuaishouFeifeiConfig(),
|
||||
fetchAdminCloudtentaclesSourceConfig(),
|
||||
@@ -176,7 +159,6 @@ export default function AdminPlatformShopsPage() {
|
||||
|
||||
setNotificationConfig(notificationResponse.data)
|
||||
setScheduledJobs(scheduledJobsResponse.data)
|
||||
setEticketConfig(eticketResponse.data)
|
||||
setIndustryConfig(industryResponse.data)
|
||||
setFeifeiConfig(feifeiResponse.data)
|
||||
setCloudtentaclesConfig(cloudtentaclesResponse.data)
|
||||
@@ -246,18 +228,6 @@ export default function AdminPlatformShopsPage() {
|
||||
<Empty description="通知配置未加载" />
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'kuaishouEticket',
|
||||
label: '快手小店核销',
|
||||
children: eticketConfig ? (
|
||||
<KuaishouEticketPanel
|
||||
config={eticketConfig}
|
||||
onChange={setEticketConfig}
|
||||
/>
|
||||
) : (
|
||||
<Empty description="快手小店配置未加载" />
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'kuaishouIndustry',
|
||||
label: '行业电子凭证',
|
||||
@@ -838,232 +808,6 @@ function ScheduledJobCard({
|
||||
)
|
||||
}
|
||||
|
||||
function KuaishouEticketPanel({
|
||||
config,
|
||||
onChange,
|
||||
}: {
|
||||
config: { filePath: string; source: AdminKuaishouEticketSourceConfig }
|
||||
onChange: (config: { filePath: string; source: AdminKuaishouEticketSourceConfig }) => void
|
||||
}) {
|
||||
const [saving, setSaving] = useState(false)
|
||||
const [querying, setQuerying] = useState(false)
|
||||
const [selectedShopId, setSelectedShopId] = useState(config.source.shops[0]?.shopId || '')
|
||||
const [ticketCode, setTicketCode] = useState('')
|
||||
const [shopInfoResult, setShopInfoResult] = useState<AdminKuaishouEticketShopInfoResult | null>(null)
|
||||
const [detailResult, setDetailResult] = useState<AdminKuaishouEticketDetailResult | null>(null)
|
||||
const source = config.source
|
||||
const selectedShop = source.shops.find((shop) => shop.shopId === selectedShopId) || source.shops[0] || null
|
||||
|
||||
async function saveConfig() {
|
||||
setSaving(true)
|
||||
try {
|
||||
const response = await saveAdminKuaishouEticketSourceConfig(source)
|
||||
onChange(response.data)
|
||||
showSuccess('快手小店核销配置已保存')
|
||||
} catch (error) {
|
||||
showError(error instanceof Error ? error.message : '保存快手小店核销配置失败')
|
||||
} finally {
|
||||
setSaving(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function queryShopInfo(shop = selectedShop) {
|
||||
if (!shop?.cookie) {
|
||||
showError('请先选择并填写店铺 Cookie')
|
||||
return
|
||||
}
|
||||
|
||||
setQuerying(true)
|
||||
try {
|
||||
const response = await queryAdminKuaishouEticketShopInfo({
|
||||
baseUrl: source.baseUrl,
|
||||
shopId: shop.shopId,
|
||||
cookie: shop.cookie,
|
||||
})
|
||||
setShopInfoResult(response.data)
|
||||
updateShop(shop.shopId, {
|
||||
shopId: response.data.shop.shopId || shop.shopId,
|
||||
kshopName: response.data.shop.kshopName || shop.kshopName,
|
||||
userAvatar: response.data.shop.userAvatar || shop.userAvatar,
|
||||
})
|
||||
showSuccess(`已识别店铺:${response.data.shop.kshopName || response.data.shop.shopId}`)
|
||||
} catch (error) {
|
||||
showError(error instanceof Error ? error.message : '读取快手小店店铺信息失败')
|
||||
} finally {
|
||||
setQuerying(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function queryDetail() {
|
||||
if (!selectedShop?.cookie) {
|
||||
showError('请先选择并填写店铺 Cookie')
|
||||
return
|
||||
}
|
||||
if (!ticketCode.trim()) {
|
||||
showError('请输入查询券码')
|
||||
return
|
||||
}
|
||||
|
||||
setQuerying(true)
|
||||
try {
|
||||
const response = await queryAdminKuaishouEticketDetail({
|
||||
baseUrl: source.baseUrl,
|
||||
shopId: selectedShop.shopId,
|
||||
cookie: selectedShop.cookie,
|
||||
eTicketId: ticketCode.trim(),
|
||||
})
|
||||
setDetailResult(response.data)
|
||||
showSuccess('核销券详情查询完成')
|
||||
} catch (error) {
|
||||
showError(error instanceof Error ? error.message : '查询核销券详情失败')
|
||||
} finally {
|
||||
setQuerying(false)
|
||||
}
|
||||
}
|
||||
|
||||
function updateSource(nextSource: AdminKuaishouEticketSourceConfig) {
|
||||
onChange({ ...config, source: nextSource })
|
||||
}
|
||||
|
||||
function updateShop(shopId: string, patch: Partial<AdminKuaishouEticketShopConfigItem>) {
|
||||
updateSource({
|
||||
...source,
|
||||
shops: source.shops.map((shop) => (shop.shopId === shopId ? { ...shop, ...patch } : shop)),
|
||||
})
|
||||
}
|
||||
|
||||
function addShop() {
|
||||
const shopId = `shop_${Date.now()}`
|
||||
updateSource({
|
||||
...source,
|
||||
shops: [
|
||||
...source.shops,
|
||||
{
|
||||
shopId,
|
||||
kshopName: '',
|
||||
cookie: '',
|
||||
cookieMasked: '',
|
||||
hasCookie: false,
|
||||
userAvatar: '',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
setSelectedShopId(shopId)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="platform-panel-stack">
|
||||
<Card
|
||||
title="快手小店核销源"
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Typography.Text type="secondary">{config.filePath || '默认配置'}</Typography.Text>
|
||||
<Button type="primary" icon={<SaveOutlined />} loading={saving} onClick={saveConfig}>
|
||||
保存配置
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<div className="platform-form-grid">
|
||||
<FieldSwitch
|
||||
label="启用"
|
||||
checked={source.enabled}
|
||||
onChange={(enabled) => updateSource({ ...source, enabled })}
|
||||
/>
|
||||
<div>
|
||||
<Typography.Text type="secondary">接口地址</Typography.Text>
|
||||
<Input
|
||||
value={source.baseUrl}
|
||||
onChange={(event) => updateSource({ ...source, baseUrl: event.target.value })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Card size="small" title="店铺凭据" className="platform-section-gap" extra={<Button icon={<PlusOutlined />} onClick={addShop}>新增店铺</Button>}>
|
||||
{source.shops.length === 0 ? (
|
||||
<Empty description="暂无店铺配置" />
|
||||
) : (
|
||||
<Space direction="vertical" className="full-width" size={12}>
|
||||
{source.shops.map((shop) => (
|
||||
<div key={shop.shopId} className="platform-shop-row">
|
||||
<Switch checked={shop.enabled !== false} onChange={(enabled) => updateShop(shop.shopId, { enabled })} />
|
||||
<Avatar src={shop.userAvatar}>{shop.kshopName?.slice(0, 1) || '店'}</Avatar>
|
||||
<Input
|
||||
value={shop.shopId}
|
||||
placeholder="shopId"
|
||||
onChange={(event) => updateShop(shop.shopId, { shopId: event.target.value })}
|
||||
onFocus={() => setSelectedShopId(shop.shopId)}
|
||||
/>
|
||||
<Input
|
||||
value={shop.kshopName}
|
||||
placeholder="店铺名称"
|
||||
onChange={(event) => updateShop(shop.shopId, { kshopName: event.target.value })}
|
||||
/>
|
||||
<Input.Password
|
||||
value={shop.cookie}
|
||||
placeholder={shop.cookieMasked || 'Cookie'}
|
||||
onChange={(event) =>
|
||||
updateShop(shop.shopId, {
|
||||
cookie: event.target.value,
|
||||
hasCookie: Boolean(event.target.value.trim()),
|
||||
})
|
||||
}
|
||||
/>
|
||||
<Button loading={querying && selectedShopId === shop.shopId} onClick={() => queryShopInfo(shop)}>
|
||||
识别
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
onClick={() =>
|
||||
updateSource({
|
||||
...source,
|
||||
shops: source.shops.filter((item) => item.shopId !== shop.shopId),
|
||||
})
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</Space>
|
||||
)}
|
||||
</Card>
|
||||
</Card>
|
||||
|
||||
<Card title="核销调试">
|
||||
<Space wrap className="full-width">
|
||||
<Select
|
||||
value={selectedShop?.shopId}
|
||||
style={{ minWidth: 220 }}
|
||||
placeholder="选择店铺"
|
||||
options={source.shops.map((shop) => ({
|
||||
label: shop.kshopName || shop.shopId,
|
||||
value: shop.shopId,
|
||||
}))}
|
||||
onChange={setSelectedShopId}
|
||||
/>
|
||||
<Input
|
||||
value={ticketCode}
|
||||
placeholder="券码 / eTicketId"
|
||||
style={{ width: 260 }}
|
||||
onChange={(event) => setTicketCode(event.target.value)}
|
||||
onPressEnter={queryDetail}
|
||||
/>
|
||||
<Button icon={<SearchOutlined />} loading={querying} onClick={queryDetail}>
|
||||
查询详情
|
||||
</Button>
|
||||
</Space>
|
||||
|
||||
{shopInfoResult || detailResult ? (
|
||||
<pre className="json-preview platform-section-gap">
|
||||
{JSON.stringify(detailResult || shopInfoResult, null, 2)}
|
||||
</pre>
|
||||
) : null}
|
||||
</Card>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function KuaishouIndustryPanel({
|
||||
config,
|
||||
onChange,
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
import {
|
||||
CheckCircleOutlined,
|
||||
ClockCircleOutlined,
|
||||
ExclamationCircleOutlined,
|
||||
LinkOutlined,
|
||||
LoadingOutlined,
|
||||
ReloadOutlined,
|
||||
SendOutlined,
|
||||
SwapOutlined,
|
||||
} from '@ant-design/icons'
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
Card,
|
||||
Collapse,
|
||||
Empty,
|
||||
Image,
|
||||
Input,
|
||||
Space,
|
||||
Spin,
|
||||
Tooltip,
|
||||
@@ -39,7 +34,6 @@ import {
|
||||
fetchClaimDetail,
|
||||
rebindKuaishouCloudClaimRole,
|
||||
redeemKuaishouCloudClaim,
|
||||
verifyKuaishouCloudClaimTicket,
|
||||
} from '@/services/claim'
|
||||
import type {
|
||||
ClaimDetailData,
|
||||
@@ -66,14 +60,12 @@ export default function ClaimPage() {
|
||||
const token = String(routeToken || '').trim()
|
||||
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [submitting, setSubmitting] = useState(false)
|
||||
const [refreshingRole, setRefreshingRole] = useState(false)
|
||||
const [confirmingRole, setConfirmingRole] = useState(false)
|
||||
const [rebindingRole, setRebindingRole] = useState(false)
|
||||
const [redeeming, setRedeeming] = useState(false)
|
||||
const [errorMessage, setErrorMessage] = useState('')
|
||||
const [detail, setDetail] = useState<ClaimDetailData | null>(null)
|
||||
const [ticketCode, setTicketCode] = useState('')
|
||||
const [qrCodeDataUrl, setQrCodeDataUrl] = useState('')
|
||||
|
||||
const pollTimerRef = useRef<number>(0)
|
||||
@@ -117,7 +109,6 @@ export default function ClaimPage() {
|
||||
const applyDetail = useCallback(
|
||||
async (nextDetail: ClaimDetailData) => {
|
||||
setDetail(nextDetail)
|
||||
setTicketCode((current) => current || nextDetail.kuaishouCloudFulfillment?.ticket.code || '')
|
||||
await generateQRCode(
|
||||
String(nextDetail.kuaishouCloudFulfillment?.binding.bindUrl || '').trim(),
|
||||
)
|
||||
@@ -208,7 +199,6 @@ export default function ClaimPage() {
|
||||
rolePollBaselineAtRef.current = 0
|
||||
rolePollBaselineKeyRef.current = ''
|
||||
setDetail(null)
|
||||
setTicketCode('')
|
||||
setQrCodeDataUrl('')
|
||||
void loadDetail()
|
||||
|
||||
@@ -234,27 +224,6 @@ export default function ClaimPage() {
|
||||
}
|
||||
}, [loadDetail, resolveNextPollDelay, snapshot, stopPolling])
|
||||
|
||||
async function submitTicket() {
|
||||
const normalizedTicketCode = ticketCode.trim()
|
||||
if (!normalizedTicketCode) {
|
||||
showError('请输入核销码')
|
||||
return
|
||||
}
|
||||
|
||||
setSubmitting(true)
|
||||
try {
|
||||
const response = await verifyKuaishouCloudClaimTicket(token, {
|
||||
ticketCode: normalizedTicketCode,
|
||||
})
|
||||
await applyDetail(response.data)
|
||||
showSuccess('核销已完成,系统已开始准备绑定资源')
|
||||
} catch (error) {
|
||||
showError(error instanceof Error ? error.message : '核销码验证失败')
|
||||
} finally {
|
||||
setSubmitting(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshRole() {
|
||||
setRefreshingRole(true)
|
||||
try {
|
||||
@@ -318,7 +287,7 @@ export default function ClaimPage() {
|
||||
async function rebindRole() {
|
||||
try {
|
||||
await showConfirm(
|
||||
'换绑后当前绑定链接会失效,系统会退还当前虚拟号并生成新的绑定二维码。核销码和领取商品不会改变,但需要重新扫码绑定角色。',
|
||||
'换绑后当前绑定链接会失效,系统会退还当前虚拟号并生成新的绑定二维码。领取商品不会改变,但需要重新扫码绑定角色。',
|
||||
'确认换绑角色',
|
||||
{
|
||||
okText: '确认换绑',
|
||||
@@ -407,15 +376,11 @@ export default function ClaimPage() {
|
||||
) : detail && snapshot.flow ? (
|
||||
<KuaishouCloudClaimSteps
|
||||
snapshot={snapshot}
|
||||
ticketCode={ticketCode}
|
||||
qrCodeDataUrl={qrCodeDataUrl}
|
||||
submitting={submitting}
|
||||
refreshingRole={refreshingRole}
|
||||
confirmingRole={confirmingRole}
|
||||
rebindingRole={rebindingRole}
|
||||
redeeming={redeeming}
|
||||
onTicketCodeChange={setTicketCode}
|
||||
onSubmitTicket={submitTicket}
|
||||
onOpenBindUrl={openBindUrl}
|
||||
onRefreshRole={refreshRole}
|
||||
onRebindRole={rebindRole}
|
||||
@@ -474,8 +439,6 @@ function createClaimSnapshot(
|
||||
String(flow?.dispatch.status || '').trim() === 'failed'
|
||||
const isCompleted = isKuaishouCloudCompletedStatus(task?.status)
|
||||
const hasRedeemResult = isDispatched || hasKuaishouCloudRedeemResultStatus(task?.status)
|
||||
const canSubmitTicket = !isClaimInactiveTaskStatus(task?.status)
|
||||
|
||||
const currentStep = resolveCurrentStep({
|
||||
isFeifeiFlow,
|
||||
isCompleted,
|
||||
@@ -524,7 +487,6 @@ function createClaimSnapshot(
|
||||
isRedeemFailed,
|
||||
isCompleted,
|
||||
hasRedeemResult,
|
||||
canSubmitTicket,
|
||||
currentStep,
|
||||
progressText,
|
||||
resultTitle,
|
||||
@@ -691,15 +653,11 @@ function ClaimHeaderCard({
|
||||
|
||||
function KuaishouCloudClaimSteps({
|
||||
snapshot,
|
||||
ticketCode,
|
||||
qrCodeDataUrl,
|
||||
submitting,
|
||||
refreshingRole,
|
||||
confirmingRole,
|
||||
rebindingRole,
|
||||
redeeming,
|
||||
onTicketCodeChange,
|
||||
onSubmitTicket,
|
||||
onOpenBindUrl,
|
||||
onRefreshRole,
|
||||
onRebindRole,
|
||||
@@ -707,15 +665,11 @@ function KuaishouCloudClaimSteps({
|
||||
onConfirmRedeem,
|
||||
}: {
|
||||
snapshot: ClaimSnapshot
|
||||
ticketCode: string
|
||||
qrCodeDataUrl: string
|
||||
submitting: boolean
|
||||
refreshingRole: boolean
|
||||
confirmingRole: boolean
|
||||
rebindingRole: boolean
|
||||
redeeming: boolean
|
||||
onTicketCodeChange: (value: string) => void
|
||||
onSubmitTicket: () => void
|
||||
onOpenBindUrl: (useCurrentPage?: boolean) => void
|
||||
onRefreshRole: () => void
|
||||
onRebindRole: () => void
|
||||
@@ -727,17 +681,7 @@ function KuaishouCloudClaimSteps({
|
||||
}
|
||||
|
||||
if (snapshot.currentStep === 1) {
|
||||
return (
|
||||
<ClaimTicketStep
|
||||
ticketCode={ticketCode}
|
||||
canSubmitTicket={snapshot.canSubmitTicket && !submitting}
|
||||
submitting={submitting}
|
||||
isBindingPreparing={snapshot.isBindingPreparing}
|
||||
flow={snapshot.flow}
|
||||
onTicketCodeChange={onTicketCodeChange}
|
||||
onSubmitTicket={onSubmitTicket}
|
||||
/>
|
||||
)
|
||||
return <ClaimDeprecatedTicketStep />
|
||||
}
|
||||
|
||||
if (snapshot.currentStep === 2) {
|
||||
@@ -773,84 +717,21 @@ function KuaishouCloudClaimSteps({
|
||||
return <ClaimResultStep snapshot={snapshot} />
|
||||
}
|
||||
|
||||
function ClaimTicketStep({
|
||||
ticketCode,
|
||||
canSubmitTicket,
|
||||
submitting,
|
||||
isBindingPreparing,
|
||||
flow,
|
||||
onTicketCodeChange,
|
||||
onSubmitTicket,
|
||||
}: {
|
||||
ticketCode: string
|
||||
canSubmitTicket: boolean
|
||||
submitting: boolean
|
||||
isBindingPreparing: boolean
|
||||
flow: ClaimKuaishouCloudFlowInfo
|
||||
onTicketCodeChange: (value: string) => void
|
||||
onSubmitTicket: () => void
|
||||
}) {
|
||||
function ClaimDeprecatedTicketStep() {
|
||||
return (
|
||||
<Card className="claim-content-card">
|
||||
<Typography.Title level={2}>第 1 步:提交核销码</Typography.Title>
|
||||
<Typography.Title level={2}>旧领取流程已停用</Typography.Title>
|
||||
<p className="claim-muted">
|
||||
请您先从快手小店复制核销码。提交后会立即核销,核销成功后系统会自动准备绑定资源。
|
||||
当前订单已改用行业电子凭证方案处理,不再支持快手小店核销码提交。请联系商家确认新的领取方式。
|
||||
</p>
|
||||
|
||||
<Input
|
||||
size="large"
|
||||
value={ticketCode}
|
||||
placeholder="粘贴快手核销码"
|
||||
disabled={!canSubmitTicket}
|
||||
onChange={(event) => onTicketCodeChange(event.target.value)}
|
||||
onPressEnter={onSubmitTicket}
|
||||
/>
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
size="large"
|
||||
icon={<SendOutlined />}
|
||||
loading={submitting}
|
||||
disabled={!canSubmitTicket}
|
||||
onClick={onSubmitTicket}
|
||||
>
|
||||
提交核销码并继续
|
||||
</Button>
|
||||
|
||||
<Alert
|
||||
type="info"
|
||||
type="warning"
|
||||
showIcon
|
||||
icon={<ClockCircleOutlined />}
|
||||
message={
|
||||
isBindingPreparing
|
||||
? '核销完成后会自动准备绑定资源。'
|
||||
: '核销完成后会自动进入扫码绑定步骤。'
|
||||
}
|
||||
icon={<ExclamationCircleOutlined />}
|
||||
message="快手小店核销入口已下线"
|
||||
description="电子凭证发码、查询和核销请以新的电子凭证流程为准。"
|
||||
/>
|
||||
|
||||
{flow.guideImages.length > 0 ? (
|
||||
<Collapse
|
||||
defaultActiveKey={['guide']}
|
||||
items={[
|
||||
{
|
||||
key: 'guide',
|
||||
label: '查看核销码图文指引',
|
||||
children: (
|
||||
<Image.PreviewGroup>
|
||||
<div className="claim-guide-grid">
|
||||
{flow.guideImages.map((imageUrl, index) => (
|
||||
<figure key={imageUrl} className="claim-guide-figure">
|
||||
<Image src={imageUrl} alt={`步骤 ${index + 1}`} />
|
||||
<figcaption>步骤 {index + 1}</figcaption>
|
||||
</figure>
|
||||
))}
|
||||
</div>
|
||||
</Image.PreviewGroup>
|
||||
),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
) : null}
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export * from './notifications'
|
||||
export * from './scheduled-jobs'
|
||||
export * from './ninetyone'
|
||||
export * from './kuaishou-eticket'
|
||||
export * from './kuaishou-industry'
|
||||
export * from './kuaishou-feifei'
|
||||
export * from './cloudtentacles'
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
import { apiGet, apiPost } from '@/lib/http'
|
||||
import type {
|
||||
AdminKuaishouEticketConsumeResult,
|
||||
AdminKuaishouEticketDetailResult,
|
||||
AdminKuaishouEticketShopInfoResult,
|
||||
AdminKuaishouEticketSourceConfig,
|
||||
} from '@/types/admin'
|
||||
|
||||
export function fetchAdminKuaishouEticketSourceConfig() {
|
||||
return apiGet<{
|
||||
filePath: string
|
||||
source: AdminKuaishouEticketSourceConfig
|
||||
}>('/api/v1/admin/platform-config/kuaishou-eticket-source')
|
||||
}
|
||||
|
||||
export function saveAdminKuaishouEticketSourceConfig(payload: AdminKuaishouEticketSourceConfig) {
|
||||
return apiPost<{
|
||||
filePath: string
|
||||
source: AdminKuaishouEticketSourceConfig
|
||||
}>('/api/v1/admin/platform-config/kuaishou-eticket-source', payload)
|
||||
}
|
||||
|
||||
export function queryAdminKuaishouEticketDetail(payload: {
|
||||
baseUrl?: string
|
||||
shopId?: string
|
||||
cookie?: string
|
||||
eTicketId: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouEticketDetailResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-eticket/query-detail',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function queryAdminKuaishouEticketShopInfo(payload: {
|
||||
baseUrl?: string
|
||||
shopId?: string
|
||||
cookie?: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouEticketShopInfoResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-eticket/query-shop-info',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function consumeAdminKuaishouEticket(payload: {
|
||||
baseUrl?: string
|
||||
shopId?: string
|
||||
cookie?: string
|
||||
eTicketId: string
|
||||
oid?: string
|
||||
formToken?: string
|
||||
num?: number
|
||||
storeId?: string
|
||||
}) {
|
||||
return apiPost<AdminKuaishouEticketConsumeResult>(
|
||||
'/api/v1/admin/platform-config/kuaishou-eticket/consume',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
@@ -73,15 +73,10 @@ export function rebindAdminTaskKuaishouCloudRole(taskId: number | string) {
|
||||
)
|
||||
}
|
||||
|
||||
export function dispatchAdminTaskKuaishouCloudFulfillment(
|
||||
taskId: number | string,
|
||||
payload: {
|
||||
ticketCode?: string
|
||||
} = {},
|
||||
) {
|
||||
export function dispatchAdminTaskKuaishouCloudFulfillment(taskId: number | string) {
|
||||
return apiPost<AdminTaskActionResponse>(
|
||||
`/api/v1/admin/tasks/${taskId}/kuaishou-cloud/dispatch`,
|
||||
payload,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,15 +5,6 @@ export function fetchClaimDetail(token: string) {
|
||||
return apiGet<ClaimDetailData>(`/api/v1/claim/${token}`)
|
||||
}
|
||||
|
||||
export function verifyKuaishouCloudClaimTicket(
|
||||
token: string,
|
||||
payload: {
|
||||
ticketCode: string
|
||||
},
|
||||
) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/verify-ticket`, payload)
|
||||
}
|
||||
|
||||
export function confirmKuaishouCloudClaimRole(token: string) {
|
||||
return apiPost<ClaimDetailData>(`/api/v1/claim/${token}/kuaishou-cloud/confirm-role`, {})
|
||||
}
|
||||
|
||||
@@ -580,32 +580,6 @@ select {
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.claim-guide-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.claim-guide-figure {
|
||||
margin: 0;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.claim-guide-figure .ant-image,
|
||||
.claim-guide-figure img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.claim-guide-figure figcaption {
|
||||
padding: 10px 12px 14px;
|
||||
color: #475569;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.claim-qr-block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1209,7 +1183,6 @@ select {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.claim-guide-grid,
|
||||
.claim-info-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,6 @@ export type {
|
||||
AdminNinetyoneOrderItem,
|
||||
AdminNinetyoneOrderListResult,
|
||||
AdminNinetyoneOrderActionResult,
|
||||
AdminKuaishouEticketSourceConfig,
|
||||
AdminKuaishouEticketShopConfigItem,
|
||||
AdminKuaishouEticketShopInfoResult,
|
||||
AdminKuaishouEticketDetailResult,
|
||||
AdminKuaishouEticketConsumeResult,
|
||||
AdminKuaishouIndustryAccessTokenStatus,
|
||||
AdminKuaishouIndustryShopConfig,
|
||||
AdminKuaishouIndustrySourceConfig,
|
||||
|
||||
@@ -22,14 +22,6 @@ export type {
|
||||
AdminNinetyoneOrderActionResult,
|
||||
} from './ninetyone'
|
||||
|
||||
export type {
|
||||
AdminKuaishouEticketSourceConfig,
|
||||
AdminKuaishouEticketShopConfigItem,
|
||||
AdminKuaishouEticketShopInfoResult,
|
||||
AdminKuaishouEticketDetailResult,
|
||||
AdminKuaishouEticketConsumeResult,
|
||||
} from './kuaishou-eticket'
|
||||
|
||||
export type {
|
||||
AdminKuaishouIndustryAccessTokenStatus,
|
||||
AdminKuaishouIndustryShopConfig,
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
export interface AdminKuaishouEticketShopConfigItem {
|
||||
shopId: string
|
||||
kshopName: string
|
||||
cookie: string
|
||||
cookieMasked: string
|
||||
hasCookie: boolean
|
||||
userAvatar: string
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export interface AdminKuaishouEticketSourceConfig {
|
||||
enabled: boolean
|
||||
baseUrl: string
|
||||
shops: AdminKuaishouEticketShopConfigItem[]
|
||||
}
|
||||
|
||||
export interface AdminKuaishouEticketShopInfoResult {
|
||||
baseUrl: string
|
||||
ok: boolean
|
||||
result: number
|
||||
errorMessage: string
|
||||
requestId: string
|
||||
shop: {
|
||||
shopId: string
|
||||
kshopName: string
|
||||
userAvatar: string
|
||||
settleStatus: number
|
||||
hasCookie: boolean
|
||||
}
|
||||
raw: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface AdminKuaishouEticketDetailResult {
|
||||
baseUrl: string
|
||||
eTicketId: string
|
||||
ok: boolean
|
||||
alreadyConsumed: boolean
|
||||
result: number
|
||||
errorMessage: string
|
||||
requestId: string
|
||||
serverTimestamp: string
|
||||
detail: {
|
||||
uid: string
|
||||
fulfillDetailId: string
|
||||
sellerId: string
|
||||
formToken: string
|
||||
validEndTime: string
|
||||
validStartTime: string
|
||||
leftReverseCount: number
|
||||
eTicketId: string
|
||||
oid: string
|
||||
totalCount: number
|
||||
leftCount: number
|
||||
status: string
|
||||
} | null
|
||||
goods: {
|
||||
itemId: string
|
||||
itemPicUrl: string
|
||||
itemTitle: string
|
||||
price: string
|
||||
skuDesc: string
|
||||
skuId: string
|
||||
} | null
|
||||
raw: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface AdminKuaishouEticketConsumeResult {
|
||||
baseUrl: string
|
||||
eTicketId: string
|
||||
oid: string
|
||||
formToken: string
|
||||
num: number
|
||||
storeId: string
|
||||
ok: boolean
|
||||
consumed: boolean
|
||||
alreadyConsumed: boolean
|
||||
result: number
|
||||
errorMessage: string
|
||||
requestId: string
|
||||
serverTimestamp: string
|
||||
detail: AdminKuaishouEticketDetailResult['detail']
|
||||
raw: Record<string, unknown>
|
||||
}
|
||||
Reference in New Issue
Block a user