diff --git a/app/(account)/notifications/page.tsx b/app/(account)/notifications/page.tsx index a1f004c..ecd7e03 100644 --- a/app/(account)/notifications/page.tsx +++ b/app/(account)/notifications/page.tsx @@ -1,8 +1,119 @@ +import { Bell, CheckCheck, MessageSquare, ShoppingBag } from "lucide-react" +import Link from "next/link" +import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { Card, CardContent } from "@/components/ui/card" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { mockNotifications } from "@/lib/mock-data" +import type { Notification } from "@/lib/types" + +const typeIcons: Record = { + order: ShoppingBag, + community: MessageSquare, + system: Bell, +} + +const typeLabels: Record = { + order: "订单", + community: "社区", + system: "系统", +} + +function NotificationItem({ notification }: { notification: Notification }) { + const Icon = typeIcons[notification.type] + const content = ( +
+
+ +
+
+
+ {notification.title} + {!notification.read && } +
+

{notification.content}

+

+ {new Date(notification.createdAt).toLocaleString("zh-CN")} +

+
+ + {typeLabels[notification.type]} + +
+ ) + + return notification.link ? {content} : content +} + export default function NotificationsPage() { + const unreadCount = mockNotifications.filter((n) => !n.read).length + const orderNotifs = mockNotifications.filter((n) => n.type === "order") + const communityNotifs = mockNotifications.filter((n) => n.type === "community") + const systemNotifs = mockNotifications.filter((n) => n.type === "system") + return ( -
-

通知中心

-

订单通知、社区通知、系统通知

+
+
+
+

通知中心

+ {unreadCount > 0 && {unreadCount} 条未读} +
+ +
+ + + + 全部 + 订单 + 社区 + 系统 + + + + {mockNotifications.map((n) => ( + + ))} + + + + {orderNotifs.length === 0 ? ( + + + 暂无订单通知 + + + ) : ( + orderNotifs.map((n) => ) + )} + + + + {communityNotifs.length === 0 ? ( + + + 暂无社区通知 + + + ) : ( + communityNotifs.map((n) => ) + )} + + + + {systemNotifs.length === 0 ? ( + + + 暂无系统通知 + + + ) : ( + systemNotifs.map((n) => ) + )} + +
) } diff --git a/app/(account)/settings/page.tsx b/app/(account)/settings/page.tsx index 0fcc675..21a1248 100644 --- a/app/(account)/settings/page.tsx +++ b/app/(account)/settings/page.tsx @@ -1,8 +1,124 @@ +"use client" + +import { Camera } from "lucide-react" +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" +import { Button } from "@/components/ui/button" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group" +import { Separator } from "@/components/ui/separator" +import { Switch } from "@/components/ui/switch" +import { Textarea } from "@/components/ui/textarea" +import { currentUser } from "@/lib/mock-data" +import { useAuthStore } from "@/store/auth" + export default function SettingsPage() { + const { currentRole, switchRole } = useAuthStore() + return ( -
+

个人设置

-

资料编辑、身份切换、联系方式、通知偏好

+ + + + 头像 + + +
+ + + {currentUser.nickname[0]} + + +
+

点击更换头像,支持 JPG、PNG 格式

+
+
+ + + + 基本信息 + + +
+ + +
+
+ +