<div class="mask-box ">
    <div class="position-middle-center ptb20 bgff" style="width:800px;border-radius: 5px;">
        <div class="pcub-pac pcub mb20">
            <img src="/images/car01.png" alt="" style="width:50px;height:50px;">
            <span class="fz20 ml20">注册成功，请完善个人资料</span>
        </div>
        <div style="color:#333;width: 80%;margin: 0 auto;padding: 5px 0;background: #ffffe5;border: 1px #f7b652 solid;text-align: center;">
            提示：完善资料后可免费查看所有资源报价
        </div>
        <div class="layui-form pt20 pr20" action="" lay-filter="example">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px"><i class="span-dot">*</i>联系人：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name"  value=""  lay-verify="required" autocomplete="off" placeholder="请输入联系人" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px"><i class="span-dot">*</i>QQ：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="qq"  value=""  lay-verify="required" autocomplete="off" placeholder="请输入QQ" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px"><i class="span-dot">*</i>邮箱：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="email"  value=""  lay-verify="email" autocomplete="off" placeholder="请输入邮箱" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px">企业名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="company"  value=""   autocomplete="off" placeholder="请输入企业名称" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px">行业：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="industry"  value=""  autocomplete="off" placeholder="请输入行业" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px">推广内容：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="promote"  value=""   autocomplete="off" placeholder="请输入推广内容" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width:110px">意向需求：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="need"  value=""   autocomplete="off" placeholder="请输入意向需求" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="pcub pcub-pac">
                <button class="layui-btn"  id="info_click">立即提交</button>
            </div>
        </div>
    </div>
</div>
@section('script')
    <script src="/layui/layui.js"></script>
    <script>
        layui.use(['form','table'], function () {
            var form = layui.form;
        });
        $("#info_click").click(function(){
            var  name = $('input[name="name"]').val();
            var  company = $('input[name="company"]').val();
            var  qq = $('input[name="qq"]').val();
            var  email = $('input[name="email"]').val();
            var  industry = $('input[name="industry"]').val();
            var  promote = $('input[name="promote"]').val();
            var  need = $('input[name="need"]').val();
            var pattern = /^[1-9][0-9]{4,10}$/;
            var ePattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            if(!name)
            {
                layer.msg('请填写正确的联系人');
                return false;
            }else if(!qq)
            {
                layer.msg('请填写正确qq');
                return false;
            }else if(!pattern.test(qq) )
            {
                layer.msg('请填写正确qq');
                return false;
            }else if(!email)
            {
                layer.msg('请填写正确email');
                return false;
            }else if(!ePattern.test(email))
            {
                layer.msg('请填写正确email');
                return false;
            }else{
                $.ajax({
                    type: "post",
                    url:"index/info",
                    dataType: "json",
                    data:{
                        'name':name,
                        'company':company,
                        'qq':qq,
                        'email':email,
                        'industry':industry,
                        'promote':promote,
                        'need':need,
                    },
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    success: function(data){
                        if(data.code == '200')
                        {
                            layer.msg('提交成功');
                            setTimeout(function(){
                                window.location.reload();
                            },1000);
                        }else{
                            layer.msg(data.info);
                        }
                    },
                });
            }
        })
    </script>
@endsection