<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="stylesheet" href="/static/weChat/css/public.css">
    <link rel="stylesheet" href="/static/weChat/css/bai_basic.css">
    <title>订单确认</title>
</head>
<body id="container">
<%--过度动画--%>
<div id="mask">
    <div class="main">
        <div class="loading">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </div>
    </div>
    <div class="black-mask-my"></div>
</div>
<div class="arment-head">
    <div id="back" class="arment-left">
        <img src="/static/weChat/images/arment-left.png"/>
    </div>
    <p>订单确认</p>
</div>
<div class="order-particulars order-sure">
    <div class="particul">
        <h2>投保人信息</h2>
        <ul class="particul-cont">
            <li>
                <p>投保人类型</p>
                <span id="applicant_role_type"></span>
            </li>
            <li>
                <p>企业名称</p>
                <span>${row.applicant.name_cn}</span>
            </li>
            <li>
                <p>证件类型</p>
                <span id="applicant_id_type"><%--${row.applicant.id_type}--%></span>
            </li>
            <li>
                <p>证件号</p>
                <span>${row.applicant.organization_code}</span>
            </li>
            <li>
                <p>所在城市</p>
                <span>${row.area}</span>
            </li>
            <li>
                <p>具体地址</p>
                <span>${row.applicant.reg_address}</span>
            </li>
            <li>
                <p>联系人</p>
                <span>${row.applicant.link_name}</span>
            </li>
            <li>
                <p>手机号</p>
                <span>${row.applicant.link_tel}</span>
            </li>
            <li style="border-bottom: none;">
                <p>邮箱</p>
                <span>${row.applicant.link_email}</span>
            </li>
        </ul>
    </div>
    <div class="particul">
        <h2>被保险人信息</h2>
        <ul class="particul-cont">
            <li>
                <p id="p_p_1">名称</p>
                <span>${row.insurant.name_cn}</span>
            </li>
            <li>
                <p id="p_p_2">证件类型</p>
                <span id="insurant_id_type"><%--${row.insurant.id_type}--%></span>
            </li>
            <li>
                <p id="p_p_3">证件号</p>
                <span>${row.insurant.organization_code}</span>
            </li>
        </ul>
    </div>
    <div class="particul">
        <h2>投保基本信息</h2>
        <ul class="particul-cont">
            <li>
                <p>展会名称</p>
                <span>${row.special.name}</span>
            </li>
            <li>
                <p>所在城市</p>
                <span>${row.ex_area}</span>
            </li>
            <li>
                <p>具体地址</p>
                <span>${row.special.ex_address}</span>
            </li>
            <li>
                <p>是否包含拆搭建</p>
                <span>${row.special.contains eq '0'? '否' : '是'}</span>
            </li>
            <li>
                <p>保障开始时间</p>
                <span>${row.special.star_time}</span>
            </li>
            <li>
                <p>保障结束时间</p>
                <span>${row.special.end_time}</span>
            </li>
            <li>
                <p>展位号</p>
                <span>${row.special.ex_no}</span>
            </li>
            <li>
                <p>展位总面积</p>
                <span>${row.special.ex_acreage}平方</span>
            </li>
            <li>
                <p>雇员总人数</p>
                <span>${row.special.ex_emp_num}</span>
            </li>
            <li id="dj_c">
                <p>搭建公司</p>
                <span>${row.special.build_com_name}</span>
            </li>
            <li id="zb_c">
                <p>转包单位</p>
                <span>${row.special.subcontracting_units}</span>
            </li>
            <li id="special_exhibitor_name" style="display: none;">
                <p>参展商名称</p>
                <span>${row.special.exhibitor_name.trim()}</span>
            </li>
            <li id="special_exhibitor_type" style="display: none;">
                <p>证件类型</p>
                <span id="exhibitor_type"></span>
            </li>
            <li id="special_exhibitor_code" style="display: none;">
                <p>证件号码</p>
                <span>${row.special.exhibitor_code.trim()}</span>
            </li>
            <li>
                <p>司法管辖</p>
                <span class="xia">中华人民共和国司法管辖</span>
            </li>
            <li>
                <p>争议处理</p>
                <div class="dispute-processing">
                    <span id="dispute"><%--${row.special.dispute}--%></span>
                    <div class="litigation">
                        <i>若投保人/被保险人与保险人发生争执，不能达成协议，被保险人自愿采取的解决方式.</i>
                    </div>
                </div>
            </li>
            <li id="arbitral_institution_div" style="border-bottom: none;">
                <p>仲裁机构</p>
                <span>${row.special.arbitral_institution}</span>
            </li>
        </ul>
    </div>
    <div class="particul particul-bott">
        <h2>寄送信息</h2>
        <ul class="particul-cont">
            <li>
                <p>纸质保单</p>
                <input id="paper_ins_policy" placeholder="未选择" readonly="readonly">
            </li>
            <li style="border-bottom: none;">
                <p>发票</p>
                <input id="invoice_delivery"  placeholder="未选择" readonly="readonly">
            </li>
        </ul>
    </div>
