<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>核对身份证信息</title>
    <link rel="stylesheet" type="text/css" href="/YtjCommon/css/bootstrap.min1.css">
    <link rel="stylesheet" type="text/css" href="/YtjCommon/css/style1.css">
    <link rel="stylesheet" type="text/css" href="/YtjCommon/css/f_css1.css">
    <link href="/YtjCommon/css/learunui-login1.css" rel="stylesheet">
    <link href="/YtjCommon/css/alert.css" rel="stylesheet" />
    <script src="/YtjCommon/JS/alert.min.js"></script>
</head>
<style>
    .black_overlay {
        display: none;
        position: absolute;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: white;
        z-index: 1001;
        -moz-opacity: 0.8;
        opacity: .80;
        filter: alpha(opacity=80);
    }

    .white_content {
        display: none;
        position: absolute;
        top: 25%;
        left: 30%;
        width: 40%;
        height: 30%;
        background-color: #5dabd6;
        z-index: 1002;
        overflow: auto;
    }

    .fhsubmit-btn {
        display: block;
        margin: 0 auto;
        width: 116px;
        height: 65px;
        line-height: 65px;
        text-align: center;
        border: 0;
        background-color: #1b87d9;
        font-family: "Microsoft YaHei";
        font-size: 18px;
        color: #fff;
        cursor: pointer;
    }

    /*数字键盘样式*/
    .idcardinfo-keyboard {
        width: 50%;
        float: right;
    }

    .idcardinfo-keyboard ul {
        list-style-type: none;
        width: 52%;
        margin: auto 38% auto 10%;
    }

    .idcardinfo-keyboard ul li {
        width: 23.33%;
        margin-left: 8%;
        margin-top: 8%;
        height: 0;
        padding-bottom: 17%;
        padding-top: 8%;
        background: skyblue;
        float: left;
        text-align: center;
        border-radius: 5px;
        font-size:36px;
        font-weight: bold;
    }

    .idcardinfo-keyboard .top {
        margin-top: 0;
    }

    a {
        color: #337ab7;
    }
