$(function () { settime(); }); //验证码类型 var sms_type; var smstype; var countdown=100; $("#countdown").css("backgroundColor","#fff"); var indexRoute = $("#indexRoute").val(); function settime() { if (countdown == 0) { $("#btn").hide(); window.location.href=indexRoute; } else { countdown--; if(document.getElementById('countdown')){ document.getElementById('countdown').innerHTML = countdown; } } setTimeout(function() { settime(); },1000) } //注册获取验证码 $("#getverificode").click(function () { var is_reg = $("#is_reg").val(); var is_status = $("#is_status").val(); var mobileValue = $.trim($('#mobile').val()); if (mobileValue == '') { dialogDiv('请输入手机号码','确定','Display'); $('#mobile').focus(); return false; }; if (mobileValue != "" && !regularMobile.test(mobileValue)) { dialogDiv('请输入正确的手机号码','确定','Display'); $('#mobile').focus(); return false; } if(is_status==1){ if(is_reg==0) { $.ajax({ headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, url: $("#form3").attr('action'), type: 'POST', dataType: 'json', data: { mobile:mobileValue, type:2, }, success: function (result) { // 开始倒计时 var countdownZZ = 60; function settime() { if (countdownZZ == 0) { $('#getverificode').prop("disabled", 0); $('#getverificode').removeClass('btn_disabled'); $('#getverificode').html('获取验证码'); $("#is_status").val(1); countdownZZ = 100; return; } else { $("#is_status").val(0); $('#getverificode').prop("disabled", !0); $('#getverificode').addClass('btn_disabled'); $("#getverificode").css('font-size','18px') $('#getverificode').html('重新发送' + countdownZZ + '秒'); countdownZZ--; } setTimeout(function() { settime() },1000) } settime(); }, error: function (errorData) { if (errorData.status==422) {//验证错误 $.each(JSON.parse(errorData.responseText).errors,function (key,val) { dialogDiv(val[0],'确定','Display'); return false; }); } else if(errorData.status==400) {//业务错误 dialogDiv(JSON.parse(errorData.responseText).message,'确定','Display'); } } }) } } }); $('#btnsubmit').click(function() { var reg_mobile = $.trim($("#mobile").val()); var reg_verifiy = $.trim($("#verifiy").val()); var id_card = $.trim($("#id_card").val()); var name = $.trim($("#name").val()); var nation = $.trim($("#nation").val()); var sex = $.trim($("#sex").val()); if(reg_mobile=="") { dialogDiv('手机号不能空','确定','Display'); $("#mobile").focus(); return false; } if(reg_verifiy == "") { dialogDiv('验证码不能空','确定','Display'); $("#verifiy").focus(); return false; } $.ajax({ headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, url: $("#form3").attr('action_to'), type: 'POST', dataType: 'json', data: { mobile:reg_mobile, mobile_code:reg_verifiy, id_card:id_card, name:name, nation:nation, sex:sex, }, success: function (result) { location.href=result.data.redirect_url; }, error: function (errorData) { if (errorData.status==422) {//验证错误 $.each(JSON.parse(errorData.responseText).errors,function (key,val) { dialogDiv(val[0],'确定','Display'); return false; }); } else if(errorData.status==400) {//业务错误 dialogDiv(JSON.parse(errorData.responseText).message,'确定','Display'); } } }) }); function reg() { window.location.href= root + "?m=Aio&c=Members&a=createresume"; return false; } function Display() { $("#MyDiv").remove(); $("#fade").remove(); } function savelocation() { window.location.href = qscms.root +"?m=Aio&c=Job&a=joblist&flag=1" } function toback() { window.history.go(-1); } function refresh() { window.location.reload(); } /*底部导航选中事件 by zmy 2018 02 06*/ window.onload=function(){ urlinfo=window.location.href; //获取当前页面的url len=urlinfo.length;//获取url的长度 offset=urlinfo.indexOf("?");//设置参数字符串开始的位置 newsidinfo_first=urlinfo.substr(offset,len)//取出参数字符串 newsidinfo = newsidinfo_first.replace('?','') newsidinfoarray = newsidinfo.split("&");//以&分隔形成参数数组 var newsid; for(var i=0; i