<?php
if (!defined('ROOT'))
	exit ;
?>
<!DOCTYPE html>
<html>

	<head>
		<title>注册106云盘—大型网络网盘</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
		include 'Inc_files.php';
		?>
		<style type="text/css">
		.am-dimmer{ z-index: auto;}
		</style>
	</head>

	<body data-type="login">
		<script src="<?php echo C('TMPL_PARSE_STRING.__TPL__');?>/assets/js/theme.js"></script>
		<div class="am-g tpl-g">
			<div class="tpl-login">
				<div class="tpl-login-content">
					<div class="tpl-login-title">
						注册用户
					</div>
					<a href="login" class="tpl-login-content-info"> 已有用户，直接登录 </a>

					<form class="am-form tpl-form-line-form" id="reg">
						<style type="text/css">
						#reg .mobile_group{position: relative;}
						#reg .mobile{ width: 130px; float: left;}
						#reg .code_img{ width: 85px; float: left;padding-right: 15px;}
						#reg .code_sms{ width: 95px; float: left; padding-left: 15px;}
						#reg .mobile_group .btn_code_sms{width: 110px; background: none; border: 1px solid #c2cad8; position: absolute;right: 0;bottom: 0;font-size: 14px; padding-bottom: 5px;}
						#reg .mobile_group img{ position: absolute;left: 115px;top: 32px; display: none;}
						</style>
						<div class="am-form-group mobile_group">
							<input type="tel" maxlength="11" name="mobile" class="tpl-form-input mobile" placeholder="手机">
							<input type="text" class="tpl-form-input code_img" placeholder="图像验证码">
							<img class="pointer" title="点击切换" src="/api/verify" onClick="this.src='/api/verify?time='+Math.random()" >
							<input type="text" name="code_sms" class="tpl-form-input code_sms" placeholder="短信验证码">
							<button type="text" class="tpl-form-input btn_code_sms">获取验证码</button>
						</div>


						<div class="am-form-group">
							<input type="password" name="password" class="tpl-form-input" placeholder="请输入密码">
						</div>

						<div class="am-form-group">
							<input type="password" name="repassword" class="tpl-form-input" placeholder="再次输入密码">
						</div>

						<div class="am-form-group tpl-login-remember-me">
							<input id="remember-me" type="checkbox">
							<label for="remember-me"> 我已阅读并同意
							<a href="javascript:;" data-am-modal="{target: '#zhucexieyi'}">
								《用户注册协议》
							</a> </label>

						</div>

						<div class="am-form-group">

							<button type="button" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn btn_submit">
							提 交
							</button>
<!--系统升级中，暂停注册，敬请谅解<br>
   106网盘客服联系电话0470-3200086-->
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="am-popup" id="zhucexieyi">
		  <div class="am-popup-inner">
		    <div class="am-popup-hd">
		      <h4 class="am-popup-title">用户注册协议</h4>
		      <span data-am-modal-close
		            class="am-close">&times;</span>
		    </div>
		    <div class="am-popup-bd">
		      <?php echo C('YONGHUZHUCEXIEYI');?>
		    </div>
		  </div>
		</div>
		<?php
		include 'Inc_files_boot.php';
		?>
		<script type="text/javascript">
		jQuery(document).on('click','.btn_submit',function () {
			if (!jQuery("#remember-me").prop('checked')) {
				return false;
			}
        	jQuery.ajax({
        		url:"reg",
        	    data:jQuery("form").serializeArray(),
        	    dataType: "json",
        	    type: "post",
        	    timeout: 10000,
        	    success: function(data) {
        	    	if (data.status==0) {
        	    		wd_alert({"msg":data.info,timeout:2000,background:"#f00"});
        	    	}else{
        	    		location.href='/';
        	    	}
        	    },
        	    error: function() {
        	        mui.toast("网络连接超时");
        	    }
        	});
        }) 
        jQuery(document).on('focus','.code_img',function () {
            jQuery('#reg img').show();          
        });
        jQuery(document).on('click','.btn_code_sms',function () {
        	jQuery('#reg img').hide();
        	var the=jQuery(this);
        	var i=59;
        	if (the.html()=='获取验证码') {
	        	jQuery.ajax({
	        		url:"/member/sms",
	        	    data:{
	        	    	code_img:jQuery(".code_img").val(),
	        	    	mobile:jQuery(".mobile").val()
	        	    },
	        	    dataType: "json",
	        	    type: "post",
	        	    timeout: 10000,
	        	    success: function(data) {
	        	    	if (data.status==1) {
	        	    		the.html('已获取'+i+'秒');
			        		var cl=setInterval(function () {
			        			i--;
				        		the.html('已获取'+i+'秒');
				        		if (i<0) {
				        			clearInterval(cl);
				        			the.html('获取验证码');
				        		}
				        	},1000);
	        	    	}else{
	        	    		wd_alert({
	        	    			msg:data.info,
	        	    			background:'#f00'
	        	    		});
	        	    	}
	        	    },
	        	    error: function() {
	        	    }
	        	});
        	}
        	
        });
		</script>
	</body>

</html>