1
2026-05-23 30d1ee7be942d7a2201e1ab2ca7d96badff8bf50
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<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>