<template>
	<view class="login_two">
		<statusBar :item="navBarData"></statusBar>
		<view class="top">
			<view class="left" @click="phoneLogin" :class="current==0?info1:info2">
				<text>手机号登录</text>
				<view :class="current==0?yun:info2"></view>
			</view>
			<view class="right" @click="accountLogin" :class="current==1?info1:info2">
				<text>账号密码登录</text>
				<view :class="current==1?yun:info2"></view>
			</view>
		</view>
		<swiper class="scroll-view-height" @change="swipeIndex" :current="current" :duration="300">
		    <swiper-item>
					<view class="inputBox">
						<input type="text" class="inp" placeholder="手机号">
						<input type="text" class="inp" placeholder="请输入验证码">
						<button class="yzm">获取验证码</button>
					</view>
					<view class="inpTip">
						验证码已发送到您的手机
						<text>17739460336</text>
					</view>
					<view class="mid">
						<!-- <view class="quan"></view> -->
						<radio value="r1" @click="radioCheck" :checked="isOK" />
						<view class="">
							我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
						</view>
					</view>
					
					<button class="btn">登录</button>
		    </swiper-item>
			
		    <swiper-item>
					<view class="inputBox">
						<input type="text" class="inp inp2" placeholder="用户名/绑定手机/绑定邮箱">
						<input type="text" class="inp" placeholder="登录密码">
						<button class="yzm">获取验证码</button>
					</view>
					<text @click="goto" style="font-size: 14px;float: right;padding: 20rpx;padding-right: 30rpx;">忘记密码</text>
					<view class="mid">
						<!-- <view class="quan"></view> -->
						<radio value="r1" @click="radioCheck" :checked="isOK" />
						<view class="">
							我已阅读并同意<text>《教育小程序服务条款》</text>和 <text>《 隐私协议》</text>新用户自动注册
						</view>
					</view>
					
					<button class="btn">登录</button>
		  </swiper-item>
		</swiper>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current:0,//登录方式切换
				
				info1:'info1',  //类名
				info2:'info2',
				yun:'yun',
				
				isOK:false,  //用户协议是否勾选
				navBarData:{
					title:'手机号登录',
					btn:1  //判断是否显示返回按钮
				},
			}
		},
		methods: {
			// 登录方式切换
			swipeIndex(index){
				this.current=index.detail.current;
				console.log(this.current);
				if (index.detail.current==0) {
					this.navBarData.title="手机号登录"
				}else{
					this.navBarData.title='账号密码登录'
				}
				
			},
			phoneLogin(){
				this.current=0
			},
			accountLogin(){
				this.current=1
			},
			// 是否同意条约
			radioCheck(){
				this.isOK=!this.isOK
			},
			// 忘记密码
			goto(){
				uni.navigateTo({
					url:"/pages/login_three/login_three"
				})
			}
		}
	}
</script>

<style lang="scss">
	.login_two{
		background-color: #ffffff;
		height: 100vh;
		.top{
			width: 500rpx;
			display: flex;
			justify-content: space-between;
			margin: auto;
			margin-top: 80px;
			margin-bottom: 40px;
			.info1{
				font-weight: bold;
				position: relative;
				.yun{
					width: 80rpx;
					height: 0rpx;
					position: absolute;
					left: 50%;
					transform: translate(-50%,-50%);
					box-shadow: 0px 0px 10px 2px #4a97f2;
				}
			}
			.info2{
				color: #666666;
			}
		}
		.inputBox{
			padding: 0 30rpx;
			position: relative;
			.yzm{
				position: absolute;
				bottom: 10rpx;
				right: 20rpx;
				font-size: 12px;
				background-color: #7eb5f6;
				color: #fff;
			}
			.inp{
				padding: 10rpx 15rpx;
				// margin-top: 50rpx;
				border-bottom: 1px #ccc solid;
			}
			.inp:nth-child(1){
				margin-bottom: 50rpx;
			}
		}
		.inpTip{
			font-size: 14px;
			width: 750rpx;
			padding: 0 15rpx;
			color: #666666;
			margin: 10px;
			margin-bottom: 30px;
			text{
				color: #73aff4;
			}
		}
		.scroll-view-height{
			height: 60vh;
		}
		
		.mid{
			display: flex;
			justify-content: flex-start;
			width: 750rpx;
			padding: 0rpx 20rpx;
			font-size: 13px;
			margin-top: 10px;
			/deep/ .uni-radio-input{
				width: 15px;
				height: 15px;
			}
			text{
				color: #4a97f2;
			}
		}
		
		.btn{
			background-color: #0056a8;
			color: #ffffff;
			border-radius: 30px;
			margin: 30rpx 55rpx;
			// padding: 0rpx 10rpx;
			font-size: 16px;
		}
	}
</style>
