From 6c1646b23bc9c45f0b9607a9552a7fc6dfce506f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Wed, 16 Jul 2025 17:26:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E5=AD=98=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/src/App.tsx | 6 +- nkebao/src/api/scenarios.ts | 67 +++++++- nkebao/src/pages/scenarios/ScenarioList.tsx | 15 +- nkebao/src/pages/scenarios/new/page.tsx | 44 ++++- .../scenarios/new/steps/BasicSettings.tsx | 158 +----------------- 5 files changed, 113 insertions(+), 177 deletions(-) diff --git a/nkebao/src/App.tsx b/nkebao/src/App.tsx index 90d16eb1..cb738fa6 100644 --- a/nkebao/src/App.tsx +++ b/nkebao/src/App.tsx @@ -128,7 +128,11 @@ function App() { {/* 场景计划开始 */} } /> } /> - } /> + } + /> + } /> } diff --git a/nkebao/src/api/scenarios.ts b/nkebao/src/api/scenarios.ts index accae31b..7e5d3a5f 100644 --- a/nkebao/src/api/scenarios.ts +++ b/nkebao/src/api/scenarios.ts @@ -50,12 +50,73 @@ export interface Task { trend: { date: string; customers: number }[]; } +// 消息内容类型 +export interface MessageContent { + id: string; + type: string; // "text" | "image" | "video" | "file" | "miniprogram" | "link" | "group" 等 + content?: string; + intervalUnit?: "seconds" | "minutes"; + sendInterval?: number; + // 其他可选字段 + [key: string]: any; +} + +// 每天的消息计划 +export interface MessagePlan { + day: number; + messages: MessageContent[]; +} + +// 海报类型 +export interface Poster { + id: string; + name: string; + type: string; + preview: string; +} + +// 标签类型 +export interface Tag { + id: string; + name: string; + [key: string]: any; +} + +// textUrl类型 +export interface TextUrl { + apiKey: string; + originalString?: string; + sign?: string; + fullUrl: string; +} + // 计划详情类型 export interface PlanDetail { + id: number; + name: string; + planName: string; + scenario: string; + scenarioTags: Tag[]; + customTags: Tag[]; + posters: Poster[]; + device: string[]; + enabled: boolean; + addInterval: number; + remarkFormat: string; + planNameEdited: boolean; + endTime: string; + greeting: string; + startTime: string; + remarkType: string; + addFriendInterval: number; + messagePlans: MessagePlan[]; + sceneId: number | string; + userId: number; + companyId: number; + status: number; apiKey: string; - textUrl: { - fullUrl: string; - }; + wxMinAppSrc?: any; + textUrl: TextUrl; } /** diff --git a/nkebao/src/pages/scenarios/ScenarioList.tsx b/nkebao/src/pages/scenarios/ScenarioList.tsx index b31dcd0a..6c110961 100644 --- a/nkebao/src/pages/scenarios/ScenarioList.tsx +++ b/nkebao/src/pages/scenarios/ScenarioList.tsx @@ -9,8 +9,7 @@ import { Calendar, Copy, Trash2, - Play, - Pause, + Edit, Settings, Loader2, Code, @@ -308,7 +307,7 @@ export default function ScenarioDetail() { }; const handleCreateNewPlan = () => { - navigate(`/scenarios/new?scenario=${scenarioId}`); + navigate(`/scenarios/new/${scenarioId}`); }; const getStatusColor = (status: number) => { @@ -496,20 +495,14 @@ export default function ScenarioDetail() {