<script setup>
// Copyright 2024 FlexCDN root@flexcdn.cn. All rights reserved. Official site: https://flexcdn.cn .

import ctxRef from "@/utils/ctx_ref.js"
import Context from "./index.js"
import "./index.css"

const ctx = ctxRef(new Context())

</script>

<template>

	<div class="identities-box">
		<!-- 个人认证 -->
		<div class="identity-box" @click.prevent="ctx.goIndividual">
			<h5 class="!mb-4">个人实名认证</h5>

			<div v-if="ctx.individualIdentity != null">
				<div><a href="" class="real-name">{{ctx.individualIdentity.realName}}</a></div>
				<div class="status-box">
					<span v-if="ctx.individualIdentity.status == 'none'">等待提交</span>
					<span v-if="ctx.individualIdentity.status == 'submitted'">审核中</span>
					<span v-if="ctx.individualIdentity.status == 'rejected'" class="red">已驳回</span>
					<span v-if="ctx.individualIdentity.status == 'verified'" class="green">已认证</span>
				</div>
			</div>
			<div v-else>
				<a href="">尚未提交认证 &raquo;</a>
			</div>
		</div>

		<!-- 企业认证 -->
		<div class="identity-box" @click.prevent="ctx.goEnterprise">
			<h5 class="!mb-4">企业实名认证</h5>

			<div v-if="ctx.enterpriseIdentity != null">
				<div><a href="" class="real-name">{{ctx.enterpriseIdentity.realName}}</a></div>
				<div class="status-box">
					<span v-if="ctx.enterpriseIdentity.status == 'none'">等待提交</span>
					<span v-if="ctx.enterpriseIdentity.status == 'submitted'">审核中</span>
					<span v-if="ctx.enterpriseIdentity.status == 'rejected'" class="red">已驳回</span>
					<span v-if="ctx.enterpriseIdentity.status == 'verified'" class="green">已认证</span>
				</div>
			</div>
			<div v-else>
				<a href="">尚未提交认证 &raquo;</a>
			</div>
		</div>
	</div>
</template>

<style lang="postcss" scoped>
</style>