feat: 本次提交更新内容如下

步骤器改好了
This commit is contained in:
笔记本里的永平
2025-07-09 19:32:55 +08:00
parent b050b78f60
commit b785998c4d
3 changed files with 43 additions and 41 deletions

View File

@@ -17,22 +17,31 @@ interface StepIndicatorProps {
export default function StepIndicator({ currentStep, steps }: StepIndicatorProps) { export default function StepIndicator({ currentStep, steps }: StepIndicatorProps) {
return ( return (
<div className="flex justify-between items-center w-full mb-6 px-4"> <div className="flex justify-between items-center w-full mb-6 px-4 relative">
{steps.map((step, index) => ( {/* 连接线 */}
<div key={step.id} className="flex flex-col items-center"> <div className="absolute top-8 left-0 right-0 h-0.5 bg-gray-200 -z-10"></div>
{steps.map((step, index) => {
const isCompleted = index < currentStep
const isActive = index === currentStep
return (
<div key={step.id} className="flex flex-col items-center z-10">
<div <div
className={cn( className={cn(
"w-16 h-16 rounded-full flex items-center justify-center mb-2", "w-16 h-16 rounded-full flex items-center justify-center mb-2",
currentStep === index ? "bg-blue-500 text-white" : "bg-gray-200 text-gray-500", isActive ? "bg-blue-500 text-white" :
isCompleted ? "bg-blue-500 text-white" : "bg-gray-200 text-gray-500",
)} )}
> >
{step.icon} {step.icon}
</div> </div>
<span className={cn("text-sm", currentStep === index ? "text-blue-500 font-medium" : "text-gray-500")}> <span className={cn("text-sm", isActive ? "text-blue-500 font-medium" : isCompleted ? "text-blue-500" : "text-gray-500")}>
{step.title} {step.title}
</span> </span>
</div> </div>
))} )
})}
</div> </div>
) )
} }

View File

@@ -8,6 +8,8 @@ import {
Settings, Settings,
Search, Search,
} from 'lucide-react'; } from 'lucide-react';
import { Steps, StepItem } from 'tdesign-mobile-react'; // 添加这一行
import 'tdesign-mobile-react/es/style/index.css'; // 添加这一行
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label'; import { Label } from '@/components/ui/label';
@@ -88,21 +90,20 @@ interface TrafficPool {
// 步骤指示器组件 // 步骤指示器组件
function StepIndicator({ currentStep, steps }: StepIndicatorProps) { function StepIndicator({ currentStep, steps }: StepIndicatorProps) {
return ( return (
<div className="flex justify-between items-center w-full mb-6 px-4"> <div className="w-full mb-6 px-12">
<Steps current={currentStep} layout="horizontal">
{steps.map((step, index) => ( {steps.map((step, index) => (
<div key={step.id} className="flex flex-col items-center"> <StepItem
<div key={step.id}
className={`w-16 h-16 rounded-full flex items-center justify-center mb-2 ${ title={step.title}
currentStep === index ? "bg-blue-500 text-white" : "bg-gray-200 text-gray-500" icon={step.icon}
}`} status={
> index === currentStep ? 'process' :
{step.icon} index < currentStep ? 'finish' : 'default'
</div> }
<span className={`text-sm ${currentStep === index ? "text-blue-500 font-medium" : "text-gray-500"}`}> />
{step.title}
</span>
</div>
))} ))}
</Steps>
</div> </div>
); );
} }

View File

@@ -18,14 +18,6 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge'; import { Badge } from '@/components/ui/badge';
import { Switch } from '@/components/ui/switch'; import { Switch } from '@/components/ui/switch';
import { Progress } from '@/components/ui/progress';
// 不再使用 DropdownMenu 组件
// import {
// DropdownMenu,
// DropdownMenuContent,
// DropdownMenuItem,
// DropdownMenuTrigger,
// } from '@/components/ui/dropdown-menu';
import Layout from '@/components/Layout'; import Layout from '@/components/Layout';
import PageHeader from '@/components/PageHeader'; import PageHeader from '@/components/PageHeader';
import BottomNav from '@/components/BottomNav'; import BottomNav from '@/components/BottomNav';