修复实名认证阶段的问题
This commit is contained in:
@@ -98,6 +98,16 @@ export default function IdentifyPage(props: IdentifyPageProps) {
|
||||
const profile = useProfileStore(store => store.profile)
|
||||
const refreshProfile = useProfileStore(store => store.refreshProfile)
|
||||
|
||||
// 重置认证流程
|
||||
const handleDialogOpenChange = async (open: boolean) => {
|
||||
setOpenDialog(open)
|
||||
if (!open) {
|
||||
setStep('form')
|
||||
setTarget('')
|
||||
await refreshProfile()
|
||||
}
|
||||
}
|
||||
|
||||
// ======================
|
||||
// render
|
||||
// ======================
|
||||
@@ -125,7 +135,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
|
||||
</div>
|
||||
<Suspense>
|
||||
<IfNotIdentofy>
|
||||
<Dialog open={openDialog} onOpenChange={setOpenDialog}>
|
||||
<Dialog open={openDialog} onOpenChange={handleDialogOpenChange}>
|
||||
<DialogTrigger asChild>
|
||||
<Button className="w-full">去认证</Button>
|
||||
</DialogTrigger>
|
||||
@@ -165,10 +175,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
|
||||
<div className="flex flex-col gap-4 items-center">
|
||||
<canvas ref={canvas} width={256} height={256}/>
|
||||
<p className="text-sm text-gray-600">请扫码完成认证</p>
|
||||
<Button onClick={async () => {
|
||||
await refreshProfile()
|
||||
setOpenDialog(false)
|
||||
}}>
|
||||
<Button onClick={() => handleDialogOpenChange(false)}>
|
||||
已完成认证
|
||||
</Button>
|
||||
</div>
|
||||
@@ -223,7 +230,7 @@ export default function IdentifyPage(props: IdentifyPageProps) {
|
||||
<p className="flex gap-2 items-center justify-between w-56 self-center">
|
||||
<span className="flex gap-2">
|
||||
<span className="bg-primary/25 text-primary w-8 h-8 rounded-full flex items-center justify-center">03</span>
|
||||
<span>充值、支付</span>
|
||||
<span>支付订单</span>
|
||||
</span>
|
||||
<Image alt="步骤配图" src={step3}/>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user