</style>
<!--手写签名函数-->
<script>
    $(function () {
        $('.idcardinfo-keyboard .l').click(function () {
            var phonenum = $('#sjhm').val();
            var numvalue = $(this).text();
            var phonenum = phonenum + numvalue;
            $('#sjhm').val(phonenum);
        });

        $('.idcardinfo-keyboard ul .remove').click(function () {
            var phonenum = $('#sjhm').val();
            phonenum = phonenum.substring(0, phonenum.length - 1);
            $('#sjhm').val(phonenum);
        });
        $('.idcardinfo-keyboard ul #clean').click(function () {//清空
            $('#sjhm').val("");
        });
        //下一步验证手机号
        $('#next').click(function () {
            var regphone = /^(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/;
            var phonenum = $('#sjhm').val();
            if (phonenum === '') {
                jqueryAlert({
                    'icon': '/YtjCommon/img/warning.png',
                    'content': '手机号码不能为空',
                    'closeTime': 4000,
                });
                return false;
            } else if (regphone.test(phonenum) === false) {
                jqueryAlert({
                    'icon': '/YtjCommon/img/warning.png',
                    'content': '请填写正确的手机号码',
                    'closeTime': 4000,
                });
                return false;
            } else {
                try {
                    var url = "SubmitCard";
                    $.post(url,
                        $("#form1").serialize(),
                        function (rtnData) {
                            if (rtnData=="1") {
                                window.location.href = "/GsYw/Index";
                            }
                        });
                } catch (e) {
                    //alert("");
                    return false;
                }
            }
        });



        ////------------读取身份证信息---------------//
        function readInfo() {
            m_info = read_info();
            if (m_info) {
                var idInfo = JSON.parse(m_info);//读取身份证
                $('#sfzm').val(idInfo.name);//姓名
                //$("#jyzxb").val(idInfo.sex);//性别
                //$("#jyzmz").val(idInfo.nation);//民族
                $("#sfztx").attr('src', "data:image/jpeg;base64," + idInfo.idImg);
                $("#tximg").val(idInfo.idImg);
                $("#sfzdz").val(idInfo.address);
                //$("#sfzjg").val(idInfo.grantdept);
                $('#sfzh').val(idInfo.idCardNo);
                setTimeout("voicestring()", 1000);//播报语音信息
            }
        }
        readInfo();
        GetCard();
    });

    //获取已经读取过得身份证信息
    function GetCard()
    {
        alert($("#sfzh").val());
        $.ajax({
            url: "GetCardInfo?hm=" + $("#sfzh").val(),
            type: "get",
            dataType: 'json',
            data: "{}",
            success: function (data) {
                //debugger;
                if (data != "" && data != null) {
                    //$("#sjhm").val(data.Table[0].sjhm);
                    if (data.Table.length != 0) {
                        $("#sjhm").val(data.Table[0].Sjhm);
                        $("#sjhm").focus();
                    }
                    else {
                        $("#sjhm").focus();
                    }
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/YtjCommon/img/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

</script>
<body>
<header>
    <h2 class="title fl tit-con"th:text="${city}+'个体企业执照自助打印终端'"></h2>
    <a class="fr fan" href="/Index">返回首页</a>
</header>
<div class="content">
    <div class="bg_white">

        <div class="content_960_b" style=" border-top:none;" id="mcxxdiv">
            <div class="con_900">
                <div class="sbxxtl">

                    <div class="con_840" style="margin-top:60px;">
                        <div class="sbxxtl_title mb20">核对身份证信息</div>

                        <div class="idcardinfo-keyboard " style=" float:right; width:40%">
                            <ul>
                                <a href="#">
                                    <li class="l">7</li>
                                </a>
                                <a href="#">
                                    <li class="l">8</li>
                                </a>
                                <a href="#">
                                    <li class="l">9</li>
                                </a>
                                <a href="#">
                                    <li class="l">4</li>
                                </a>
                                <a href="#">
                                    <li class="l">5</li>
                                </a>
                                <a href="#">
                                    <li class="l">6</li>
                                </a>
                                <a href="#">
                                    <li class="l">1</li>
                                </a>
                                <a href="#">
                                    <li class="l">2</li>
                                </a>
                                <a href="#">
                                    <li class="l">3</li>
                                </a>
                                <a href="#">
                                    <li class="l">0</li>
                                </a>
                                <a href="#">
                                    <li id="clean" class="remove1">清空</li>
                                </a>
                                <a href="#">
                                    <li class="remove">删除</li>
                                </a>
                            </ul>
                        </div>
                        <div class="user_pic" style=" position:absolute; top:320px; left:880px;">
                            <img src="" class="btn" id="sfztx" name="sfztx" style="width:140px; height:190px; padding:0;" data-target="#avatar-modal" data-toggle="modal">
                        </div>
                        <form id="form1" name="form1">
                            <div class="form_item"  style=" margin-top:50px;">
                                <label class="input_label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
                                <span class="input_right">
                <input type="text" name="sfzm" id="sfzm" readonly="readonly"  class="txt" style="width:410px;">
                <input type="hidden" name="tximg" id="tximg">
                </span></div>
                            <div class="form_item" >
                                <label class="input_label">身份证号：</label>
                                <span class="input_right">
                <input type="text" name="sfzh" id="sfzh" readonly="readonly"  class="txt" style="width:410px;">
                </span>
                            </div>

                            <div class="form_item" >
                                <label class="input_label"><font color="red">*</font>手机号码(接收短信)：</label>
                                <span class="input_right">
                    <input type="hidden" name="" id="plvoicestr" value="请输入手机号码" placeholder="要播报的字符串">
                <input type="text" name="sjhm" id="sjhm" class="txt" style="width:410px;">
                </span>
                            </div>
                            <div class="form_item" style="margin-bottom:180px;">
                                <label class="input_label">家庭住址：</label>
                                <span class="input_right">
                <input type="text" name="sfzdz" id="sfzdz" readonly="readonly" class="txt" style="width:565px;">
                </span>
                            </div>
                        </form>
                        <div class="solid_line_top mb30 mt30"></div>
                        <div class="form_item" style="width:100%;">
                            <label class="input_label" style="width:40%">&nbsp;</label>
                            <button class="btn_b btn fl" type="button" id="next">下一步</button>
                        </div>
                    </div>
                    <br>
                </div>
            </div>
        </div>

    </div>
</div>
<div style="position:absolute;right:5%;"><span class="fl dao" id="agree_btn">本页将在282秒后返回首页</span>
</div>
<script>
    var secs = 300;
    //document.agree.agreeb.disabled=true;
    for (var i = 0; i <= secs; i++) {
        window.setTimeout("update(" + i + ")", i * 1000);
    }
    function update(num) {
        if (num == secs) {
            // 超时返回到首页
            // window.href = "../../index.html";
            location.href = "/Index";

        }
        else {
            var printnr = secs - num;
            //document.agree.agreeb.value = "本页受理倒计时:" + printnr+"秒！";
            //document.agree.agreeb.innerHTML = "本页受理倒计时:" + printnr+"秒！";

            var testdiv = document.getElementById("agree_btn");
            testdiv.innerHTML = "本页将在" + printnr + "秒后返回首页";
        }
    }

    function showtime(t) {
        document.myform.phone.disabled = true;
        for (i = 0; i <= t; i++) {
            window.setTimeout("update_p(" + i + "," + t + ")", i * 1000);
        }

    }
    function goBack() {
        history.go(-1);
    }

</script>
</body>
</html>
