From 5d68a41931665f1cd665d114d6c1f9dcfd958ea8 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: Mon, 7 Jul 2025 22:25:24 +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=85=88=E5=AD=98=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/src/pages/scenarios/NewPlan.tsx | 90 ++++++++++++++++---------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/nkebao/src/pages/scenarios/NewPlan.tsx b/nkebao/src/pages/scenarios/NewPlan.tsx index fb734578..45a5f3db 100644 --- a/nkebao/src/pages/scenarios/NewPlan.tsx +++ b/nkebao/src/pages/scenarios/NewPlan.tsx @@ -3,6 +3,8 @@ import { useNavigate, useSearchParams } from 'react-router-dom'; import { Check, Settings } from 'lucide-react'; import PageHeader from '@/components/PageHeader'; import { useToast } from '@/components/ui/toast'; +import Layout from '@/components/Layout'; +import '@/components/Layout.css'; // 步骤定义 const steps = [ @@ -134,33 +136,55 @@ export default function NewPlan() { setCurrentStep((prev) => Math.max(prev - 1, 1)); }; - // 步骤指示器组件 - const StepIndicator = ({ steps, currentStep }: { steps: any[], currentStep: number }) => ( -
- {steps.map((step, index) => ( -
-
step.id - ? 'bg-green-500 text-white' - : currentStep === step.id - ? 'bg-blue-500 text-white' - : 'bg-gray-200 text-gray-500' - }`}> - {currentStep > step.id ? : step.id} + // 步骤指示器组件(方案A:简洁线性进度条风格) + const StepIndicator = ({ steps, currentStep }: { steps: any[], currentStep: number }) => { + const percent = ((currentStep - 1) / (steps.length - 1)) * 100; + return ( +
+ {/* 进度条 */} +
+
+
+ {/* 圆点 */} +
+ {steps.map((step, idx) => { + const isActive = currentStep === step.id; + const isDone = currentStep > step.id; + return ( +
+
+ {isDone ? : {step.id}} +
+
+ ); + })}
-
-
{step.title}
-
{step.subtitle}
-
- {index < steps.length - 1 && ( -
step.id ? 'bg-green-500' : 'bg-gray-200' - }`} /> - )}
- ))} -
- ); + {/* 步骤文字 */} +
+ {steps.map((step, idx) => { + const isActive = currentStep === step.id; + const isDone = currentStep > step.id; + return ( +
+ {step.title} + {step.subtitle} +
+ ); + })} +
+
+ ); + }; // 基础设置步骤 const BasicSettings = () => { @@ -393,8 +417,8 @@ export default function NewPlan() { }; return ( -
-
+ } /> - - {/* 添加pt-16来避免被固定导航栏遮挡 */} -
-
+ } + > +
+
+
-
{renderStepContent()}
-
+ ); } \ No newline at end of file