//表单提交
$(document).on('click', '.button', function () {
    var name = $('.user_name').val();
    var tell = $('.mobile').val();

    var sid = $('#sid').val();
    var source = 'B-'+ sid

    var mobile = !!tell.match(/^(0|86|17951)?(13[0-9]|16[0-9]|19[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
    if (name == "" || name == null) {
        layer.open({
            content: '请输入姓名',
            skin: 'msg',
            time: 1000,
        })
        return false;
    }


    if (tell == "" || tell == null) {
        layer.open({
            content: '请输入手机号',
            skin: 'msg',
            time: 1000,
        })
        return false;
    }
    if (mobile == false) {
        layer.open({
            content: '请填写正确的手机号',
            skin: 'msg',
            time: 1000,
        })
        return false;
    }

    $.ajax({
        url: '/index/index/sub',
        type: 'post',
        data: {
            name,
            tell,
            source
        },
        dataType: 'json',
        success: function (res) {
            if (res.code == 0) {
                layer.open({
                    content: '姓名与手机号不能为空!',
                    skin: 'msg',
                    time: 1000,
                })
            } else if (res.code == 1) {
                layer.open({
                    content: '感谢您的参与!',
                    skin: 'msg',
                    time: 1000,
                })
            }
        }
    })
})

//判断初试/复试 内容是否为空 为空则隐藏

var info1 = $('.test_info1').text();
if(info1 == '' || info1 == null){
    $('.parent_test1').hide();
}
var info2 = $('.test_info2').text();
if(info2 == '' || info2 == null){
    $('.parent_test2').hide();
}
var info3 = $('.test_info3').text();
if(info3 == '' || info3 == null){
    $('.parent_test3').hide();
}
var info4 = $('.test_info4').text();
if(info4 == '' || info4 == null){
    $('.parent_test4').hide();
}
var info5 = $('.test_info5').text();
if(info5 == '' || info5 == null){
    $('.parent_test5').hide();
}
var info6 = $('.test_info6').text();
if(info6 == '' || info6 == null){
    $('.parent_test6').hide();
}



var bigHeight=$(".all").outerHeight(true);
var navHeight=$(".path").outerHeight(true);
var height=bigHeight+navHeight+100;
$(document).scroll(function () {

    if ($(document).scrollTop() > height+100) {
        $(".list_s").slideDown(100);
    } else {
        $(".list_s").slideUp(100);
    }
});


$('.lists>ul>li').click(function(){
    $(this).addClass('check').siblings().removeClass('check')
})