<%@ page language="java" 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>
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<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>
  	<!--顶角按钮-->
  	<section>
  		<img  id="toSearchID" style="top: 1rem;margin-left: 1rem;width: 2%;height: 2%;position: relative;" src="${contextPath}/static/weixin/ssdb/images/user_login_close.png" />
  	</section>
  	<!--img区域-->
  	<section>
  		<center>
  		<img src="${contextPath}/static/weixin/ssdb/images/user_login_duowen.png" style="margin-top: 5rem;width:25%;height: 50%;"/>
  		<br/>
  		<span class="fs-16 color53a2">律师一站式办公平台</span>
  		</center>
  	</section>
  	<section>
  		<form>
  			<div style="margin-left: 1rem;margin-right: 1rem;margin-top: 2rem;">
  		<div class="weui_cell">
        <div class="weui_cell_hd"><img src="${contextPath}/static/weixin/ssdb/images/user_login_shouji.png" style="width: 50%;height: 70%;"/></div>
        <input class="weui_input" type="text" id="phone" placeholder="请输入手机号">
      </div>
      <div class="retinabt"></div>
      <div class="weui_cell">
        <div class="weui_cell_hd"><img src="${contextPath}/static/weixin/ssdb/images/user_login_mima.png" style="width: 50%;height: 70%;"/></div>
        <input class="weui_input" type="password" id="passwd" placeholder="请输入密码">
      </div>
      <div class="retinabt"></div>
      <!--记住密码-->
      <div class="weui_cell">
        <div class="weui_cell_hd"><img src="${contextPath}/static/weixin/ssdb/images/passwd_checked.png" style="width: 45%;height: 60%;"/></div>
        <span class="color9b9b">记住密码</span>
      </div>
      <a href="javascript:;" class="weui_btn weui_btn_primary bc53a2" id="toLand" style="margin-top: 2rem;">登录</a>
      <p align="center" style="margin-top: 0.5rem;"><span class="color53a2" id="toRegister">注册多问</span><span style="margin-left: 0.4rem;margin-right: 0.4rem;">|</span><span class="color9b9b" id="toFindPasswd">忘记密码</span></p>
  	</div>
  	</form>
  	</section>
  	<!--通知-->
  	<section class="footer" style="padding-top: 4rem">
  		<div class="color9b9b " style="margin-left: 1rem;margin-right: 1rem;bottom: 5px;">
  			<p >通知:</p>
  			<p >为了打造一个纯粹的律师平台,提供更好的使用体验,多问律师端将于10月31日关闭游客访问模式,只有注册律师才能使用,如有不便敬请原谅,多问感谢您的支持!</p>
  		</div>
  	</section>
  </body>
  <script type="text/javascript" src="${contextPath}/static/js/jquery-1.12.0.min.js"></script>
  <script type="text/javascript" src="${contextPath}/static/js/layer/layer.js"></script>
  <script type="text/javascript" src="${contextPath}/static/js/jstorage.js"></script>
  <script type="text/javascript" src="${contextPath}/static/js/requestutil.js"></script>
  <style>
  .footer{
  	position: relative;
  	width: 100%
  	bottom:0;
  }
  </style>
  <script type="text/javascript">
 	$(document).ready(function() {
 			var baseURL='<%=com.fadu.app.util.AppConfig.url_duowenapp_b%>';
  			//登录
	  		$("#toLand").click(function(){
		  		var phone=$("#phone").val(),passwd=$("#passwd").val();
		  		var jsonReq={};
		  		jsonReq.name=phone;
		  		jsonReq.password=passwd;
		  		jsonReq.actionCode="B001";
		  		var url=baseURL+"/B/android/";
		  		console.log(jsonReq);
		  		requestData(url,jsonReq,success,fail);
  			});
  			function success(json){
  				console.log(json);
  				 if(json){
	  					if(json.success==true){
	  						if(json.token){
		  						$.jStorage.set("token",json.token);
		  						var loginPreUrl= sessionStorage.getItem('loginPreUrl');
		  						if(loginPreUrl){
			  						location.href=loginPreUrl;
		  						}else{
			  						location.href= baseURL+"/web/cd/index";
		  						}
	  						}else{
	  							layer.msg("登录失败,请稍后重试!!");
	  							console.log("登录出现问题!!");
	  						}
	  					}else{
	  						layer.msg(json.message);	
	  					}
	  				}else{
	  					layer.msg("获取信息失败!!");
	  				}	
  			}
  			//顶部圆角按钮操作
  			$("#toSearchID").click(function(){
  				var url="${contextPath}/web/ssdb/search";
		  		location.href=url;
  			});
  			function fail(resp){
  				console.log(resp);
  			}
  			
  			$("#toRegister").click(function(){
  				location.href="${contextPath}/web/ssdb/toRegister";
  			});
  			
  			$("#toFindPasswd").click(function(){
  				location.href="${contextPath}/web/ssdb/toFindPasswd";
  			});  			
   });
  </script>
</html>
