<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" /><meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta name="keywords" content="百联保">
<meta name="description" content="百联保是百川信（厦门）网络技术有限公司基于金融创新并响应互联网＋计划搭建的第三方金融服务平台。秉承开拓金融创新，减轻企业负担的服务理念，百联保利用互联网平台优势并结合保险的市场作用，将与保证金、银行保函、担保公司保函具备同等效力的保证保险保函纳入经贸合作的担保形式之一，旨在减轻企业资金负担，简化申办流程，缩短办理周期，为企业客户提供低成本、高效率、安全专业的新型互联网金融服务。">

<title>百联保—邮箱变更</title>
<link href="<c:url value='/resources/css/public.css' />" rel="stylesheet" type="text/css" />
<link href="<c:url value='/resources/css/personal_center.css' />" rel="stylesheet" type="text/css" />
<link href="<c:url value='/resources/css/login.css' />" rel="stylesheet" type="text/css" />

</head>
<body>
<jsp:include page="../../header.jsp"/>
<!-- 个人中心  企业资料 内容部分 开始 -->
<div class="per_centerwar"><!-- per_centerwar start -->
	<div class="per_centersub"><!-- per_centersub star -->
    	<div class="per_cenleftwar"><!-- per_cenleftwar star -->
        	<div class="my_acount">
            	<p><img src="<c:url value='/resources/images/my_acount.jpg' />" width="32" height="32" title="我的账户"></p>
            	<p><a href="<c:url value='/user/index?ACCESS_TOKEN=${ACCESS_TOKEN}' />">我的账户</a></p>
            </div>
            <div class="clear"></div>
            <div class="acount_list">
            	<ul>
                    <li>
                        <a href="<c:url value='/policy/index?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
                            <label><img src="<c:url value='/resources/images/my_order.png' />" width="17" height="19"></label>
                            <span>我的订单</span>
                        </a>
                    </li>
                    <div class="clear"></div>
                    <li>
                        <a href="<c:url value='/report/index?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
                            <label><img src="<c:url value='/resources/images/refer.png' />" width="22" height="21"></label>
                            <span>理赔查询</span>
                        </a>
                    </li>
                    <div class="clear"></div>
                    <li>
                        <a href="<c:url value='/user/personal/init?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
                            <label><img src="<c:url value='/resources/images/com_data.png' />" width="21" height="15"></label>
                            <span>企业资料</span>
                        </a>
                    </li>
                    <div class="clear"></div>
                    <li>
                        <a href="<c:url value='/appMsg/index?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
                            <label><img src="<c:url value='/resources/images/insure_mes.png' />" width="19" height="20"></label>
                            <span>投保人资料</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div><!-- per_cenleftwar end -->
        <div class="per_cenrightwar"><!-- per_cenrightwar start -->
          	<!-- 邮箱变更 验证身份 开始  -->
          	 <div class="company_title"><p>邮箱变更</p></div>
          	 <!-- 基本信息 验证身份 开始 -->
        	<div class="reg_list cen_verify">
                <div class="plan">
                    <ul>
                        <li><label>1</label></li>
                        <li><label>2</label></li>
                        <li><label>3</label></li>
                    </ul>
                </div>
                <div class="clear"></div>
                <div class="listing">
                    <ul>
                        <li id="color_ff6d37">验证身份</li>
                        <li id="color_ff6d37">验证新邮箱</li>
                        <li>修改成功</li>
                        
                    </ul>
                </div>
            </div>
            <!-- 基本信息 验证身份 结束 -->
          	 <div class="clear"></div>
          	<!-- 验证身份 开始 -->
            <div class="reg_form cen_vercont new_mailbox">
            	<form id="newEmailForm" action="<c:url value='/user/changeFlush?ACCESS_TOKEN=${ACCESS_TOKEN}'/>" method="post">
                	<input type="hidden" id="signCode" name="signCode" value="email">
                	<p>
                		<span>新邮箱</span>
						<span><input type="text" name="email" id="email"></span>
                        <span class="error_block">
                        	<label><img src="<c:url value='/resources/images/reg_error.png' />"></label>
                        	<label>不能为空</label>
                        </span>
                    </p>
                    <div class="clear"></div>
                    <p>
                        <span>验证码</span>
                        <span class="ver_ify"><input type="text" id="ryzm" name='j_captcha' placeholder="请输入验证码"></span>
                         <span><input type="button" id="auth_code" value="获取验证码"/></span>
                        <span class="error_block">
                        	<label><img src="<c:url value='/resources/images/reg_error.png' />"></label>
                        	<label>不能为空</label>
                        </span>
                    </p>
                    <div class="clear"></div>
                    <p class="sub_mit"><a href="javascript:void(0);" onclick="postSubmit()">下一步</a></p>
                    <!--<div class="clear"></div>
                    <div class="reg_hint">
                    	<p>请输填写6～20位字符，只能输入数字、字母、符号，至少包含数字和字母（区分大小写）</p>
                        <label><img src="images/reg_hint.png' />"></label>
                    </div>-->
                </form>
            </div>
            <!-- 验证身份 结束 -->
          	 
          	<!-- 邮箱变更 验证身份 结束  -->
        </div><!-- per_cenrightwar end -->
    </div><!-- per_centersub end -->
    <div class="clear"></div>
