<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no" />
<title>多问律师</title>
<link rel="stylesheet" href="${contextPath}/static/weixin/ssdb/css/weui.min.css">
<link rel="stylesheet" href="${contextPath}/static/weixin/ssdb/css/jquery-weui.css">
<link rel="stylesheet" href="${contextPath}/static/weixin/ssdb/css/ssdb.css">
<link rel="stylesheet" href="${contextPath}/static/weixin/ssdb/css/common.css">
</head>
<body ontouchstart>
		<section style="padding: 0 0 0 0">
		<form>
			<div style="margin-left: 1rem; margin-right: 1rem; margin-top: 4rem;">
				<div class="weui_cell">
					<div class="weui_cell_hd">
						<label class="weui_label">新密码:</label>
					</div>
					<input class="weui_input" type="password" placeholder="新密码" id='newPsd'/>
				</div>
				<div class="retinabt"></div>
				<div class="weui_cell">
					<div class="weui_cell_hd">
						<label class="weui_label" >确认新密码:</label>
					</div>
					<input class="weui_input" type="password"  placeholder="确认新密码" id="newPsdAgin"/>
				</div>
				<div class="retinabt"></div>
				<a href="javascript:void(0);" class="weui_btn weui_btn_primary bc53a2" style="margin-top: 2rem;" id="nextStep">提交</a>
			</div>
		</form>
	</section>
	<script type="text/javascript" src="${contextPath}/static/js/jquery-1.12.0.min.js"></script>
	<script type="text/javascript" src="${contextPath}/static/js/requestutil.js"></script>
	<script type="text/javascript" src="${contextPath}/static/js/ssdbUtil.js"></script>
	<script type="text/javascript" src="${contextPath}/static/weixin/cd/js/util.js"></script>
   	<script type="text/javascript">
   	$(function(){
   		//验证码
   		var code="${code}";
   		var mobile="${mobile}";
   		var abasePath="${contextPath}";
   		var bURL=abasePath+"/B/android";
   		//下一步
   		$("#nextStep").click(function(){
   			var newPsd=$("#newPsd").val();
   			var newPsdAgin=$("#newPsdAgin").val();
   			var newPsdAgin_tips=$("#newPsdAgin").attr('data-tips');
   			if(newPsd){
   				if(newPsd!==newPsdAgin){
						showMsg("两次密码不一致!");
   					return;
   				}else{
   					if(newPsd.length<6){
   						showMsg("密码长度不能小于6位!");
   						return;
   					}
   				}
   			}else{
   				showMsg("请输入密码!");
   				return;
   			}   			
   			//验证手机号
	   		var b003={
	   			actionCode:'B003',
		    	mobile:mobile,
		    	newPsd:newPsd,
		    	code:code
   			};
	   	   	requestData(bURL, b003, b003Succ, findPasswodFail);
   		});
   	});
    function b003Succ(e){
    	if(e.success==true){
    		showMsg(e.message);
    		window.location.href="${contextPath}/web/ssdb/toLogin";
    	}else{
    		alertUtil(e.message);
    	}
    };
    function findPasswodFail(e){
    	console.log(e);
    	showMsg("加载失败,稍后重试!");
    }
   	</script>
</body>
</html>