diff --git a/app/(account)/settings/page.tsx b/app/(account)/settings/page.tsx index 21a1248..59363d7 100644 --- a/app/(account)/settings/page.tsx +++ b/app/(account)/settings/page.tsx @@ -1,6 +1,7 @@ "use client" import { Camera } from "lucide-react" +import Link from "next/link" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" @@ -11,10 +12,13 @@ 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 type { UserRole } from "@/lib/types" import { useAuthStore } from "@/store/auth" export default function SettingsPage() { - const { currentRole, switchRole } = useAuthStore() + const { currentRole, verifiedRoles, switchRole } = useAuthStore() + + const isRoleVerified = (role: UserRole) => verifiedRoles.includes(role) return (
@@ -68,22 +72,57 @@ export default function SettingsPage() { 身份切换 -

切换身份后,导航和功能将对应变化

+

切换身份后,导航和功能将对应变化

switchRole(v as "consumer" | "player" | "owner")} + onValueChange={(v) => { + const role = v as UserRole + if (isRoleVerified(role)) { + switchRole(role) + } + }} > -
- - +
+
+ + +
-
- - +
+
+ + +
+ {!isRoleVerified("player") && ( + + 去认证 + + )}
-
- - +
+
+ + +
+ {!isRoleVerified("owner") && ( + + 去认证 + + )}