</div><!-- per_centerwar end -->
<!-- 个人中心  企业资料 内容部分 结束 -->
<!-- 内容部分  注册  结束 -->
<jsp:include page="../../index/multi_f.jsp" />
<script src="<c:url value='/resources/script/jquery-1.8.3.min.js' />" type="text/javascript"></script>
<script src="<c:url value='/resources/js/insurance.js' />" type="text/javascript"></script>
<script type="text/javascript">
var baseUrl = '${pageContext.request.contextPath }';

$(function(){
	
	var msg = '${msg}';
    if(msg.length>1){
    	alert(msg);
    }
});
var wait=60;
function time(o) {
        if (wait == 0) {
        	$("#auth_code").val("重新获取");   
        	$("#auth_code").css("background-color","#ff6d37");
            wait = 60;
			/*$("#btn").css("background-color","#229fff");*/
        } else { // www.jbxue.com
            $("#auth_code").val("重新发送(" + wait + ")");
            wait--;
			$("#auth_code").css("background-color","#bbb6b6");
            setTimeout(function() {
                time(o)
            },
            1000)
        }
    }
document.getElementById("auth_code").onclick=function(){
	var email = $("#email").val();
	if ( email == "" || email == $("#email").attr("defaultValue")) {
		$("#email").parent().next().html("<lable><img src='<c:url value="/resources/images/reg_error.png"/>'></lable><lable>邮箱不能为空</lable>");
		$("#email").parent().next().attr("style","display:block;");
		return false;
	}else{
    	$("#email").parent().next().attr("style","display:none;");
    }
	if(checkEmail(email) == false){
		$("#email").parent().next().html("<lable><img src='<c:url value="/resources/images/reg_error.png"/>'></lable><lable>邮箱格式有误</lable>");
		$("#email").parent().next().attr("style","display:block;");
		$("#email").val("");
    	$('#email').focus();
    	 return false;
    }else{
    	$("#email").parent().next().attr("style","display:none;");
    }
	$.ajax({
			type: 'POST',
			url: baseUrl + "/user/newSendCaptcha",
			data:{
				'mains': 'email',
				'email': email
			},
			dataType:"json",
			cache: false,
			success: function(json){
				if(json.statusCode == '200') {
					$("#auth_code").parent().next().attr("style","display:none;");
					time(this);
					alert(json.resultDto.message);
				}else {
					$("#email").parent().next().html("<lable><img src='<c:url value="/resources/images/reg_error.png"/>'></lable><lable>"+json.resultDto.message+"</lable>");
					$("#email").parent().next().attr("style","display:block;");
		    		$("#email").val("");
				}
				
			}
		}); 
		
}
function checkEmail(value) {
	var re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	return re.test(value);
}
function postSubmit(){
	var email = $("#email").val();
	var ryzm = $("#ryzm").val();
	if(email == ""){
		$("#email").parent().next().html("<img src='<c:url value="/resources/images/reg_error.png"/>'>验证码不能为空");
		$("#email").parent().next().attr("style","display:block;");
	}else{
		$("#email").parent().next().attr("style","display:none;");
		if(ryzm == ""){
			$("#ryzm").parent().next().html("<img src='<c:url value="/resources/images/reg_error.png"/>'>验证码不能为空");
			$("#ryzm").parent().next().attr("style","display:block;");
		}else{
			$("#ryzm").parent().next().attr("style","display:none;");
			$("#newEmailForm").submit();
			
		}
	}
}
</script>
</html>