lxf
2025-07-08 b37eef5a0807a8f5688e2112591cb80a3ba333e4
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
<template>
    <div class="advancedCtf">
        <fx-header @back="loginOut">
            <template #title>
                {{ $t('advancedCertification') }}
            </template>
        </fx-header>
        <div class="flex items-center justify-center pt-5 pb-5" v-if="status != 0">
            <img src="@/assets/image/kyc/advStatus1.png" v-if="status == 1" alt="" class="advStatus" />
            <img src="@/assets/image/kyc/advStatus2.png" v-if="status == 2" alt="" class="advStatus" />
            <img src="@/assets/image/kyc/advStatus3.png" v-if="status == 3" alt="" class="advStatus" />
            <span class="font-32 textColor">{{ fixState(status) }}</span>
        </div>
        <div class="error-title font-32  py-5 px-5" v-if="status == 3"  >{{errMsg}}</div>
        <div class="t2">
            <ExInput :label="$t('realName')" :disabled="true" :clearBtn="false" :placeholderText="$t('entryRealName')"
                v-model="name" />
            <ExInput :label="$t('workAddress')" :max="25" :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc1')" v-model="address" />
            <ExInput :label="$t('familyAddress')" :max="25"  :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc2')" v-model="familyAddress" />
        </div>
        <div class="diviLine"></div>
        <div class="t2">
            <ExInput :label="$t('relationshipwithme')" :max="25" :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc3')" v-model="relationMy" />
            <ExInput :label="$t('relativeName')" :max="25" :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc4')" v-model="relativesName" />
            <ExInput :label="$t('relativeAddress')" :max="25" :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc5')" v-model="relativesAddress" />
            <ExInput :label="$t('relativePhone')" :max="25" :disabled="disabled()" :clearBtn="!disabled()"
                :placeholderText="$t('verifyKyc6')" v-model="relativesPhone" />
            <div class="btnMain text-white font-32 py-26 rounded-lg text-center t3" @click="submit"
                v-if="status == 0 || status == 3">
                <span v-if="status == 0">{{ $t('Apply') }}</span>
                <span v-if="status == 3">{{ $t('restApply') }}</span>
            </div>
        </div>
    </div>
</template>
 
<script setup>
import { _getKycHighLevel, _kycHighLevelApply } from "@/service/user.api.js";
import { onMounted, ref } from 'vue';
import { useRouter } from "vue-router";
import { showToast } from "vant"
import ExInput from "@/components/ex-input/index.vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n()
const router = useRouter()
 
const status = ref('')
const name = ref('')
const address = ref('')
const familyAddress = ref('')
const relationMy = ref('')
const relativesName = ref('')
const relativesAddress = ref('')
const relativesPhone = ref('')
const errMsg = ref('')
onMounted(() => {
    getInfo();
})
const disabled = () => {
    return ![0, 3, ''].includes(status.value)
}
const getInfo = () => {
    _getKycHighLevel()
        .then(res => {
            status.value = res.status || 0
            name.value = res.realName
            address.value = res.work_place
            familyAddress.value = res.home_place
            relationMy.value = res.relatives_relation
            relativesName.value = res.relatives_name
            relativesAddress.value = res.relatives_place
            relativesPhone.value = res.relatives_phone
            errMsg.value = res.msg
        })
}
// import ExInput from "@/components/ex-input";
// export default {
 
 
const fixState = (status) => {
    let str = ''
    if (status == 1) {
        str = t('reviewing')
    } else if (status == 2) {
        str = t('certified')
    } else if (status == 3) {
        str = t('Authenticationfailed')
    }
    return str;
}
const loginOut = () => {
    router.push('/certificationCenter')
}
const submit = () => {
    if (address.value == '' || address.value == null) {
        showToast(t('verifyKyc7'))
        return false;
    }
    if (familyAddress.value == '' || familyAddress.value == null) {
        showToast(t('verifyKyc8'))
        return false;
    }
    if (relationMy.value == '' || relationMy.value == null) {
        showToast(t('verifyKyc9'))
        return false;
    }
    if (relativesName.value == '' || relativesName.value == null) {
        showToast(t('verifyKyc10'))
        return false;
    }
    if (relativesAddress.value == '' || relativesAddress.value == null) {
        showToast(t('verifyKyc11'))
        return false;
    }
    if (relativesPhone.value == '' || relativesPhone.value == null) {
        showToast(t('verifyKyc12'))
        return false;
    }
    _kycHighLevelApply({
        work_place: address.value,
        home_place: familyAddress.value,
        relatives_relation: relationMy.value,
        relatives_name: relativesName.value,
        relatives_place: relativesAddress.value,
        relatives_phone: relativesPhone.value,
    }).then(res => {
        router.push('/verified')
        showToast(t('submitSuccess'));
    }).catch(err => {
        if (err.code === 'ECONNABORTED') { showToast('网络超时!'); }
        else if (err.msg !== undefined) { showToast(this.err.msg); }
    })
}
</script>
 
<style lang="scss" scoped>
.advancedCtf {
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 50px;
}
 
.t2 {
    padding-left: 2rem;
    padding-right: 2rem;
}
 
.t3 {
    border-radius: 0.5rem;
    height: 36px;
    line-height: 36px;
}
 
.advStatus {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}
 
.font-32 {
    font-size: 16px;
}
 
.error-title {
    word-wrap: break-word;
    word-break: break-all;
    color: $red;
    text-align: center;
}
</style>