<template>
    <view class="layout-page" :style="themeStyle">
        <v-header :title="$t('auth.a0')" :leftClick="leftClick"></v-header>
        <view class="rounded-md m-lg">
			 <!-- overflow-hidden -->
            <v-link  :to="detail.primary_status!=2&&detail.primary_status!=1?'/pages/auth/primary':''" style="margin-bottom: 20rpx;border-radius: 10px;" class="d-flex align-center p-md link-active bg-panel-3 box-shadow">
                <view class="flex-fill color-light fn-lg">
                    {{$t('auth.a1')}}
                </view>
                <view class="status" v-if="detail.primary_status==0">
                    <van-icon class="fn-middle" name="info-o" />
                    {{$t('auth.a2')}}
                </view>
				<view class="status color-yellows" v-else-if="detail.primary_status==2">
				    <van-icon class="fn-middle" name="clock-o" />
				    {{$t('auth.a5')}}
				</view>
				<view class="status color-buy" v-else-if="detail.primary_status==1">
				    <van-icon class="fn-middle" name="passed" />
				    {{$t('auth.a3')}}
				</view>
				<view class="status color-sell" v-else-if="detail.primary_status==3">
				    <van-icon class="fn-middle" name="close" />
				    {{$t('auth.a6')}}
				</view>
                <van-icon class="m-l-xs" name="arrow" />
            </v-link>
			<view v-if="detail.primary_status==3" style="word-wrap:break-word;" class="color-sell"><van-icon class="m-l-xs" name="info-o" style="display: inline-block;" />{{detail.remark}}</view>
            <v-link tag="view" :to="detail.status!=2&&detail.status!=1&&detail.primary_status==1?'/pages/auth/senior':''" style="border-radius: 10px;" class="d-flex align-center  p-md link-active  bg-panel-3 box-shadow">
                 <!-- border-b -->
				<view class="flex-fill color-light fn-lg ">
                    {{$t('auth.a4')}}
                </view>
                <view class="status " v-if="detail.status==0">
                    <van-icon class="fn-middle" name="info-o" />
                    {{$t('auth.a2')}}
                </view>
                <view class="status color-yellows" v-else-if="detail.status==1">
                    <van-icon class="fn-middle" name="clock-o" />
                    {{$t('auth.a5')}}
                </view>
                <view class="status color-buy" v-else-if="detail.status==2">
                    <van-icon class="fn-middle" name="passed" />
                    {{$t('auth.a3')}}
                </view>
                <view class="status color-sell" v-else-if="detail.status==3">
                    <van-icon class="fn-middle" name="close" />
                    {{$t('auth.a6')}}
                </view>
                <van-icon class="m-l-xs" name="arrow" />
            </v-link>
        </view>
        <view v-if="detail.status==3" class="m-l-lg color-sell"><van-icon class="m-l-xs" name="info-o" />{{detail.remark}}</view>
    </view>
</template>
<script>
import { mapState,mapGetters} from "vuex";
import Profile from "@/api/profile";
export default {
    name:'auth',
    data(){
        return {
            detail:{}
        }
    },
    computed:{
        ...mapState({
            user:'user'
        }),
        ...mapGetters(['themeStyle'])
    },
    methods:{
        getAuthInfo(){
            Profile.getAuthInfo().then(res=>{
                this.detail = res.data
            })
        },
				leftClick(){
					// console.info(this.$route.query)
					if(this.$route.query.type==1){
						this._router.push("/pages/base/index");
					}else{
						this.$back();
					}
				}
    },
		onShow() {
			this.getAuthInfo()
		},
    created(){
        this.getAuthInfo()
    }
}
</script>
<style lang="scss" scoped>

</style>