import React, { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { Plus, TrendingUp } from 'lucide-react'; import PageHeader from '@/components/PageHeader'; interface Scenario { id: string; name: string; image: string; description?: string; count: number; growth: string; } export default function Scenarios() { const navigate = useNavigate(); const [scenarios, setScenarios] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(''); // AI智能获客用本地 mock 数据(暂时注释掉,可以后续启用) // const aiScenarios = [ // { // id: "ai-friend", // name: "AI智能加友", // icon: "🤖", // count: 245, // growth: "+18.5%", // description: "智能分析目标用户画像,自动筛选优质客户", // path: "/scenarios/ai-friend", // }, // { // id: "ai-group", // name: "AI群引流", // icon: "🤖", // count: 178, // growth: "+15.2%", // description: "智能群管理,提高群活跃度,增强获客效果", // path: "/scenarios/ai-group", // }, // { // id: "ai-conversion", // name: "AI场景转化", // icon: "🤖", // count: 134, // growth: "+12.8%", // description: "多场景智能营销,提升获客转化率", // path: "/scenarios/ai-conversion", // }, // ]; useEffect(() => { const fetchScenarios = async () => { setLoading(true); try { // 这里可以调用实际的API // const response = await fetch('/api/scenarios'); // const data = await response.json(); // 模拟数据 const mockScenarios: Scenario[] = [ { id: "douyin", name: "抖音获客", image: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-QR8ManuDplYTySUJsY4mymiZkDYnQ9.png", description: "通过抖音平台进行精准获客", count: 156, growth: "+12%", }, { id: "xiaohongshu", name: "小红书获客", image: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-yvnMxpoBUzcvEkr8DfvHgPHEo1kmQ3.png", description: "利用小红书平台进行内容营销获客", count: 89, growth: "+8%", }, { id: "gongzhonghao", name: "公众号获客", image: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-Gsg0CMf5tsZb41mioszdjqU1WmsRxW.png", description: "通过微信公众号进行获客", count: 234, growth: "+15%", }, { id: "haibao", name: "海报获客", image: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/image-x92XJgXy4MI7moNYlA1EAes2FqDxMH.png", description: "通过海报分享进行获客", count: 167, growth: "+10%", }, ]; setScenarios(mockScenarios); } catch (error) { setError('获取场景数据失败'); console.error('获取场景数据失败:', error); } finally { setLoading(false); } }; fetchScenarios(); }, []); if (loading) { return (
加载中...
); } if (error) { return (
{error}
); } return (
navigate('/scenarios/new')} className="flex items-center px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm" > 新建计划 } />
{scenarios.map((scenario) => (
navigate(`/scenarios/${scenario.id}/detail`)} >
{scenario.name}

{scenario.name}

{scenario.description && (

{scenario.description}

)}
今日: {scenario.count}
{scenario.growth}
))}
{/* AI智能获客部分(暂时注释掉,可以后续启用) */} {/*

AI智能获客

Beta
{aiScenarios.map((scenario) => (
navigate(scenario.path)} >
{scenario.icon}

{scenario.name}

{scenario.description}

今日: {scenario.count}
{scenario.growth}
))}
*/}
); }