<template>
	<!-- <view class="mybody df fdc aic"> -->
	<view class="mybody bgclF8 df fdc">
		<TopMenu ref="TopMenu"></TopMenu>
		<!-- 中间那块登录输入密码之类的 -->
		<view v-show="visibleLogin" class="df jcc aic content">
			<view class="df aic login-center">
				<view>
					<view class="login-lefttitle1">虚拟仿真实验网站首页</view>
					<view class="login-lefttitle2">记录产品分享设计</view>
					<view class="login-leftpic">
						<img src="../../assets/login/loginPic1.png" />
					</view>
				</view>
				<!-- 中间竖线 -->
				<view class="login-middleline"></view>
				<ChooseRole v-show="visibleChooseRole" v-on:onChoose="onChoose"></ChooseRole>
				<LoginByPWD class="showborder" v-show="visibleLoginByPWD" v-on:onLogin="onLogin" v-on:onForget="onForget"></LoginByPWD>
				<ResetPWD v-show="visibleResetPWD" v-on:onLogin="onLogin"></ResetPWD>
			</view>
		</view>
	</view>
</template>

<script>
	import TopMenu from '../../components/topMenu.vue'
	import ChooseRole from '../../components/login/chooseRole.vue'
	import LoginByPWD from '../../components/login/loginByPWD.vue'
	import ResetPWD from '../../components/login/resetPWD.vue'
	export default {
		components: {
			TopMenu,
			ChooseRole,
			LoginByPWD,
			ResetPWD
		},
		data() {
			return {
				visibleLogin:true,
				visibleChooseRole: true,
				visibleLoginByPWD: false,
				visibleResetPWD: false,
				//当前登录类型T教师S学生
				roleType: '',
			}
		},
		methods: {
			onLogin: function() {
				console.log("登录成功", this.roleType, this.$refs.TopMenu.str);
				console.log("登陆成功2",topMenuS.ksxx);
				this.$refs.TopMenu.switchState(topMenuS.syjj);
				this.visibleChooseRole = false;
				this.visibleLoginByPWD = false;
				this.visibleResetPWD = false;
				this.visibleLogin = false;
			},
			onChoose(type) {
				console.log("onChoose", type)
				this.roleType = type;
				this.visibleChooseRole = false;
				this.visibleLoginByPWD = true;
			},
			onForget() {
				this.visibleLoginByPWD = false;
				this.visibleResetPWD = true;
			}
		}
	}
</script>

<style>
	.login-center {
		/* width: 1431px;
		height: 752px; */
		width: 74.5vw;
		height: 39.1vw;
		background: #FFFFFF;
		box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.1);
		border-radius: 10px;
		/* margin-top: 86px; */
		justify-content: space-evenly;
	}

	.login-lefttitle1 {
		/* font-size: 26px; */
		font-size: 1.4vw;
		font-family: MicrosoftYaHei;
		color: #020202;
		/* line-height: 35px; */
		line-height: 1.8vw;
		/* letter-spacing: 2px; */
		letter-spacing: 0.02vw;
	}

	.login-lefttitle2 {
		/* font-size: 20px; */
		font-size: 1.041vw;
		font-family: MicrosoftYaHei;
		color: #6C6F6E;
		/* line-height: 26px;
		letter-spacing: 1px;
		margin-top: 16px; */
		line-height: 1.4vw;
		letter-spacing: 1px;
		margin-top: 0.8vw;
	}

	.login-leftpic {
		/* margin-top: 79px;
		margin-left: 15px; */
		margin-top: 4.114vw;
		margin-left: 0.07vw;
	}

	.login-leftpic img {
		width: 17.552vw;
	}

	.login-middleline {
		width: 0.1vw;
		height: 29vw;
		background-color: #979797;
		opacity: 0.2;
	}
</style>
