'use client' import { useState } from 'react' import Link from 'next/link' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card' import { Button } from '@/components/ui/Button' import { Input } from '@/components/ui/Input' import { SuccessTag, PendingTag, WarningTag } from '@/components/ui/Tag' import { Modal } from '@/components/ui/Modal' import { Search, Plus, Filter, FileText, Video, ChevronRight, Calendar, Users, Pencil } from 'lucide-react' // 平台选项 - 抖音用青色(品牌渐变色之一),深色主题下更清晰 const platformOptions = [ { id: 'douyin', name: '抖音', icon: '🎵', bgColor: 'bg-[#25F4EE]/15', textColor: 'text-[#25F4EE]', borderColor: 'border-[#25F4EE]/30' }, { id: 'xiaohongshu', name: '小红书', icon: '📕', bgColor: 'bg-[#fe2c55]/15', textColor: 'text-[#fe2c55]', borderColor: 'border-[#fe2c55]/30' }, { id: 'bilibili', name: 'B站', icon: '📺', bgColor: 'bg-[#00a1d6]/15', textColor: 'text-[#00a1d6]', borderColor: 'border-[#00a1d6]/30' }, { id: 'kuaishou', name: '快手', icon: '⚡', bgColor: 'bg-[#ff4906]/15', textColor: 'text-[#ff4906]', borderColor: 'border-[#ff4906]/30' }, { id: 'weibo', name: '微博', icon: '🔴', bgColor: 'bg-[#e6162d]/15', textColor: 'text-[#e6162d]', borderColor: 'border-[#e6162d]/30' }, { id: 'wechat', name: '微信视频号', icon: '💬', bgColor: 'bg-[#07c160]/15', textColor: 'text-[#07c160]', borderColor: 'border-[#07c160]/30' }, ] // 项目类型定义 interface Project { id: string name: string status: string platform: string deadline: string scriptCount: { total: number; passed: number; pending: number; rejected: number } videoCount: { total: number; passed: number; pending: number; rejected: number } agencyCount: number creatorCount: number } // 模拟项目数据 const initialProjects: Project[] = [ { id: 'proj-001', name: 'XX品牌618推广', status: 'active', platform: 'douyin', deadline: '2026-06-18', scriptCount: { total: 20, passed: 15, pending: 3, rejected: 2 }, videoCount: { total: 20, passed: 12, pending: 5, rejected: 3 }, agencyCount: 3, creatorCount: 15, }, { id: 'proj-002', name: '新品口红系列', status: 'active', platform: 'xiaohongshu', deadline: '2026-03-15', scriptCount: { total: 12, passed: 10, pending: 1, rejected: 1 }, videoCount: { total: 12, passed: 8, pending: 3, rejected: 1 }, agencyCount: 2, creatorCount: 8, }, { id: 'proj-003', name: '护肤品秋季活动', status: 'completed', platform: 'bilibili', deadline: '2025-11-30', scriptCount: { total: 15, passed: 15, pending: 0, rejected: 0 }, videoCount: { total: 15, passed: 15, pending: 0, rejected: 0 }, agencyCount: 2, creatorCount: 10, }, { id: 'proj-004', name: '双11预热活动', status: 'active', platform: 'kuaishou', deadline: '2026-11-11', scriptCount: { total: 18, passed: 8, pending: 6, rejected: 4 }, videoCount: { total: 18, passed: 5, pending: 10, rejected: 3 }, agencyCount: 4, creatorCount: 20, }, ] // 获取平台信息 function getPlatformInfo(platformId: string) { return platformOptions.find(p => p.id === platformId) } function StatusTag({ status }: { status: string }) { if (status === 'active') return 进行中 if (status === 'completed') return 已完成 return 暂停 } function ProjectCard({ project, onEditDeadline }: { project: Project; onEditDeadline: (project: Project) => void }) { const scriptProgress = Math.round((project.scriptCount.passed / project.scriptCount.total) * 100) const videoProgress = Math.round((project.videoCount.passed / project.videoCount.total) * 100) const platform = getPlatformInfo(project.platform) return ( {/* 平台顶部条 */} {platform && ( {platform.icon} {platform.name} )} {/* 项目头部 */} {project.name} 截止 {project.deadline} { e.preventDefault() e.stopPropagation() onEditDeadline(project) }} className="p-1 rounded hover:bg-bg-page transition-colors" title="修改截止日期" > {/* 脚本进度 */} 脚本审核 {project.scriptCount.passed}/{project.scriptCount.total} 通过 {project.scriptCount.passed} 待审 {project.scriptCount.pending} 驳回 {project.scriptCount.rejected} {/* 视频进度 */} 视频审核 {project.videoCount.passed}/{project.videoCount.total} 通过 {project.videoCount.passed} 待审 {project.videoCount.pending} 驳回 {project.videoCount.rejected} {/* 参与方统计 */} {project.agencyCount} 代理商 {project.creatorCount} 达人 ) } export default function BrandProjectsPage() { const [searchQuery, setSearchQuery] = useState('') const [statusFilter, setStatusFilter] = useState('all') const [platformFilter, setPlatformFilter] = useState('all') const [projects, setProjects] = useState(initialProjects) // 编辑截止日期相关状态 const [showDeadlineModal, setShowDeadlineModal] = useState(false) const [editingProject, setEditingProject] = useState(null) const [newDeadline, setNewDeadline] = useState('') // 打开编辑截止日期弹窗 const handleEditDeadline = (project: Project) => { setEditingProject(project) setNewDeadline(project.deadline) setShowDeadlineModal(true) } // 保存截止日期 const handleSaveDeadline = () => { if (!editingProject || !newDeadline) return setProjects(prev => prev.map(p => p.id === editingProject.id ? { ...p, deadline: newDeadline } : p )) setShowDeadlineModal(false) setEditingProject(null) setNewDeadline('') } const filteredProjects = projects.filter(project => { const matchesSearch = project.name.toLowerCase().includes(searchQuery.toLowerCase()) const matchesStatus = statusFilter === 'all' || project.status === statusFilter const matchesPlatform = platformFilter === 'all' || project.platform === platformFilter return matchesSearch && matchesStatus && matchesPlatform }) return ( {/* 页面标题和操作 */} 项目看板 管理所有营销项目的审核进度 创建项目 {/* 搜索和筛选 */} setSearchQuery(e.target.value)} className="w-full pl-10 pr-4 py-2 border border-border-subtle rounded-lg bg-bg-elevated text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-indigo" /> setPlatformFilter(e.target.value)} className="px-3 py-2 border border-border-subtle rounded-lg bg-bg-elevated text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-indigo" > 全部平台 {platformOptions.map(p => ( {p.icon} {p.name} ))} setStatusFilter(e.target.value)} className="px-3 py-2 border border-border-subtle rounded-lg bg-bg-elevated text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-indigo" > 全部状态 进行中 已完成 已暂停 {/* 平台快捷筛选 */} setPlatformFilter('all')} className={`px-4 py-2 rounded-xl text-sm font-medium transition-all ${ platformFilter === 'all' ? 'bg-accent-indigo text-white shadow-sm' : 'bg-bg-elevated text-text-secondary hover:bg-bg-card border border-transparent hover:border-border-subtle' }`} > 全部 {platformOptions.map(platform => ( setPlatformFilter(platform.id)} className={`px-4 py-2 rounded-xl text-sm font-medium transition-all flex items-center gap-2 border ${ platformFilter === platform.id ? `${platform.bgColor} ${platform.textColor} ${platform.borderColor} shadow-sm` : 'bg-bg-elevated text-text-secondary border-transparent hover:bg-bg-card hover:border-border-subtle' }`} > {platform.icon} {platform.name} ))} {/* 项目卡片网格 */} {filteredProjects.map((project) => ( ))} {filteredProjects.length === 0 && ( 暂无匹配的项目 创建新项目 )} {/* 编辑截止日期弹窗 */} { setShowDeadlineModal(false) setEditingProject(null) setNewDeadline('') }} title="修改截止日期" > {editingProject && ( 项目名称 {editingProject.name} )} 新截止日期 setNewDeadline(e.target.value)} className="w-full pl-12 pr-4 py-3 border border-border-subtle rounded-lg bg-bg-elevated text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-indigo" /> { setShowDeadlineModal(false) setEditingProject(null) setNewDeadline('') }} > 取消 保存 ) }
管理所有营销项目的审核进度
暂无匹配的项目
项目名称
{editingProject.name}