2025-04-19 12:56:32 +08:00
|
|
|
|
import Page from '@/components/page'
|
2025-04-29 18:47:36 +08:00
|
|
|
|
import {Card, CardContent, CardHeader, CardTitle} from '@/components/ui/card'
|
2025-11-20 18:01:54 +08:00
|
|
|
|
import {CheckCircle} from 'lucide-react'
|
2025-04-29 18:47:36 +08:00
|
|
|
|
import Image from 'next/image'
|
|
|
|
|
|
import banner from '@/app/admin/identify/_assets/banner.webp'
|
|
|
|
|
|
import RechargeModal from '@/components/composites/recharge'
|
2025-07-08 13:52:13 +08:00
|
|
|
|
import {RealnameAuthDialog} from '@/components/composites/dialogs/realname-auth-dialog'
|
|
|
|
|
|
import {ChangePasswordDialog} from '@/components/composites/dialogs/change-password-dialog'
|
2025-11-20 18:01:54 +08:00
|
|
|
|
import {getProfile} from '@/actions/auth'
|
|
|
|
|
|
import {Aftersale, BasicForm} from './clients'
|
2025-04-19 12:56:32 +08:00
|
|
|
|
|
|
|
|
|
|
export type ProfilePageProps = {}
|
|
|
|
|
|
|
2025-11-20 18:01:54 +08:00
|
|
|
|
export default async function ProfilePage(props: ProfilePageProps) {
|
|
|
|
|
|
const profile = await getProfile()
|
|
|
|
|
|
if (!profile.success) {
|
2025-04-19 12:56:32 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<Page>
|
2025-11-20 18:01:54 +08:00
|
|
|
|
获取用户信息失败
|
2025-04-19 12:56:32 +08:00
|
|
|
|
</Page>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-20 18:01:54 +08:00
|
|
|
|
const user = profile.data
|
2025-04-19 12:56:32 +08:00
|
|
|
|
return (
|
2025-06-10 19:09:19 +08:00
|
|
|
|
<Page className="lg:flex-row lg:items-stretch md:flex-col max-sm:flex-col">
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<div className="flex-3/4 flex flex-col gap-4">
|
2025-04-29 18:47:36 +08:00
|
|
|
|
{/* banner */}
|
2025-11-18 19:16:24 +08:00
|
|
|
|
<section className="flex-none relative rounded-lg p-16 pr-4 overflow-hidden flex max-sm:flex-col flex-col gap-4 pl-8 justify-center">
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<Image src={banner} alt="背景图" aria-hidden className="absolute inset-0 w-full h-full object-cover"/>
|
|
|
|
|
|
<h3 className="text-lg font-bold z-10 relative">蓝狐HTTP邀请您参与【先测后买】服务</h3>
|
2025-11-18 19:16:24 +08:00
|
|
|
|
<p className="text-sm text-gray-600 z-10 relative">为了保障您的账户安全,请先完成实名认证,即可获取福利套餐测试资格</p>
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 块信息 */}
|
2025-11-18 19:16:24 +08:00
|
|
|
|
<div className="flex gap-4 max-md:flex-col max-sm:flex-col">
|
2025-04-29 18:47:36 +08:00
|
|
|
|
|
2025-06-10 19:09:19 +08:00
|
|
|
|
<Card className="flex-1 ">
|
2025-04-19 12:56:32 +08:00
|
|
|
|
<CardHeader>
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<CardTitle className="font-normal">帐号余额(元)</CardTitle>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
</CardHeader>
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<CardContent className="flex-auto flex justify-between items-center px-8">
|
2025-11-20 18:01:54 +08:00
|
|
|
|
<p className="text-xl">{user.balance}</p>
|
2025-04-30 10:42:47 +08:00
|
|
|
|
<RechargeModal classNames={{
|
|
|
|
|
|
trigger: `h-10 px-6`,
|
|
|
|
|
|
}}/>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
</CardContent>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<Card className="flex-1">
|
2025-04-29 18:47:36 +08:00
|
|
|
|
<CardHeader>
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<CardTitle className="font-normal">实名认证</CardTitle>
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</CardHeader>
|
2025-06-10 19:09:19 +08:00
|
|
|
|
<CardContent className="flex-auto flex justify-between items-center gap-4 px-4 pr-8">
|
2025-11-20 18:01:54 +08:00
|
|
|
|
{!user.id_token
|
2025-06-07 11:49:57 +08:00
|
|
|
|
? (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<p className="text-sm">为了保障您的账户安全和正常使用服务,请您尽快完成实名认证</p>
|
2025-07-08 13:52:13 +08:00
|
|
|
|
<RealnameAuthDialog
|
2025-11-20 18:01:54 +08:00
|
|
|
|
hasAuthenticated={!!user.id_token}
|
2025-07-08 13:52:13 +08:00
|
|
|
|
triggerClassName="w-24"
|
|
|
|
|
|
/>
|
2025-06-07 11:49:57 +08:00
|
|
|
|
</>
|
|
|
|
|
|
)
|
|
|
|
|
|
: (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<p className="flex flex-col gap-1">
|
2025-11-20 18:01:54 +08:00
|
|
|
|
<span>{user.name}</span>
|
|
|
|
|
|
<span className="text-sm">{user.id_no}</span>
|
2025-06-07 11:49:57 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
<p className="flex gap-1 items-center">
|
|
|
|
|
|
<CheckCircle className="text-done" size={18}/>
|
|
|
|
|
|
<span>已认证</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</>
|
|
|
|
|
|
)}
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</CardContent>
|
|
|
|
|
|
</Card>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-11-18 19:16:24 +08:00
|
|
|
|
<div className="flex-none rounded-lg bg-white p-4 flex max-sm:flex-col flex-col gap-8">
|
2025-04-19 12:56:32 +08:00
|
|
|
|
|
2025-04-29 18:47:36 +08:00
|
|
|
|
{/* 安全信息 */}
|
2025-06-07 11:49:57 +08:00
|
|
|
|
<div className="flex flex-col gap-4">
|
|
|
|
|
|
<h3 className="font-normal">安全信息</h3>
|
|
|
|
|
|
<div className="flex gap-4 items-center">
|
2025-11-20 18:01:54 +08:00
|
|
|
|
<p>{user.phone}</p>
|
2025-07-08 13:52:13 +08:00
|
|
|
|
<ChangePasswordDialog triggerClassName="w-24 h-9"/>
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
|
2025-04-29 18:47:36 +08:00
|
|
|
|
{/* 基本信息 */}
|
2025-11-20 18:01:54 +08:00
|
|
|
|
<BasicForm profile={user}/>
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
|
2025-04-29 18:47:36 +08:00
|
|
|
|
{/* 侧边栏:客服经理信息 */}
|
2025-11-20 18:01:54 +08:00
|
|
|
|
<Aftersale profile={user}/>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
|
2025-04-29 18:47:36 +08:00
|
|
|
|
</Page>
|
2025-04-19 12:56:32 +08:00
|
|
|
|
)
|
|
|
|
|
|
}
|