<%@ 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 uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/fns.tld" prefix="fns" %>
<!DOCTYPE html>
<html>
	<head>

		<link type="text/css" rel="stylesheet" href="<c:url value='/resources/versions-2.0/dist/css/bootstrap.min.css' />" />
		<link type="text/css" rel="stylesheet" href="<c:url value='/resources/versions-2.0/dist/css/public.css' />" /> 
		<link type="text/css" rel="stylesheet" href="<c:url value='/resources/versions-2.0/dist/css/insure/write-application.css' />" /> 
		<link type="text/css" rel="stylesheet" href="<c:url value='/resources/versions-2.0/dist/css/insure/fileinput.css' />" /> 
		<!--[if lt IE 9]> 
	      <script src="<c:url value='/resources/versions-2.0/js/html5shiv/3.7.2/html5shiv.min.js' />"></script>
	      <script src="<c:url value='/resources/versions-2.0/js/respond.js/1.4.2/respond.min.js' />"></script>
	   	<![endif]-->
	</head>
<body>
<div class="container"><!-- container start -->
	<div class="message-war"><!-- message-war start -->
		<div class="w-95-auto"><!-- w-95-auto start -->
			<div class="affirm-warr" id="bbb">

			</div>
		</div>
	</div>
	<div class="row next-step">
		<div class="col-sm-3 col-xs-3 text-right pull-right">
			<p>
				<%--<a href="javascript:void(0);" onclick="showInsureModal();" class="ns-btn" style="margin-left: 10px;">上传</a>--%>
				<a href="javascript:void(0);" onclick="windowOpen();" class="ns-btn" style="margin-left: 10px;">弹窗</a>
				<a href="javascript:void(0);" onclick="windowOpen1();" class="ns-btn" style="margin-left: 10px;">弹窗—平安</a>
				<a href="javascript:void(0);" onclick="ajaxTest();" class="ns-btn" style="margin-left: 10px;">ajax-test</a>
			</p>
		</div>
	</div>
</div><!-- container end -->
<div class="modal fade" id="insureModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header bg-1f96ef">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">上传投保单</h4>
			</div>
			<form id="insureForm" method="post" enctype="multipart/form-data" action='<c:url value="/api/gmr/policy/uploadRoleFile"/>' >
				<div class="modal-body">
					<div class="col-sm-12 col-xs-12" style="margin-top: 8px;">
						<div class="col-sm-12 col-xs-12" id="insurePath_isHidden">
							<div class="basic-file">
								<input data-drawview="" name="role_file" id="role_file" class="file" type="file" data-preview-file-type="any" data-upload-url="#" data-preview-file-icon="">
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<div class="mofo-sub">
						<button type="button" class="btn pull-left cancel-btn" data-dismiss="modal">取消</button>
						<button type="button" class="btn notarize-btn pull-right" onclick="uploadInsure();">确认</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<form id="_f">
	<input type="hidden" name="token" value="123123">
	<input type="hidden" name="user" value="zhong">
	<input type="hidden" name="pass" value="123456">
</form>
<!-- script -->
<script type="text/javascript">
	var baseUrl = '${pageContext.request.contextPath }';
    function showInsureModal(){
        $("#insureModal").modal("show");
    }
	function uploadInsure(){
		var insurePath = $("#role_file").val();
		if(insurePath ==""){
			layer.msg("请选择投保单");
		}else{
			var index = layer.load(0, {shade: [0.3,'#808080']});
			$("#insureForm").ajaxSubmit({
				success : function(data) {
                    layer.close(index);
                    $("#insureModal").modal("hide");
                    $("#bbb").html(data);
				},
				error : function() {
					layer.close(index);
					alert('error');
				}
			});
		}
	}
	function ajaxTest(){
	    var datas = $('#_f').serialize();
        $.setParamDatas(datas,baseUrl+'/test/at',false,true,function(data){//1.参数，2.地址，3.是否同步，4.是否遮盖，5.返回处理
            if (data.ret == '000000') {
                dialogMsg(data.msg, 'default', true);
            }
        });
	}
	function windowOpen(){
        layer.open({
            type: 2,
            area: ['1250px', '600px'],
            title: "保障服务",
            skin:'lay-bak',
            closeBtn: 1,
            shadeClose: false,
            scrollbar: false,
            shade:0.4,
            fix: false,
            content: baseUrl + '/api/thr/tposCheckout?user_id=4&login_name=zhba&token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1c2VyaWRcIjo0fSIsImV4cCI6MTUwNjgyMjgwOX0.1k_Uztve8KR0nnopES39WEuqtCGy2YAOnf3Vz1JO5I0&party=ARS-NC'
        });
	}
    function windowOpen1(){
        layer.open({
            type: 2,
            area: ['1250px', '600px'],
            title: "保障服务",
            skin:'lay-bak',
            closeBtn: 1,
            shadeClose: false,
            scrollbar: false,
            shade:0.4,
            fix: false,
            content: baseUrl + '/api/gmr/product/productInfo/862490448386985984'
        });
    }
</script>
<script type="text/javascript" src="<c:url value='/resources/version_new/js/jquery-1.8.3.min.js' />"></script>
<script type="text/javascript" src="<c:url value='/resources/version_new/js/laydate.js' />"></script>
<script type="text/javascript" src="<c:url value='/resources/version_new/js/layer/layer.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/commonJS/con-common.js' />"></script>
</body>
</html>