'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 { SuccessTag, PendingTag, WarningTag, ErrorTag } from '@/components/ui/Tag' import { useToast } from '@/components/ui/Toast' import { FileText, Video, Search, Filter, Clock, User, Building, ChevronRight, AlertTriangle, Download, Eye, File, MessageSquareWarning } from 'lucide-react' import { Modal } from '@/components/ui/Modal' import { getPlatformInfo } from '@/lib/platforms' // 模拟脚本待审列表 const mockScriptTasks = [ { id: 'script-001', title: '夏日护肤推广脚本', fileName: '夏日护肤推广_脚本v2.docx', fileSize: '245 KB', creatorName: '小美护肤', agencyName: '星耀传媒', projectName: 'XX品牌618推广', platform: 'douyin', aiScore: 88, submittedAt: '2026-02-06 14:30', hasHighRisk: false, agencyApproved: true, isAppeal: false, }, { id: 'script-002', title: '新品口红试色脚本', fileName: '口红试色_脚本v1.docx', fileSize: '312 KB', creatorName: '美妆Lisa', agencyName: '创意无限', projectName: 'XX品牌618推广', platform: 'xiaohongshu', aiScore: 72, submittedAt: '2026-02-06 12:15', hasHighRisk: true, agencyApproved: true, isAppeal: true, appealReason: '已修改违规用词,请求品牌方重新审核', }, ] // 模拟视频待审列表 const mockVideoTasks = [ { id: 'video-001', title: '夏日护肤推广', fileName: '夏日护肤_成片v2.mp4', fileSize: '128 MB', creatorName: '小美护肤', agencyName: '星耀传媒', projectName: 'XX品牌618推广', platform: 'douyin', aiScore: 85, duration: '02:15', submittedAt: '2026-02-06 15:00', hasHighRisk: false, agencyApproved: true, isAppeal: false, }, { id: 'video-002', title: '新品口红试色', fileName: '口红试色_终版.mp4', fileSize: '256 MB', creatorName: '美妆Lisa', agencyName: '创意无限', projectName: 'XX品牌618推广', platform: 'xiaohongshu', aiScore: 68, duration: '03:42', submittedAt: '2026-02-06 13:45', hasHighRisk: true, agencyApproved: true, isAppeal: true, appealReason: '已按要求重新剪辑,删除了争议片段,请求终审', }, { id: 'video-003', title: '健身器材开箱', fileName: '健身器材_开箱v3.mp4', fileSize: '198 MB', creatorName: '健身教练王', agencyName: '美妆达人MCN', projectName: 'XX运动品牌', platform: 'bilibili', aiScore: 92, duration: '04:20', submittedAt: '2026-02-06 11:30', hasHighRisk: false, agencyApproved: true, isAppeal: false, }, ] function ScoreTag({ score }: { score: number }) { if (score >= 85) return {score}分 if (score >= 70) return {score}分 return {score}分 } type ScriptTask = typeof mockScriptTasks[0] type VideoTask = typeof mockVideoTasks[0] function TaskCard({ task, type, onPreview }: { task: ScriptTask | VideoTask type: 'script' | 'video' onPreview: (task: ScriptTask | VideoTask, type: 'script' | 'video') => void }) { const toast = useToast() const href = type === 'script' ? `/brand/review/script/${task.id}` : `/brand/review/video/${task.id}` const platform = getPlatformInfo(task.platform) const handlePreview = (e: React.MouseEvent) => { e.preventDefault() e.stopPropagation() onPreview(task, type) } const handleDownload = (e: React.MouseEvent) => { e.preventDefault() e.stopPropagation() toast.info(`下载文件: ${task.fileName}`) } return (
{/* 平台顶部条 */} {platform && (
{platform.icon} {platform.name} {/* 申诉标识 */} {task.isAppeal && ( 申诉 )}
)}

{task.title}

{task.hasHighRisk && ( 高风险 )}
{task.creatorName} {task.agencyName}
{/* 申诉理由 */} {task.isAppeal && task.appealReason && (

申诉理由

{task.appealReason}

)} {/* 文件信息 */}
{type === 'script' ? ( ) : (

{task.fileName}

{task.fileSize} {'duration' in task && ` · ${task.duration}`}

{task.projectName} {task.submittedAt}
) } export default function BrandReviewListPage() { const toast = useToast() const [searchQuery, setSearchQuery] = useState('') const [activeTab, setActiveTab] = useState<'all' | 'script' | 'video'>('all') const [previewTask, setPreviewTask] = useState<{ task: ScriptTask | VideoTask; type: 'script' | 'video' } | null>(null) const filteredScripts = mockScriptTasks.filter(task => task.title.toLowerCase().includes(searchQuery.toLowerCase()) || task.creatorName.toLowerCase().includes(searchQuery.toLowerCase()) ) const filteredVideos = mockVideoTasks.filter(task => task.title.toLowerCase().includes(searchQuery.toLowerCase()) || task.creatorName.toLowerCase().includes(searchQuery.toLowerCase()) ) // 计算申诉数量 const appealScriptCount = mockScriptTasks.filter(t => t.isAppeal).length const appealVideoCount = mockVideoTasks.filter(t => t.isAppeal).length const handlePreview = (task: ScriptTask | VideoTask, type: 'script' | 'video') => { setPreviewTask({ task, type }) } return (
{/* 页面标题 */}

终审台

审核代理商提交的脚本和视频

待审核: {mockScriptTasks.length} 脚本 {mockVideoTasks.length} 视频 {(appealScriptCount + appealVideoCount) > 0 && ( {appealScriptCount + appealVideoCount} 申诉 )}
{/* 搜索和筛选 */}
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" />
{/* 任务列表 */}
{/* 脚本待审列表 */} {(activeTab === 'all' || activeTab === 'script') && ( 脚本终审 {filteredScripts.length} 条待审 {filteredScripts.length > 0 ? ( filteredScripts.map((task) => ( )) ) : (

暂无待审脚本

)}
)} {/* 视频待审列表 */} {(activeTab === 'all' || activeTab === 'video') && ( {filteredVideos.length > 0 ? ( filteredVideos.map((task) => ( )) ) : (
)}
)}
{/* 预览弹窗 */} setPreviewTask(null)} title={previewTask?.task.fileName || '文件预览'} size="lg" >
{/* 申诉理由 */} {previewTask?.task.isAppeal && previewTask?.task.appealReason && (

申诉理由

{previewTask.task.appealReason}

)} {/* 预览区域 */} {previewTask?.type === 'video' ? (
) : (

脚本预览区域

实际开发中将嵌入文档预览组件

)} {/* 文件信息和操作 */}
{previewTask?.task.fileName} · {previewTask?.task.fileSize} {previewTask?.type === 'video' && 'duration' in (previewTask?.task || {}) && ( <> · {(previewTask.task as VideoTask).duration} )}
) }