</div>
<div class="pay">
    <a id="goPay" href="javascript:;">去投保并支付</a>
</div>
</body>
<script src="/static/weChat/js/jquery-1.8.3.min.js"></script>
<script src="/static/weChat/js/flexible.js"></script>
<script src="/static/weChat/js/basic.js"></script>
<script src="/static/weChat/js/iscroll.js"></script>
<script src="/static/weChat/js/SG_area_select-two.js"></script>

<script src="/static/weChat/js/jquery.formHelper.js"></script>
<script src="/static/weChat/common/layer_mobile/layer.js"></script>
<link rel="stylesheet" href="/static/weChat/common/layer_mobile/need/right.css"/>
<script src="/static/weChat/js/weixin_g.js"></script>

<script>
    //返回
    $("#back").click(function () {
        location.href="/weixin/order/zzx/zzx_write_order3?ins_insurance_slip_id=${p.ins_insurance_slip_id}";
    });
    //发票
    $("#invoice_delivery").click(function () {
        location.href="/weixin/order/zzx/order_invoice_delivery?ins_insurance_slip_id=${p.ins_insurance_slip_id}";
    });
    //纸质保单、保函
    $("#paper_ins_policy").click(function () {
        location.href="/weixin/order/zzx/order_paper_ins_policy?ins_insurance_slip_id=${p.ins_insurance_slip_id}";
    });

    $(function () {
        $('.dispute-processing').click(function () {
            if($('.litigation').hasClass('none')){
                $('.litigation').removeClass('none');
            }else{
                $('.litigation').addClass('none');
            }
        })
    });
    //投保人类型
    var role_type={"1":"参展商","2":"搭建商"}, show="";
    if('${row.applicant.role_type}'!='') show=role_type['${row.applicant.role_type}'];
    $("#applicant_role_type").html(show);
    //投保人和被保险人证件类型翻译
    var id_type={"7":"营业执照","6":"税务登记证","1":"组织机构代码证","2":"统一社会信用代码"}, show1="",show2="",show3="";
    if('${row.applicant.id_type}'!='') show1=id_type['${row.applicant.id_type}'];
    $("#applicant_id_type").html(show1);

    if('${row.insurant.id_type}'!='') show2=id_type['${row.insurant.id_type}'];
    $("#insurant_id_type").html(show2);

    if('${row.special.exhibitor_type.trim()}'!='') show3=id_type['${row.special.exhibitor_type.trim()}'];
    $("#exhibitor_type").html(show3);

    if('${row.special.contains}'=='0') $('#dj_c').hide();$('#zb_c').hide();

    //仲裁翻译
    var dispute={"1":"仲裁","0":"诉讼"}, show3="";
    if('${row.special.dispute}'!='') show3=dispute['${row.special.dispute}'];
    $("#dispute").html(show3);
    if('${row.special.dispute}'=='1'){
        $("#arbitral_institution_div").show();
    } else{
        $("#dispute").parent().parent().attr('style','border-bottom: none;');
        $("#arbitral_institution_div").hide();
    }

    //纸质保单、保函
    var need_insur_bill = "${row.ins_mail_policy.need_insur_bill}";
    if(need_insur_bill==""){
        $("#paper_ins_policy").val("");
        $("#paper_ins_policy").attr("placeholder","未选择");
    }else if(need_insur_bill==0){
        $("#paper_ins_policy").val("不需要");
    }else if(need_insur_bill==1){
        $("#paper_ins_policy").val("需要");
    }

    //是否需要发票，发票类型的设置
    var need_receipt  = "${row.ins_mail_policy.need_receipt}";
    var invoice_type  = "${row.ins_mail_policy.invoice_type}";
    if(need_receipt=="0" && invoice_type!=""){
        $("#invoice_delivery").val("不需要发票");
    }else if(invoice_type=="0" && need_receipt=="1"){
        $("#invoice_delivery").val("增值税普通发票");
    }else if(invoice_type=="1" && need_receipt=="1"){
        $("#invoice_delivery").val("增值税专用发票");
    }else{
        $("#invoice_delivery").val("");
        $("#invoice_delivery").attr("placeholder","未选择");
    }

    $("#goPay").click(function () {
        //校验发票是否选择了
        if($("#paper_ins_policy").val()=="" ||$("#invoice_delivery").val()=="" ){
            layer.open({content:"请选择发票和纸质保单是否寄送",btn: '我知道了'});
            return;
        }else{
            if("${row.order_status}"!=""){
                if("${row.order_status}"!="1" && "${row.order_status}"!="2"){
                    layer.open({content:"订单已生效不可以修改",btn: '我知道了'}); return;
                }
            }
            $("#mask").show();
            g_ajax("/weixin/order/zzx/transaction/API_Underwriting",{policyId:'${p.ins_insurance_slip_id}'},function(json){
                if(json.statusCode=="200"){
                    var pCode = '${row.product_code}';
                    if(pCode == '' ? false : pCode.indexOf('ZZX-ZA') > -1 ? true : false){
                        location.href="/ZA-API/zaCheckstand?oid=${p.ins_insurance_slip_id}&webType=app"
                    }
                    if(pCode == '' ? false : pCode.indexOf('ZZX-PAC') > -1 ? true : false){
                        location.href="/weixin/order/zzx/payment_pac/${p.ins_insurance_slip_id}"
                    }
                    if(pCode == '' ? false : pCode.indexOf('ZZX-YA') > -1 ? true : false){
                        location.href="/weixin/order/zzx/payment_ya/${p.ins_insurance_slip_id}"
                    }
                }else{
                    layer.open({content:json.message,btn: '我知道了'});
                }
                $("#mask").hide();
            });
        }
    });



    //debug
    $(document).ready(function () {
        //投保人为搭建商时，设置
        if('${row.applicant.role_type}'=='2'){
            //判断是否是平安产品，如果是，显示参展商
            if('${row.product_code}'.indexOf('ZZX-PAC')>-1||'${row.product_code}'.indexOf('ZZX-YA')>-1){
                if('${row.special.exhibitor_name.trim()}'!=''){
                    $('#special_exhibitor_name').show();
                    $('#special_exhibitor_type').show();
                    $('#special_exhibitor_code').show();
                }
            }else if('${row.product_code}'.indexOf('ZZX-ZA')>-1) {
                $('#p_p_1').html('参展商名称');
                $('#p_p_2').html('参展商证件类型');
                $('#p_p_3').html('参展商证件号码');
            }
        }
        <%--g_ajax("/weixin/order/detail/debug/",{ins_insurance_slip_id:'${p.ins_insurance_slip_id}'},function(json){--%>
        <%--console.log(json);--%>
        <%--},true);--%>
        $("#mask").hide();
    })

</script>

</html>