"use client" import { CheckCircle, Clock, ShieldCheck, Upload } from "lucide-react" import { useEffect, useRef, useState } from "react" import { Badge } from "@/components/ui/badge" 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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select" import { Separator } from "@/components/ui/separator" import { Textarea } from "@/components/ui/textarea" import type { UserRole } from "@/lib/types" import { useAuthStore } from "@/store/auth" export default function VerifyPage() { const [verifyRole, setVerifyRole] = useState("") const verificationStatus = useAuthStore((state) => state.verificationStatus) const verificationReasons = useAuthStore((state) => state.verificationReasons) const verifiedRoles = useAuthStore((state) => state.verifiedRoles) const submitVerification = useAuthStore((state) => state.submitVerification) const approveVerification = useAuthStore((state) => state.approveVerification) const timersRef = useRef>>(new Map()) useEffect( () => () => { timersRef.current.forEach((timer) => { clearTimeout(timer) }) timersRef.current.clear() }, [], ) const submitWithMockApproval = (role: UserRole) => { submitVerification(role) const oldTimer = timersRef.current.get(role) if (oldTimer) { clearTimeout(oldTimer) } const timer = setTimeout(() => { approveVerification(role) timersRef.current.delete(role) }, 3000) timersRef.current.set(role, timer) } const roleMeta: { role: UserRole; label: string }[] = [ { role: "player", label: "打手认证" }, { role: "owner", label: "店主认证" }, ] return (

身份认证

认证说明
通过身份认证后,你可以成为打手或店主,开始接单或经营店铺
认证信息仅用于平台审核,不会对外展示
认证状态 {roleMeta.map((item) => { const status = verificationStatus[item.role] const reason = verificationReasons[item.role] return (
{item.label} {status === "approved" || verifiedRoles.includes(item.role) ? ( 已通过 ) : status === "pending" ? ( 审核中 ) : status === "rejected" ? ( 未通过 ) : ( 未申请 )}
{status === "rejected" && (

驳回原因:{reason}

)} {status === "rejected" && ( )}
) })}
申请认证