|
@@ -1,31 +1,48 @@
|
|
<template>
|
|
<template>
|
|
<div v-if="authentication" class="ml-3">
|
|
<div v-if="authentication" class="ml-3">
|
|
- <div>
|
|
|
|
|
|
+ <div class="topTip" v-if="info.status === '0'">审核中,请耐心等待</div>
|
|
|
|
+ <div v-if="info.status === '1'">
|
|
<v-icon color="primary">mdi-check-circle</v-icon>
|
|
<v-icon color="primary">mdi-check-circle</v-icon>
|
|
已通过实名认证
|
|
已通过实名认证
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="topTip" v-if="info.status === '2'">
|
|
|
|
+ 认证已被驳回,原因:{{ info.reason }}
|
|
|
|
+ </div>
|
|
<div class="box mt-5">
|
|
<div class="box mt-5">
|
|
- <div>姓名:史迪奇</div>
|
|
|
|
- <div class="mt-5">身份证号:4******************8</div>
|
|
|
|
|
|
+ <div>姓名:{{ info.name }}</div>
|
|
|
|
+ <div class="my-5">身份证号:{{ maskNumber(info.identityNo) }}</div>
|
|
|
|
+ <div class="d-flex" v-if="info.status !== '1'">
|
|
|
|
+ <span>国徽照</span>
|
|
|
|
+ <div class="ml-10" style="width: 120px; height: 120px;">
|
|
|
|
+ <v-img :src="info.backUrl" width="120" height="120" rounded alt=""/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="d-flex mt-5" v-if="info.status !== '1'">
|
|
|
|
+ <span>人像照</span>
|
|
|
|
+ <div class="ml-10" style="width: 120px; height: 120px;">
|
|
|
|
+ <v-img :src="info.frontUrl" width="120" height="120" rounded alt=""/>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <v-btn color="primary" class="half-button mt-5" @click="authentication = !authentication">解绑</v-btn>
|
|
|
|
|
|
+ <v-btn v-if="info.status === '2'" class="buttons mt-5" color="primary" @click="handleAgain">重新认证</v-btn>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<div v-else>
|
|
<div v-else>
|
|
- <div class="topTip">为了您在平台有更好的操作体验,请进行实名认证</div>
|
|
|
|
- <div class="d-flex align-center justify-center flex-column">
|
|
|
|
|
|
+ <div class="topTip" v-if="info.status !== '2'">为了您在平台有更好的操作体验,请进行实名认证</div>
|
|
|
|
+ <div class="d-flex align-center justify-center flex-column mt-5">
|
|
<CtForm ref="CtFormRef" :items="formItems" style="width: 300px;">
|
|
<CtForm ref="CtFormRef" :items="formItems" style="width: 300px;">
|
|
- <template #idCardImg1="{ item }">
|
|
|
|
|
|
+ <template #backUrl="{ item }">
|
|
<div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
|
|
<div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
|
|
- <Img @success="val => item.value = val" @delete="item.value = ''"></Img>
|
|
|
|
|
|
+ <Img :value="item.value" @success="val => item.value = val" @delete="item.value = ''"></Img>
|
|
</template>
|
|
</template>
|
|
- <template #idCardImg2="{ item }">
|
|
|
|
|
|
+ <template #frontUrl="{ item }">
|
|
<div class="mt-5 d-flex">
|
|
<div class="mt-5 d-flex">
|
|
<div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
|
|
<div class="color-666 font-size-14 mr-5">{{ item.label }}</div>
|
|
- <Img @success="val => item.value = val" @delete="item.value = ''"></Img>
|
|
|
|
|
|
+ <Img :value="item.value" @success="val => item.value = val" @delete="item.value = ''"></Img>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</CtForm>
|
|
</CtForm>
|
|
- <v-btn class="buttons mt-5" color="primary" @click="authentication = !authentication">{{ $t('common.submit') }}</v-btn>
|
|
|
|
|
|
+ <v-btn class="buttons mt-5" color="primary" @click="handleSave">{{ $t('common.submit') }}</v-btn>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -33,10 +50,15 @@
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({ name: 'authentication-page'})
|
|
defineOptions({ name: 'authentication-page'})
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
|
|
+import { isValidIdCard18, maskNumber } from '@/utils/validate'
|
|
|
|
+import { getEnterpriseAuth, saveEnterpriseAuth } from '@/api/recruit/enterprise/information'
|
|
|
|
+import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
// 是否已实名
|
|
// 是否已实名
|
|
-const authentication = ref(true)
|
|
|
|
|
|
+const info = ref({})
|
|
|
|
+const authentication = ref(false)
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
|
|
+const query = ref({})
|
|
|
|
|
|
const formItems = ref({
|
|
const formItems = ref({
|
|
options: [
|
|
options: [
|
|
@@ -49,19 +71,34 @@ const formItems = ref({
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
- key: 'idCardNo',
|
|
|
|
|
|
+ key: 'identityNo',
|
|
value: '',
|
|
value: '',
|
|
label: '身份证号码 *',
|
|
label: '身份证号码 *',
|
|
- rules: [v => !!v || '请输入您的身份证号码']
|
|
|
|
|
|
+ rules: [
|
|
|
|
+ value => {
|
|
|
|
+ if (!value) {
|
|
|
|
+ return '请输入您的身份证号码'
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+ value => {
|
|
|
|
+ if (!isValidIdCard18(value)) {
|
|
|
|
+ return '请输入正确的身份证号码'
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- slotName: 'idCardImg1',
|
|
|
|
|
|
+ slotName: 'backUrl',
|
|
|
|
+ key: 'backUrl',
|
|
value: '',
|
|
value: '',
|
|
label: '身份证-国徽照 *',
|
|
label: '身份证-国徽照 *',
|
|
rules: [v => !!v || '请上传']
|
|
rules: [v => !!v || '请上传']
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- slotName: 'idCardImg2',
|
|
|
|
|
|
+ key: 'frontUrl',
|
|
|
|
+ slotName: 'frontUrl',
|
|
value: '',
|
|
value: '',
|
|
label: '身份证-人像照 *',
|
|
label: '身份证-人像照 *',
|
|
rules: [v => !!v || '请上传']
|
|
rules: [v => !!v || '请上传']
|
|
@@ -69,6 +106,36 @@ const formItems = ref({
|
|
]
|
|
]
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const getData = async () => {
|
|
|
|
+ const data = await getEnterpriseAuth()
|
|
|
|
+ if (!data) return authentication.value = false
|
|
|
|
+ authentication.value = true
|
|
|
|
+ info.value = data
|
|
|
|
+}
|
|
|
|
+getData()
|
|
|
|
+
|
|
|
|
+const handleAgain = () => {
|
|
|
|
+ formItems.value.options.forEach(item => {
|
|
|
|
+ item.value = info.value[item.key]
|
|
|
|
+ })
|
|
|
|
+ query.value.id = info.value.id
|
|
|
|
+ authentication.value = false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 提交实名认证
|
|
|
|
+const handleSave = async () => {
|
|
|
|
+ const { valid } = await CtFormRef.value.formRef.validate()
|
|
|
|
+ if (!valid) return
|
|
|
|
+ formItems.value.options.forEach(item => {
|
|
|
|
+ query.value[item.key] = item.value
|
|
|
|
+ })
|
|
|
|
+ if (!query.value.backUrl || !query.value.frontUrl) return Snackbar.warning('请上传您的身份证照片')
|
|
|
|
+
|
|
|
|
+ await saveEnterpriseAuth(query.value)
|
|
|
|
+ Snackbar.success('提交成功')
|
|
|
|
+ query.value = {}
|
|
|
|
+ getData()
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|