<template>
|
<div class="certificationCenter">
|
<fx-header :back="false" @back="loginOut">
|
<template #title>
|
<span>{{$t('实名认证')}}</span>
|
</template>
|
</fx-header>
|
|
<div class="kyc-body">
|
<!-- 用户信息卡片:邮箱 + personal -->
|
<div class="kyc-user-card">
|
<div class="kyc-user-email">{{ userEmail || '–' }}</div>
|
<div class="kyc-user-label">{{ $t('personalCenter') }}</div>
|
</div>
|
|
<!-- Primary 认证卡片 -->
|
<div class="kyc-card">
|
<div class="kyc-card-title-row">
|
<span class="kyc-card-title">{{ $t('Primary') }}</span>
|
<span v-if="kyc_status === 1" class="kyc-card-title-status">{{ $t('underReview') }}</span>
|
</div>
|
<div class="kyc-card-desc">{{ $t('kycPrimaryDesc') }}</div>
|
<div
|
class="kyc-btn"
|
:class="kyc_status === 1 ? 'kyc-btn--disabled' : 'kyc-btn--active'"
|
@click="kyc_status !== 1 && openUlr(1)"
|
>
|
{{ fixBtnState(kyc_status) }}
|
</div>
|
</div>
|
|
<!-- Senior 认证卡片 -->
|
<div class="kyc-card">
|
<div class="kyc-card-title">{{ $t('Senior') }}</div>
|
<div class="kyc-card-desc">{{ $t('kycSeniorDesc') }}</div>
|
<div
|
class="kyc-btn"
|
:class="primaryVerified ? 'kyc-btn--active' : 'kyc-btn--disabled'"
|
@click="primaryVerified && openUlr(2)"
|
>
|
{{ primaryVerified ? fixBtnState(advStatus) : $t('kycCompletePrimaryFirst') }}
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import { _getIdentify, _info } from "@/service/user.api.js";
|
import { onMounted, ref, computed } from 'vue';
|
import { useRouter } from "vue-router";
|
import { useI18n } from "vue-i18n";
|
|
const { t } = useI18n();
|
const router = useRouter();
|
|
const userEmail = ref('');
|
const kyc_status = ref(0);
|
const advStatus = ref(0);
|
const turnDownMsg = ref('');
|
|
const primaryVerified = computed(() => kyc_status.value === 2);
|
|
const loginOut = () => {
|
router.push('/my/index');
|
};
|
|
const getLocaluserAction = () => {
|
_info().then(res => {
|
userEmail.value = res.email || res.username || '';
|
kyc_status.value = res.kyc_status ?? 0;
|
advStatus.value = res.kyc_high_level_status ?? 0;
|
}).catch(() => {});
|
};
|
|
const getIdentify = () => {
|
_getIdentify().then(data => {
|
turnDownMsg.value = data.msg || '';
|
}).catch(() => {});
|
};
|
|
const fixBtnState = (status) => {
|
if (status === 0) return t('authentication');
|
if (status === 1) return t('auditDetails');
|
if (status === 2) return t('verified');
|
return t('authentication');
|
};
|
|
const openUlr = (index) => {
|
if (index === 1) router.push('/authentication');
|
else router.push('/advancedCtf');
|
};
|
|
onMounted(() => {
|
getLocaluserAction();
|
getIdentify();
|
});
|
</script>
|
|
<style lang="scss" scoped>
|
.certificationCenter {
|
min-height: 100vh;
|
background: #f5f5f5;
|
padding-bottom: 2rem;
|
font-size: 14px;
|
}
|
|
:deep(.van-nav-bar) {
|
background: #fff !important;
|
}
|
:deep(.van-nav-bar__title) {
|
color: #333;
|
font-weight: 700;
|
}
|
:deep(.van-icon) {
|
color: #333;
|
}
|
|
.kyc-body {
|
padding: 0 1.25rem;
|
}
|
|
/* 用户信息卡片:白底、圆角、内边距、邮箱加粗、personal 灰色 */
|
.kyc-user-card {
|
border-radius: 12px;
|
padding: 1.5rem 1.25rem;
|
margin-bottom: 1rem;
|
}
|
|
.kyc-user-email {
|
font-size: 16px;
|
font-weight: 700;
|
color: #333;
|
margin-bottom: 0.35rem;
|
}
|
|
.kyc-user-label {
|
font-size: 14px;
|
color: #999;
|
}
|
|
/* 认证卡片:白底、圆角、阴影 */
|
.kyc-card {
|
background: #fff;
|
border-radius: 12px;
|
padding: 1.5rem 1.25rem;
|
margin-bottom: 1rem;
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
}
|
|
.kyc-card-title-row {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 0.5rem;
|
}
|
.kyc-card-title {
|
font-size: 16px;
|
font-weight: 700;
|
color: #333;
|
}
|
.kyc-card-title-status {
|
font-size: 14px;
|
font-weight: 600;
|
color: #f97316;
|
}
|
|
.kyc-card-desc {
|
font-size: 14px;
|
color: #999;
|
margin-bottom: 1.25rem;
|
line-height: 1.4;
|
}
|
|
/* 按钮:圆角、全宽、字体 14px */
|
.kyc-btn {
|
height: 45px;
|
line-height: 45px;
|
text-align: center;
|
font-size: 14px;
|
font-weight: 600;
|
border-radius: 999px;
|
border: none;
|
width: 100%;
|
}
|
|
.kyc-btn--active {
|
color: #fff;
|
background: linear-gradient(90deg, #7c3aed, #b855d4);
|
cursor: pointer;
|
}
|
|
.kyc-btn--disabled {
|
color: rgba(255, 255, 255, 0.85);
|
background: linear-gradient(90deg, #d4c5f0, #e8c8e8);
|
cursor: not-allowed;
|
}
|
</style>
|