<template>
	<div class="register">
		<el-row >
			<el-col :xl="{span:14,offset:5}" :lg="{span:14,offset:5}" :md="{span:16,offset:4}" :sm="{span:20,offset:2}" :xs="{span:24}" style="min-height: 100vh;background-color: #fff;">
				<div class=" m-b-20">
					<img src="../assets/images/ad3.png" alt="" style="width: 100%;" />
				</div>
				<div class="m-b-20">
					<el-steps :active="active" align-center finish-status="success" process-status="finish">
						<el-step title="步骤一" description="填写基本信息"></el-step>
						<el-step title="步骤二" description="填写邮寄信息"></el-step>
						<el-step title="步骤三" description="注册成功"></el-step>
					</el-steps>
				</div>
				<div style="padding:20px 60px 20px 60px ;">
					<base-info v-if="active!=2" @submitSuccess="submitSuccess"></base-info>
					<div v-else>
						<div style="font-size:30px;text-align: center;color: #606266;">
							企业注册成功，请等待审核！
						</div>
						<div class="flex-ac-jc m-t-20" style="font-size: 14px;color: #909399;">
							页面将在
							<span style="font-size: 16px;font-weight: bold;padding: 0 4px;">{{time}}</span>
							秒钟后返回
							 <!-- <el-button type="text" style="margin-left: 6px;">登录页</el-button> -->
							 <router-link class="link-type" :to="'/login'" style="margin-left: 4px;">登录页</router-link>
						</div>
					</div>
				</div>
			</el-col>
		</el-row>
	</div>
</template>

<script>
	// import {
	// 	getCodeImg,
	// 	register
	// } from "@/api/login";
	import baseInfo from "./components/zhuce/baseInfo.vue"
	export default {
		name: "Register",
		components:{
			baseInfo
		},
		data() {
			return {
				active:0,
				time:10,
				jsq:null,
			}
		},
		created(){
			
		},
		watch:{
			time:{
				handler:function(n,o){
					console.log(n)
					if(n==0){
						this.back()
					}
				}
			}
		},
		methods: {
			submitSuccess(e){
				this.active = e
				if(e==2){
					this.jsq = setInterval(()=>{
						this.time--
					},1000)
				}
				
			},
			back(){
				clearInterval(this.jsq)
				this.$router.push({
					path:"/login"
				})
			}
			
		}
	};
</script>

<style scoped lang="scss">
	.register{
		background-color: #F4F4F7;
		min-height: 100vh;
	}
</style>