"use client" import { useState } from "react" import { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Textarea } from "@/components/ui/textarea" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Switch } from "@/components/ui/switch" import { Badge } from "@/components/ui/badge" import { Separator } from "@/components/ui/separator" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog" import { Sparkles, BarChart, TrendingUp, Users, Mail, Clock, Download, ChevronRight } from "lucide-react" export default function AIAssistantPage() { const [activeTab, setActiveTab] = useState("data-analysis") const [selectedUserGroup, setSelectedUserGroup] = useState("") const [isUserGroupDialogOpen, setIsUserGroupDialogOpen] = useState(false) const [emailAddress, setEmailAddress] = useState("") const [scheduleReport, setScheduleReport] = useState(false) // 分析流程步骤 const [analysisStep, setAnalysisStep] = useState(1) const [analysisType, setAnalysisType] = useState("") // 营销策略步骤 const [strategyStep, setStrategyStep] = useState(1) const [strategyType, setStrategyType] = useState("") return (

AI 智能助手

利用AI技术分析数据并提供营销策略

数据分析 营销策略 AI 数据分析 使用AI分析用户数据并生成洞察报告 {/* 第1步:选择用户分群 */}

1
选择用户分群

{analysisStep > 1 ? ( ) : ( )}
{selectedUserGroup && (
已选择用户分群: {selectedUserGroup}
{analysisStep === 1 && ( )}
)}
{/* 第2步:选择分析类型 */}
2 ? "opacity-60" : "opacity-40") : ""}`} >

2
选择分析类型

{analysisStep > 2 && ( )}
{analysisStep >= 2 && (
setAnalysisType("behavior")} > 用户行为分析 分析用户的行为模式、偏好和习惯 {analysisType === "behavior" && 已选择} setAnalysisType("value")} > 用户估值分析 分析用户的价值分布和潜在价值 {analysisType === "value" && 已选择} setAnalysisType("churn")} > 用户流失预警 预测可能流失的用户并提供挽留建议 {analysisType === "churn" && 已选择}
)} {analysisStep === 2 && analysisType && (
)}
{/* 第3步:分析参数设置 */}
3 ? "opacity-60" : "opacity-40") : ""}`} >

3
分析参数设置

{analysisStep > 3 && ( )}
{analysisStep >= 3 && (
)} {analysisStep === 3 && (
)}
{/* 第4步:报告设置 */}

4
报告设置

{analysisStep >= 4 && (
setEmailAddress(e.target.value)} />
{scheduleReport && (
)}
)}
分析结果预览 AI生成的数据分析结果 {selectedUserGroup && analysisStep === 4 ? (

分析结果将在这里显示

点击"开始分析"按钮生成分析报告

) : (

请完成所有分析步骤

)}
AI 营销策略 使用AI生成针对性的营销策略和建议 {/* 第1步:选择目标用户分群 */}

1
选择目标用户分群

{strategyStep > 1 ? ( ) : ( )}
{selectedUserGroup && (
已选择用户分群: {selectedUserGroup}
{strategyStep === 1 && ( )}
)}
{/* 第2步:选择策略类型 */}
2 ? "opacity-60" : "opacity-40") : ""}`} >

2
选择策略类型

{strategyStep > 2 && ( )}
{strategyStep >= 2 && (
setStrategyType("sales")} > 销售预测 预测未来销售趋势并提供增长建议 {strategyType === "sales" && 已选择} setStrategyType("reach")} > 用户触达策略 生成针对性的用户触达和转化策略 {strategyType === "reach" && 已选择} setStrategyType("content")} > 内容营销策略 生成针对目标用户的内容营销策略 {strategyType === "content" && 已选择}
)} {strategyStep === 2 && strategyType && (
)}
{/* 第3步:策略参数设置 */}

3
策略参数设置

{strategyStep >= 3 && ( <>