"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { Button } from "@/components/ui/button"; import { Card, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Bot, BookOpen, Users, Wand2, LineChart, ScrollText, Globe, LayoutDashboard, FileText, ArrowRight, ChevronLeft, ChevronRight, MessageSquare, Github, Mail, } from "lucide-react"; import { ScreenshotDisplay } from "@/components/ScreenshotDisplay"; import { ChatWidget } from "@/components/visitor/ChatWidget"; import { FloatingButton } from "@/components/visitor/FloatingButton"; import { Header } from "@/components/layout/Header"; import { Footer } from "@/components/layout/Footer"; import { FadeIn, FadeInStagger, FadeInItem } from "@/components/ui/fade-in"; import { websiteConfig } from "@/lib/website-config"; import { stats } from "@/lib/stats-config"; const capabilityCards = [ { icon: Bot, title: "多模型 AI 客服", description: "支持配置多家大模型与绘画等能力,访客与后台可统一管理模型与使用方式,便于替换供应商、控制成本。", }, { icon: BookOpen, title: "知识库与 RAG", description: "文档入库、向量检索,让回答贴近你的业务资料;回复可标记是否使用知识库、模型或联网,便于核对与优化。", }, { icon: Wand2, title: "提示词工程", description: "配置系统中使用的提示词模板,用于不同领域 RAG、联网等不同的业务场景。", }, { icon: Users, title: "人工客服与实时协作", description: "在线状态、会话实时推送(WebSocket),支持人工接管与日常协作;访客小窗可嵌入任意站点。", }, { icon: LineChart, title: "可视化报表", description: "按日或自定义区间查看访客小窗打开、会话与消息、AI 回复与失败率、知识库命中率等指标,快速掌握运营态势。", }, { icon: ScrollText, title: "日志中心", description: "结构化日志按分类与事件落库,支持 trace_id 与关键字筛选,关键链路与异常可追溯,便于排障与审计。", }, ]; const steps = [ { title: "克隆与配置", body: "复制 .env 模板,填好数据库与管理员等必填项。", }, { title: "一键启动", body: "使用 Docker Compose 拉起前后端与依赖服务(详见 README)。", }, { title: "嵌入访客端", body: "在站点中挂载聊天小窗,后台完成模型与知识库配置后即可对外服务。", }, ]; const screenshotCards = [ { key: "dashboard", title: "工作台", imageName: "dashboard.png", placeholderIcon: LayoutDashboard, placeholderText: "工作台界面", alt: "AI-CS 工作台界面", }, { key: "visitor", title: "访客端", imageName: "visitor.png", placeholderIcon: Globe, placeholderText: "访客端界面", alt: "AI-CS 访客端界面", }, { key: "ai-config", title: "AI配置", imageName: "ai-config.png", placeholderIcon: Bot, placeholderText: "AI配置界面", alt: "AI-CS AI配置界面", }, { key: "users", title: "用户管理", imageName: "users.png", placeholderIcon: Users, placeholderText: "用户管理界面", alt: "AI-CS 用户管理界面", }, { key: "faq", title: "FAQ管理", imageName: "faq.png", placeholderIcon: FileText, placeholderText: "FAQ管理界面", alt: "AI-CS FAQ管理界面", }, { key: "knowledge", title: "知识库管理", imageName: "knowledge.png", placeholderIcon: BookOpen, placeholderText: "知识库管理界面", alt: "AI-CS 知识库管理界面", }, { key: "conversations", title: "知识库测试", imageName: "conversations.png", placeholderIcon: MessageSquare, placeholderText: "知识库测试界面", alt: "AI-CS 知识库测试界面", }, { key: "prompts", title: "提示词工程", imageName: "prompts.png", placeholderIcon: Wand2, placeholderText: "提示词工程界面", alt: "AI-CS 提示词工程界面", }, { key: "logs", title: "日志中心", imageName: "logs.png", placeholderIcon: ScrollText, placeholderText: "日志中心界面", alt: "AI-CS 日志中心界面", }, { key: "analytics", title: "可视化报表", imageName: "analytics.png", placeholderIcon: LineChart, placeholderText: "可视化报表界面", alt: "AI-CS 可视化报表界面", }, ]; export function HomePageClient() { const [visitorId, setVisitorId] = useState(null); const [isChatOpen, setIsChatOpen] = useState(false); const [activeScreenshot, setActiveScreenshot] = useState(0); useEffect(() => { let stored = window.localStorage.getItem("visitor_id"); if (!stored) { stored = `${Date.now()}${Math.floor(Math.random() * 100000)}`; window.localStorage.setItem("visitor_id", stored); } const parsed = Number.parseInt(stored, 10); setVisitorId(Number.isNaN(parsed) ? null : parsed); }, []); const handleToggleChat = () => setIsChatOpen((prev) => !prev); const handleOpenChat = () => { if (visitorId === null) { setTimeout(() => setIsChatOpen(true), 500); } else { setIsChatOpen(true); } }; const totalScreenshots = screenshotCards.length; const prevScreenshotIndex = (activeScreenshot - 1 + totalScreenshots) % totalScreenshots; const nextScreenshotIndex = (activeScreenshot + 1) % totalScreenshots; const goPrevScreenshot = () => { setActiveScreenshot((prev) => (prev - 1 + totalScreenshots) % totalScreenshots); }; const goNextScreenshot = () => { setActiveScreenshot((prev) => (prev + 1) % totalScreenshots); }; useEffect(() => { const timer = window.setInterval(() => { setActiveScreenshot((prev) => (prev + 1) % totalScreenshots); }, 4800); return () => window.clearInterval(timer); }, [totalScreenshots]); return (
{/* Hero(回归旧版文案气质,保留新版三按钮) */}

AI 智能客服

让客户服务更简单、更高效

7×24 小时智能应答,AI 与人工无缝切换,释放团队时间专注更有价值的事

无需等待,可立即使用

{/* 数字条(沿用旧版) */}

深受企业信赖

{stats.map((stat) => (
{stat.value}
{stat.label}
))}
{/* 核心能力 */}

核心能力

从模型、知识库、提示词到人工协作、报表与日志,一套系统串起来。

{capabilityCards.map((item) => { const Icon = item.icon; return (
{item.title} {item.description}
); })}
{/* 界面展示 */}

界面展示

精心设计的界面,让管理更轻松

{screenshotCards.map((item, idx) => ( ))}
{/* 左侧半露卡片 */}
{/* 右侧半露卡片 */}
{/* 中间主卡片 */}
{/* 快速接入 */}

快速接入

三步跑通,从仓库到访客小窗。

{steps.map((step, i) => (
{i + 1}

{step.title}

{step.body}

))}
{/* 收尾 CTA */}

准备好把 AI-CS 接到你的产品里了吗?

从开源仓库开始,或用在线 Demo 先看交互与能力边界。

); }