check.html 5.8 KB
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>身份验证</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_537174_a4y4ri5v8z6t7qfr.css"/>
		<link rel="stylesheet" type="text/css" href="css/swiper.min.css"/>
		<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_550254_r6pua542e96vquxr.css"/>
		<link rel="stylesheet" type="text/css" media="screen" href="css/base.css" />
		<script src="js/base.js"></script>
		<style>
		
			.xieyi_content{
				width: 100%;
				position: fixed;
				background-color: #FFF;
				z-index: 2000;
				padding: 0.48rem 0.4rem;
				bottom: 0;
				left: 0;
				font-size: 0.28rem;
				display: none;
			}
			.xieyi_title{
				text-align: center;
			}
			.xieyi_warp{
				font-size: 0.26rem;
				margin-top: 0.12rem;
				text-indent: 2em;
				margin-bottom: 1.12rem;
			}
		</style>
	</head>

	<body>
		<div class="container check_container">
			<div class="input_form">
				<div class="input_item">
					手机号:
					<input class="input_item_box phone" name="phone" type="tel" placeholder="请输入手机号" />
				</div>
				
				<div class="double">
					<div class="input_item check_code">
						验证码:
						<input class="input_item_box yanzhengma" name="checkCode" type="text" placeholder="请输入验证码" />
					</div>
					<div class="input_item get_code">
						<input class="input_item_box getcheckCode" readonly="readonly" type="text" value="获取验证码" />
					</div>
				</div>
				<div class="input_item">
					身份证:
					<input class="input_item_box" name="idcard" id="id_card" type="text"  placeholder="请输入身份证号" />
				</div>
				
				
				<div class="note">
					提示:绑定身份证仅作为本平台内部审核记录,请放心填写
				</div>  
				
				<div class="check_bottom">
					<div class="check_xieyi">
						<div class="check_box iconfont icon-check-box">

						</div>
						<div class="xieyi_note">确认注册视为同意本协议<a class="xieyi_box" href="#">《服务协议》</a></div>
					</div> 
					<button type="button" class="sub_form mui-btn">提交</button>
				</div>
			</div>
		</div>  
		<!--底部-->
		<div class="mask"></div>
		<div class="xieyi_content">
			<div class="xieyi_title">服务协议</div>
			<div class="xieyi_warp">
				内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容
			</div>
			
			<div class="check_xieyi"> 
				<div class="check_box iconfont icon-check-box">
				</div>
				<div class="xieyi_note">同意本服务协议</div>
			</div>
		</div>
		
		<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
		<script type="text/javascript" src="js/mui.min.js"></script>
		<script type="text/javascript" src="js/swiper.min.js" ></script>
		<script>
			//协议勾选
			mui('.check_xieyi').on('tap','.check_box',function(){ 
				if($('.check_box').hasClass('icon-check-box')){
					$('.check_box').attr('class','check_box iconfont icon-checkboxoutlineblank')
				}else{
					$('.check_box').attr('class','check_box iconfont icon-check-box')
				}
			})
			//协议弹窗
			mui('.xieyi_note').on('tap','.xieyi_box',function(){
				$('.mask').show();
				$('.xieyi_content').show();
			})
			//关闭协议
			mui('body').on('tap','.mask',function(){
				$('.mask').hide();
				$('.xieyi_content').hide();
			})
			
			//验证码判断手机号
			var wait=60;
			function time(o) {  
		        if (wait == 0) {   
		            o.removeAttribute("disabled");            
		            o.value="获取验证码";  
		            wait = 60;  
		        } else {  
		            o.setAttribute("disabled", true);  
		            o.value="重新发送(" + wait + ")";  
		            wait--;  
		            setTimeout(function() {  
		                time(o)  
		            },1000)    
		        }  
		    } 
			
			//验证码倒计时
			mui('.get_code').on('tap','.getcheckCode',function(){
				var phone = $('.phone').val();
				var reg = /^1[3|4|5|7|8][0-9]{9}$/;
				if(!reg.test(phone)){
					mui.toast('手机号码格式不正确')
					return false;
				}else{
					
					//获取成功后缓存
					localStorage.setItem('checkCode','4523');
					time(this);
				}
			})
			
			//提交操作
			mui('.check_bottom').on('tap','.sub_form',function(){
				var phone = $('.phone').val();
				var reg = /^1[3|4|5|7|8][0-9]{9}$/;
				if(!reg.test(phone)){
					mui.toast('手机号码格式不正确')
					return false;
				}
				var code = $('.yanzhengma').val();
				if(code!=localStorage.getItem('checkCode')){
					mui.toast('验证码有误')
					return false;
				}
				
				var cardreg = /(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
				if(!cardreg.test($('#id_card').val())){	
					mui.toast('身份证号码格式有误');
					return false;
				}
				
				if($('.check_box').attr('class')=='check_box iconfont icon-check-box'){
					//表单提交操作
					mui.openWindow('bindPhone.html')
					
				}else{
					mui.toast('请勾选服务协议!')
				}
			})
		</script>
	</body>

</html>