<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path+"/";
	request.setAttribute("contextPath", basePath);
	
	String redirectUrl= request.getParameter("redirectUrl");
	request.setAttribute("redirectUrl", redirectUrl);
%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<title>认证信息</title>
	<script src="${contextPath }res/js/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="${contextPath }res/js/layer/layer.min.js"></script>
	<script src="${contextPath }app/lib/flexible.js"></script>
    <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
	<link rel="stylesheet" href="${contextPath }app/css/basem.css">
	<link rel="stylesheet" href="${contextPath }app/css/logome.css">
	<script type="text/javascript">
	$(function(){
		var idnumber="${USER.idnumber}";
		if(idnumber==null || idnumber==""){
			$("input[name='name']").removeAttr("disabled");
			$("input[name='idnumber']").removeAttr("disabled");
			$("#button").css("background", "#ed453c"); 
			$('#button').click(function(){ 
				var userId="${USER.id}";
				var name=$("input[name='name']").val();
				var idnumber=$("input[name='idnumber']").val();
				if(name== '' || idnumber==''){
					layer.alert("请输入姓名身份证！");
					return false;
				}
				$.post('${contextPath}web/mgmUserCtl/idnumberAuthentication.cs', {
					"userId" : userId,
					"name" : name,
					"idnumber":idnumber	
				}, function(data) {
					var datas=eval(data.data);
					if (data.ret == 1) {
						layer.msg('认证成功！', {
							  time: 1000
							}, function(){
								window.location.href = '${contextPath }web/meWebCtl/me.cs';
							});
					}else{
						layer.msg(data.msg);
					}
				}, "json");
			});
		}else{
			$("input[name='name']").attr("disabled","true");
			$("input[name='idnumber']").attr("disabled","true");
		}
	}); 
	</script>
</head>
<body>
	<div class="titbox">
		<a class="titreturn left" href="${contextPath }web/meWebCtl/me.cs"><img src="${contextPath }app/img/return1@2x.png" alt=""></a>
		<ul class="logtitul">
			<li><a class="left" href="${contextPath }web/meWebCtl/mepeo_info.cs?userId=${USER.id}">
				<h1>个人信息</h1>
				<div></div>
			</a></li>
			<li><a class="left" href="${contextPath }web/meWebCtl/mepeo_info2.cs?userId=${USER.id}">
				<h1>认证信息</h1>
				<div class="logtitsel"></div>
			</a></li>
		</ul>
	</div>
	<div class="forgetbox top50">
		<div class="safe">
			<ul class="logul">
				<li>
					<div><img class="logicon" src="${contextPath }app/img/iphone@2x.png" alt=""><span>手机</span></div>
					<input type="text" disabled="ture"   name="phone"  placeholder="请输入您的手机号" value="${USER.phone}">
				</li>
				<li>
					<div><img class="logicon" src="${contextPath }app/img/my@2x.png" alt=""><span>姓名</span></div>
					<input type="text"   name="name" placeholder="请输入您的姓名"  value="${USER.name}">
				</li>
				<li>
					<div><img class="logicon" src="${contextPath }app/img/id@2x.png" alt=""><span>身份证</span></div>
					<input type="text"   name="idnumber" placeholder="请输入您的身份证号码" value="${USER.idnumber}">
				</li>
			</ul>
			<a class="graybtn" href="javascript:void(0);" id="button">完成</a>
			<div class="lonoticebox">
				<div class="lonotice">
					<img class="logicon" src="${contextPath }app/img/notice@2x.png" alt="">
					<span>温馨提示</span>
					<div class="lonoline"></div>
				</div>
				<ol class="lonoticeul">
					<li>1.身份证绑仅限填写一次</li>
					<li>2.请保证以上信息均为本人，而且正确。如果因为
个人信息问题造成的佣金发放不到位，概不负责。</li>
				</ol>
			</div>
		</div>
	</div>
</body>
</html>