<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	// nginx proxy: proxy_set_header 	X-Scheme 	$scheme; 
	String scheme = request.getHeader("X-Scheme");
	if (scheme == null) {
		scheme = request.getScheme();
	}
	int port = request.getServerPort();
	String basePath = scheme + "://" + request.getServerName() + ((port == 80 || port == 443) ? "" : (":" + port)) + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<title>账户注册 - 优软云</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="<%=basePath%>">
<link rel="shortcut icon" href="static/img/icon.png">
<link rel="stylesheet" type="text/css"
	href="static/lib/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="static/lib/css/toastr.min.css">
	<link rel="stylesheet" type="text/css"
		  href="static/css/pwd.css">
	<link rel="stylesheet" type="text/css"
		  href="static/lib/keyboard/css/softkeys-0.0.1.css">
<link rel="stylesheet" type="text/css" href="static/css/registerPersonal.css" />
<meta name="referrer" content="origin" />
	<style>
		input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
			-webkit-transition-delay: 99999s;
			-webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
			/* -webkit-box-shadow: 0 0 0px 1000px white inset; */
		}
	</style>
</head>
<body>
	<!-- old brower Start -->
	<jsp:include page="../common/brower_tip.jsp" />
	<!-- old brower End -->
	<!-- header Start -->
	<nav class="x-navbar">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="http://www.ubtob.com/">个人注册</a>
			</div>
			<div class="collapse navbar-collapse navbar-right">
				<span class="navbar-text"> 已有账号？<a
					href="sso/login?appId=${appId}&returnURL=${returnUrl}" class="x-text-link">立即登录</a>
				</span>
			</div>
		</div>
	</nav>
	<!-- header End -->
	<!-- content Start -->
	<div class="x-content">
		<div class="container">
			<ul class="list-unstyled list-inline x-step x-step-2x">
				<li class="active reg-self">个人注册</li>
				<li onclick="goHref('sso/register_mall?appId=${appId}&returnURL=${returnUrl}')"><a>企业注册</a></li>
			</ul>
			<div class="x-step-content">
				<c:if test="${pageStepPerson=='1'}">
					<div class="x-form-wrap">
						<form class="form-horizontal x-form reg-form" novalidate>
							<div class="x-form-set-wrap">
								<div class="x-form-set-header">
									<h4>填写信息</h4>
								</div>
								<%--<div class="help-block">
									<span class="small">当前页面是个人用户注册，如果您是企业用户请前往 <a href="sso/register_mall?appId=${appId}&returnURL=${returnUrl}"><strong>企业注册</strong></a>
										<i class="glyphicon glyphicon-question-sign x-icon-left" id="x-reg-question" role="button"
										   data-container="body" data-toggle="popover" data-placement="top"
										   data-content="目前个人注册只适用于优软商城普通买家用户"></i></span>
								</div>--%>
								<div class="x-form-set">
									<input type="hidden" name="pageToken" value="${pageToken}">
									<input type="hidden" name="returnUrl" value="${returnUrl}">
									<div class="form-group">
										<label class="control-label col-sm-2 x-required">姓名：</label>
										<div class="col-sm-5">
											<input type="text" class="form-control x-input" name="name" id="name"
												   required placeholder="例如：张三" x-error-text="请输入您的姓名"
												   x-error-by="adminName_err" x-help-by="adminName_help">
										</div>
										<div class="x-input-addon col-sm-5">
											<div id="adminName_err" class="x-text-error" style="display: none">请勿超过20个字符
											</div>
											<div id="adminName_help" class="x-text-help" style="display: none;">
												<img src="static/img/input-check-yes.png" alt="">
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-sm-2 x-required">手机号：</label>
										<div class="col-sm-5">
											<input type="text" class="form-control x-input" name="mobile" id="mobile"
												   required placeholder="例如：15818181818" x-pattern="^[\d-]{8,11}$" x-error-text="请输入正确的手机号"
												   x-error-by="adminTel_err" x-help-by="adminTel_help" autocomplete="off"/>
										</div>
										<div class="x-input-addon col-sm-5">
											<div id="adminTel_err" class="x-text-error" style="display: none">请输入正确的手机号
											</div>
											<div id="adminTel_help" class="x-text-help" style="display: none;">
												<img src="static/img/input-check-yes.png" alt="">
											</div>
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-sm-2 x-required">验证码：</label>
										<div class="col-sm-5 x-has-feedback-left">
											<button type="button" class="btn x-form-control-feedback-left x-btn-checkcode" disabled="disabled" style="width: 130px;left:217px;">
												<span>获取验证码</span><span class="x-timeout-word" style="display: none;"><span class="x-timeout-num">60</span>秒</span>
											</button>
											<input type="text" style="padding-right: 140px;padding-left:12px;" class="form-control x-input" name="checkcode"
												   required placeholder="请输入验证码" x-pattern="^\d{6}$"
												   x-help-by="checkcode_help" x-error-by="checkcode_err">
										</div>
										<div class="x-input-addon col-sm-5">
											<div id="checkcode_tip" class="x-text-tip" style="color: #429440;">
												<i class="glyphicon glyphicon-info-sign x-icon-left"></i>验证码是6位数字
											</div>
											<div id="checkcode_help" class="x-text-help" style="display: none;">
												<img src="static/img/input-check-yes.png" alt="">
											</div>
											<div id="checkcode_err" class="x-text-error"
												 style="display: none">验证码错误
											</div>
										</div>
									</div>
									<input type="hidden" name="checkcodeToken" required x-error-text="请先获取验证码，然后输入验证码">
									<div class="form-group" style="text-align: center">
										<div class="col-sm-5 col-sm-offset-2">
											<label class="checkbox-inline" style="padding-left: 0;">
												<label class="default-check-box" id="default-check-box">
													<input type="checkbox" id="agree" name="agree" value="1" required x-error-text="您还未同意服务协议">
												</label>
												我已阅读并同意<a href="http://www.ubtob.com/help/agreement" target="_blank" class="x-btn-item x-text-link" id="modaltrigger">《优软云服务协议》</a>
											</label>
										</div>
									</div>
									<div class="form-group" style="margin-left: 63px;">
										<div class="col-sm-3 col-sm-offset-2">
											<a class="btn x-btn-primary x-btn-submit btn-block" style="border-radius: 0;"> 下一步 </a>
											<!-- add class "disabled" to avoid click -->
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
				</c:if>

				<c:if test="${pageStepPerson=='2'}">
					<div class="x-form-wrap">
						<form class="form-horizontal x-form pwd-form" novalidate>
							<div class="x-form-set-wrap">
								<div class="x-form-set-header">
									<h4>登录密码设置</h4>
								</div>
								<div class="x-form-set">
									<input type="hidden" name="pageToken" value="${pageToken}">
									<input type="hidden" name="returnUrl" value="${returnUrl}">
									<div class="form-group">
										<label class="control-label col-sm-2 x-required">密码设置：</label>
										<div class="col-sm-5 x-has-feedback-left">
											<input type="password" id="password" class="form-control x-input" style="padding-left:12px;"
												   name="password" required="required" x-error-by="password_err" x-pattern="^(?=.*[0-9].*)(?=.*[A-Za-z].*).{8,20}$"
												   x-help-by="password_help" x-maxlength="20" x-minlength="8" placeholder="请输入密码"
												   autofocus>
											<img src="static/img/keyboard.png" id="keyboard1" alt="">
											<div class="softkeys softkeys1" style="display: none" data-target="input[name='password']"></div>
										</div>
										<div class="x-input-addon col-sm-5">
											<%-- <div class="x-text-help" id="password_help">您的登录账户是${content.adminTel}</div> --%>
											<div class="x-text-error" id="password_err"
												 style="display: none">密码需为8-20字符的英文、数字混合</div>
											<div id="password_help" class="x-text-help" style="display: none;">
												<img src="static/img/input-check-yes.png" alt="">
											</div>
										</div>
									</div>
									<div class="form-group">
										<div class="safe-level col-sm-5" style="margin-left:144.65px;width:350px;">
											安全等级：
											<span class="level1" style="width:75px;">弱</span>
											<span class="level2" style="width:75px;">中</span>
											<span class="level3" style="width:75px;">强</span>
										</div>
									</div>
									<div class="form-group">
										<label class="control-label col-sm-2 x-required">确认密码：</label>
										<div class="col-sm-5 x-has-feedback-left">
											<input type="password" id="passwordConfirm" style="padding-left:12px;"
												   class="form-control x-input" name="passwordConfirm"  x-help-by="passwordConfirm_help"
												   required="required" placeholder="再次输入密码确认" x-maxlength="20"
												   x-minlength="6" x-error-by="passwordConfirm_err">
											<img src="static/img/keyboard.png" id="keyboard2" alt="">
											<div class="softkeys softkeys2" style="display: none" data-target="input[name='passwordConfirm']"></div>
										</div>
										<div class="x-input-addon col-sm-5">
											<div class="x-text-error" id="passwordConfirm_err" style="display: none">两次输入的密码不一致</div>
											<div id="passwordConfirm_help" class="x-text-help" style="display: none;">
												<img src="static/img/input-check-yes.png" alt="">
											</div>
										</div>
									</div>
									<div class="form-group">
										<div class="col-sm-4" style="margin-left:130px;">
											<a class="btn x-btn-primary x-btn-submit"
											   style="width: 180px; margin: 15px 60px"> 完成注册 </a>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
				</c:if>
			</div>
		</div>
	</div>
	<!-- content End -->
	<!-- footer Start -->
	<jsp:include page="../common/footer.jsp" />
	<!-- footer End -->
	<!-- image box -->
	<div id="image-box" style="display: none">
		<div class="x-close-wrap" title="关闭">
			<a href="javascript:void(0);">&times;</a>
		</div>
		<div class="x-floating-wrap"></div>
		<div class="x-floating">
			<img />
		</div>
	</div>
	<!-- loading box -->
	<div id="loading">
		<div class="x-loading-wrap"></div>
		<div class="x-loading">
			<div></div>
			<div></div>
			<div></div>
		</div>
	</div>
	<!-- floating progress -->
	<div id="progress" style="display: none">
		<div class="x-floating-wrap"></div>
		<div class="x-floating text-center">
			<div class="x-progress-topbar">
				<div class="progress"></div>
			</div>
			<div class="x-waiting-wrap">正在注册您的企业信息，请稍等...</div>
		</div>
	</div>

	<div class="modal fade" id="registedModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">提示</h4>
				</div>
				<div class="modal-body">
					<h4>手机号 <span class="x-registed-mobile"></span> 已经注册过</h4>
					<p>您可以 <a href="sso/login?appId=${appId}&returnURL=${returnUrl}">立即登录</a> 或者 <a href="user/pwd?appId=${appId}&returnURL=${returnUrl}">用手机号找回密码</a></p>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		var step = <c:out value="${pageStepPerson}"></c:out>;
	</script>
	<script src="static/lib/js/jquery.min.js"></script>
	<script src="static/lib/js/bootstrap.min.js"></script>
	<script src="static/lib/js/toastr.min.js"></script>
	<script src="static/js/base.js"></script>
	<script src="static/js/registerPersonal.js"></script>
	<script src="static/lib/keyboard/js/softkeys-0.0.1.js"></script>
</body>
</html>