From 83d501dc2d5eeb16da54a6993e3e2dff384f361e Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 7 Jul 2026 14:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E9=85=8D=E7=BD=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0feifei=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/admin/layout/AdminLayout.vue | 1 + .../platform-shops/AdminPlatformShopsView.vue | 41 ++++++++++++++++++- .../admin/platform-shops/composables/types.ts | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/views/admin/layout/AdminLayout.vue b/apps/frontend/src/views/admin/layout/AdminLayout.vue index a9beea4f..d39a67a9 100644 --- a/apps/frontend/src/views/admin/layout/AdminLayout.vue +++ b/apps/frontend/src/views/admin/layout/AdminLayout.vue @@ -57,6 +57,7 @@ const platformConfigNavItems = computed(() => { { to: '/admin/platform-shops?tab=ninetyone', label: '91卡券', icon: Connection }, { to: '/admin/platform-shops?tab=notifications', label: '内部通知', icon: Bell }, { to: '/admin/platform-shops?tab=kuaishouEticket', label: '快手小店核销', icon: Tickets }, + { to: '/admin/platform-shops?tab=kuaishouFeifei', label: 'kuaishou-feifei', icon: Tickets }, { to: '/admin/platform-shops?tab=cloudtentacles', label: 'cloudtentacles', diff --git a/apps/frontend/src/views/admin/platform-shops/AdminPlatformShopsView.vue b/apps/frontend/src/views/admin/platform-shops/AdminPlatformShopsView.vue index e687d56b..3d5f1087 100644 --- a/apps/frontend/src/views/admin/platform-shops/AdminPlatformShopsView.vue +++ b/apps/frontend/src/views/admin/platform-shops/AdminPlatformShopsView.vue @@ -6,11 +6,13 @@ import { RefreshRight } from '@element-plus/icons-vue' import AdminPageHeader from '@/components/admin/AdminPageHeader.vue' import { fetchAdminCloudtentaclesSourceConfig, + fetchAdminKuaishouFeifeiConfig, fetchAdminKuaishouEticketSourceConfig, fetchAdminNotificationConfig, fetchAdminScheduledJobsConfig, } from '@/services/admin' import { hasAdminRole } from '@/utils/admin-auth' +import AdminKuaishouFeifeiFulfillmentView from '../fulfillment/kuaishou-feifei/AdminKuaishouFeifeiFulfillmentView.vue' import AdminPlatformCloudtentaclesSection from './components/cloudtentacles/AdminPlatformCloudtentaclesSection.vue' import AdminPlatformNinetyoneSection from './components/AdminPlatformNinetyoneSection.vue' import AdminPlatformNotificationSection from './components/notification/AdminPlatformNotificationSection.vue' @@ -20,12 +22,19 @@ import { useAdminNinetyonePlatform } from './composables/useAdminNinetyonePlatfo import { useAdminNotificationPlatform } from './composables/useAdminNotificationPlatform' import { useAdminKuaishouEticketPlatform } from './composables/useAdminKuaishouEticketPlatform' import type { PlatformTab } from './composables/types' +import type { AdminKuaishouFeifeiConfigResponse } from '@/types/admin' const loading = ref(true) const errorMessage = ref('') const route = useRoute() -const platformTabs: PlatformTab[] = ['ninetyone', 'notifications', 'kuaishouEticket', 'cloudtentacles'] +const platformTabs: PlatformTab[] = [ + 'ninetyone', + 'notifications', + 'kuaishouEticket', + 'kuaishouFeifei', + 'cloudtentacles', +] function normalizePlatformTab(value: unknown): PlatformTab { return typeof value === 'string' && platformTabs.includes(value as PlatformTab) @@ -34,6 +43,7 @@ function normalizePlatformTab(value: unknown): PlatformTab { } const activePlatform = computed(() => normalizePlatformTab(route.query.tab)) +const kuaishouFeifeiConfig = ref(null) const { ninetyoneLoading, @@ -149,6 +159,17 @@ const { } = useAdminCloudtentaclesPlatform() const overviewCards = computed(() => { + const feifeiSource = kuaishouFeifeiConfig.value?.source + const feifeiEffective = kuaishouFeifeiConfig.value?.effective + const feifeiEnabledRuleCount = (feifeiSource?.productRules || []).filter( + (rule) => rule.enabled !== false, + ).length + const feifeiReady = Boolean( + feifeiEffective?.enabled && + feifeiEffective.hasAppKey && + feifeiEffective.hasAppSecret && + feifeiEnabledRuleCount > 0, + ) const cards = [ { key: 'notifications', @@ -181,6 +202,17 @@ const overviewCards = computed(() => { }`, status: kuaishouEticketStats.value.cookieReadyCount > 0 ? '已就绪' : '待配置', }, + { + key: 'kuaishouFeifei', + label: 'kuaishou-feifei', + tag: '补充发货平台', + value: feifeiEnabledRuleCount, + unit: '启用规则', + meta: `API ${ + feifeiEffective?.hasAppKey && feifeiEffective?.hasAppSecret ? '已配置' : '待补全' + } · 总规则 ${feifeiSource?.productRules.length || 0} 条`, + status: feifeiReady ? '已就绪' : '待配置', + }, { key: 'cloudtentacles', label: 'cloudtentacles', @@ -216,17 +248,20 @@ async function loadConfigs() { notificationResponse, scheduledJobsResponse, kuaishouEticketResponse, + kuaishouFeifeiResponse, cloudtentaclesResponse, ] = await Promise.all([ fetchAdminNotificationConfig(), fetchAdminScheduledJobsConfig(), fetchAdminKuaishouEticketSourceConfig(), + fetchAdminKuaishouFeifeiConfig(), fetchAdminCloudtentaclesSourceConfig(), ]) hydrateNotificationConfig(notificationResponse.data) hydrateScheduledJobsConfig(scheduledJobsResponse.data) hydrateKuaishouEticketConfig(kuaishouEticketResponse.data) + kuaishouFeifeiConfig.value = kuaishouFeifeiResponse.data hydrateCloudtentaclesConfig(cloudtentaclesResponse.data) await loadNinetyoneOrders(1) } catch (error) { @@ -357,6 +392,10 @@ onMounted(loadConfigs) :handle-kuaishou-eticket-consume="handleKuaishouEticketConsume" /> + +