auth.vue 2.28 KB
<template>
    <div class="mine_auth_wrap">
        <div class="auth_bg">
            <el-image class="col_img" :src="getImage(state.userInfo.identityTypeStatus == '1' ? 'auth-suc.png':'auth-ing.png', '/mine')"></el-image>
            <div v-if="state.userInfo.identityTypeStatus == '0'">您的实名信息正在认证中</div>
            <div v-else-if="state.userInfo.identityTypeStatus == '1'">您已完成实名认证</div>
            <div v-else-if="state.userInfo.identityTypeStatus == '2'">实名认证失败</div>
            <div v-else>您的企业还未认证</div>
        </div>
        <template v-if="state.userInfo.identityTypeStatus == '0' || state.userInfo.identityTypeStatus == '1'">
            <div class="auth_info" v-if="state.authInfo">
                <div class="info_col">
                    <div>企业名称</div>
                    <div>{{state.authInfo.companyName}}</div>
                </div>
                <div class="info_col">
                    <div>统一社会信用代码</div>
                    <div>{{state.authInfo.uscCode}}</div>
                </div>
            </div>

            <div class="core_title">所属核心企业</div>
            <div class="core_wrap">
                <div class="core_name" v-if="state.authInfo">
                    <template v-for="item in state.authInfo.coreEnterprise">
                        <span>{{item.companyName}}</span><br/>
                    </template>
                </div>
            </div>
        </template>
    </div>
</template>

<script setup lang="ts">
    import getImage from './../../assets/getImage'
    import './../../assets/css/mineAuth.scss'
    import router from "../../router/index";
    import { loginMain } from './../../store/index'
    import { storeToRefs } from 'pinia';
    import * as api from "../../interface/api";
    let loginAct = loginMain()
    let { getUserInfo } = storeToRefs(loginAct)

    let state = reactive({
        userInfo: null,
        authInfo: undefined
    })

    watchEffect(() => {
        state.userInfo = getUserInfo
    })

    api.getAuthStatus().then(res=> {
        state.authInfo = res.data
    })

    let linkTo = (url: string) => {
        router.push(url)
    }

    const arrowPath = ref("/mine")
    defineExpose({arrowPath})
</script>

<style scoped>

</style>