'use client' import { useState } from 'react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card' import { Button } from '@/components/ui/Button' import { SuccessTag, WarningTag, ErrorTag, PendingTag } from '@/components/ui/Tag' import { Bell, CheckCircle, XCircle, AlertTriangle, FileText, Video, Users, Clock, Check, MoreVertical, PlusCircle } from 'lucide-react' // 消息类型 interface Message { id: string type: string title: string content: string time: string read: boolean icon: typeof Bell iconColor: string bgColor: string // 申诉次数请求专用字段 appealRequest?: { creatorName: string taskName: string taskId: string status: 'pending' | 'approved' | 'rejected' } } // 模拟消息列表 const mockMessages: Message[] = [ { id: 'msg-001', type: 'appeal_quota_request', title: '申诉次数申请', content: '达人「李小红」申请增加「618美妆推广视频」的申诉次数', time: '5分钟前', read: false, icon: PlusCircle, iconColor: 'text-accent-amber', bgColor: 'bg-accent-amber/20', appealRequest: { creatorName: '李小红', taskName: '618美妆推广视频', taskId: 'task-001', status: 'pending', }, }, { id: 'msg-002', type: 'task_submitted', title: '新脚本提交', content: '达人「小美护肤」提交了「夏日护肤推广脚本」,请及时审核。', time: '10分钟前', read: false, icon: FileText, iconColor: 'text-accent-indigo', bgColor: 'bg-accent-indigo/20', }, { id: 'msg-003', type: 'appeal_quota_request', title: '申诉次数申请', content: '达人「美妆达人小王」申请增加「双11护肤品种草」的申诉次数', time: '30分钟前', read: false, icon: PlusCircle, iconColor: 'text-accent-amber', bgColor: 'bg-accent-amber/20', appealRequest: { creatorName: '美妆达人小王', taskName: '双11护肤品种草', taskId: 'task-002', status: 'pending', }, }, { id: 'msg-004', type: 'review_complete', title: '品牌终审通过', content: '「新品口红试色」视频已通过品牌方终审。', time: '1小时前', read: false, icon: CheckCircle, iconColor: 'text-accent-green', bgColor: 'bg-accent-green/20', }, { id: 'msg-005', type: 'review_rejected', title: '品牌终审驳回', content: '「健身器材开箱」视频被品牌方驳回,原因:违禁词使用。', time: '2小时前', read: false, icon: XCircle, iconColor: 'text-accent-coral', bgColor: 'bg-accent-coral/20', }, { id: 'msg-006', type: 'new_project', title: '新项目邀请', content: '您被邀请参与「XX品牌新品推广」项目,请配置 Brief。', time: '昨天', read: true, icon: Users, iconColor: 'text-purple-400', bgColor: 'bg-purple-500/20', }, { id: 'msg-007', type: 'warning', title: '风险预警', content: '达人「美妆Lisa」连续2次提交被驳回,建议关注。', time: '昨天', read: true, icon: AlertTriangle, iconColor: 'text-orange-400', bgColor: 'bg-orange-500/20', }, { id: 'msg-008', type: 'task_submitted', title: '新视频提交', content: '达人「健身教练王」提交了「健身器材使用教程」视频,请及时审核。', time: '2天前', read: true, icon: Video, iconColor: 'text-purple-400', bgColor: 'bg-purple-500/20', }, ] export default function AgencyMessagesPage() { const [messages, setMessages] = useState(mockMessages) const [filter, setFilter] = useState<'all' | 'unread'>('all') const unreadCount = messages.filter(m => !m.read).length const pendingAppealRequests = messages.filter(m => m.appealRequest?.status === 'pending').length const filteredMessages = filter === 'all' ? messages : messages.filter(m => !m.read) const markAsRead = (id: string) => { setMessages(prev => prev.map(m => m.id === id ? { ...m, read: true } : m)) } const markAllAsRead = () => { setMessages(prev => prev.map(m => ({ ...m, read: true }))) } // 处理申诉次数请求 const handleAppealRequest = (messageId: string, action: 'approve' | 'reject') => { setMessages(prev => prev.map(m => { if (m.id === messageId && m.appealRequest) { return { ...m, read: true, appealRequest: { ...m.appealRequest, status: action === 'approve' ? 'approved' : 'rejected', }, } } return m })) } return (
{message.content}
{filter === 'unread' ? '没有未读消息' : '暂无消息'}