'use client' import { useState } from 'react' import { useRouter, useParams } from 'next/navigation' import { useToast } from '@/components/ui/Toast' import { ArrowLeft, Play, Pause, AlertTriangle, Shield, Radio } from 'lucide-react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card' import { Button } from '@/components/ui/Button' import { SuccessTag, WarningTag, ErrorTag } from '@/components/ui/Tag' import { Modal, ConfirmModal } from '@/components/ui/Modal' import { ReviewSteps, getAgencyReviewSteps } from '@/components/ui/ReviewSteps' // 模拟审核任务数据 const mockTask = { id: 'task-001', videoTitle: '夏日护肤推广', creatorName: '小美护肤', brandName: 'XX护肤品牌', platform: '抖音', aiScore: 85, aiSummary: '视频整体合规,发现2处硬性问题和1处舆情提示需人工确认', reviewSteps: [ { key: 'submitted', label: '已提交', status: 'done' as const, time: '2/3 10:30' }, { key: 'ai_review', label: 'AI审核', status: 'done' as const, time: '2/3 10:35' }, { key: 'agent_review', label: '代理商审核', status: 'current' as const }, { key: 'final', label: '最终结果', status: 'pending' as const }, ], hardViolations: [ { id: 'v1', type: '违禁词', content: '效果最好', timestamp: 15.5, source: 'speech', riskLevel: 'high', aiConfidence: 0.95, suggestion: '建议替换为"效果显著"', }, { id: 'v2', type: '竞品露出', content: '疑似竞品Logo', timestamp: 42.0, source: 'visual', riskLevel: 'high', aiConfidence: 0.72, suggestion: '需人工确认是否为竞品露出', }, ], sentimentWarnings: [ { id: 's1', type: '油腻预警', timestamp: 42.0, content: '达人表情过于夸张,建议检查', riskLevel: 'medium' }, ], } function ReviewProgressBar({ taskStatus }: { taskStatus: string }) { const steps = getAgencyReviewSteps(taskStatus) const currentStep = steps.find(s => s.status === 'current') return (
审核流程 当前:{currentStep?.label || '代理商审核'}
) } function RiskLevelTag({ level }: { level: string }) { if (level === 'high') return 高风险 if (level === 'medium') return 中风险 return 低风险 } function formatTimestamp(seconds: number): string { const mins = Math.floor(seconds / 60) const secs = Math.floor(seconds % 60) return `${mins}:${secs.toString().padStart(2, '0')}` } export default function ReviewPage() { const router = useRouter() const params = useParams() const toast = useToast() const [isPlaying, setIsPlaying] = useState(false) const [showApproveModal, setShowApproveModal] = useState(false) const [showRejectModal, setShowRejectModal] = useState(false) const [showForcePassModal, setShowForcePassModal] = useState(false) const [rejectReason, setRejectReason] = useState('') const [forcePassReason, setForcePassReason] = useState('') const [saveAsException, setSaveAsException] = useState(false) const [checkedViolations, setCheckedViolations] = useState>({}) const task = mockTask const handleApprove = () => { setShowApproveModal(false) router.push('/agency') } const handleReject = () => { if (!rejectReason.trim()) { toast.error('请填写驳回原因') return } setShowRejectModal(false) router.push('/agency') } const handleForcePass = () => { if (!forcePassReason.trim()) { toast.error('请填写强制通过原因') return } setShowForcePassModal(false) router.push('/agency') } // 计算问题时间点用于进度条展示 const timelineMarkers = [ ...task.hardViolations.map(v => ({ time: v.timestamp, type: 'hard' as const })), ...task.sentimentWarnings.map(w => ({ time: w.timestamp, type: 'soft' as const })), ].sort((a, b) => a.time - b.time) return (
{/* 顶部导航 */}

{task.videoTitle}

{task.creatorName} · {task.brandName} · {task.platform}

{/* 审核流程进度条 */}
{/* 左侧:视频播放器 (3/5) */}
{/* 智能进度条 */}
智能进度条(点击跳转)
{/* 时间标记点 */} {timelineMarkers.map((marker, idx) => (
0:00 2:00
硬性问题 舆情提示 卖点覆盖
{/* AI 分析总结 */}
AI 分析总结 = 80 ? 'text-accent-green' : 'text-yellow-400'}`}> {task.aiScore}分

{task.aiSummary}

{/* 右侧:AI 检查单 (2/5) */}
{/* 硬性合规 */} 硬性合规 ({task.hardViolations.length}) {task.hardViolations.map((v) => (
setCheckedViolations((prev) => ({ ...prev, [v.id]: !prev[v.id] }))} className="mt-1 accent-accent-indigo" />
{v.type} {formatTimestamp(v.timestamp)}

「{v.content}」

{v.suggestion}

))}
{/* 舆情雷达 */} {task.sentimentWarnings.length > 0 && ( 舆情雷达(仅提示) {task.sentimentWarnings.map((w) => (
{w.type} {formatTimestamp(w.timestamp)}

{w.content}

⚠️ 软性风险仅作提示,不强制拦截

))}
)}
{/* 底部决策栏 */}
已检查 {Object.values(checkedViolations).filter(Boolean).length}/{task.hardViolations.length} 个问题
{/* 通过确认弹窗 */} setShowApproveModal(false)} onConfirm={handleApprove} title="确认通过" message="确定要通过此视频的审核吗?通过后达人将收到通知。" confirmText="确认通过" /> {/* 驳回弹窗 */} setShowRejectModal(false)} title="驳回审核">

请填写驳回原因,已勾选的问题将自动打包发送给达人。

已选问题 ({Object.values(checkedViolations).filter(Boolean).length})

{task.hardViolations.filter(v => checkedViolations[v.id]).map(v => (
• {v.type}: {v.content}
))} {Object.values(checkedViolations).filter(Boolean).length === 0 && (
未选择任何问题
)}