123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- $(function () {
- settime();
- });
- //验证码类型
- var sms_type;
- var smstype;
- var countdown=100;
- var indexRoute = $("#indexRoute").val();
- $("#countdown").css("backgroundColor","#fff")
- 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)
- }
- //用户名、帐号登录
- $('.loginUser').click(function(){
- $('label[for="user"]').addClass('select');
- $('label[for="pwd"]').removeClass('select');
- });
- $('.loginPwd').click(function(){
- $('label[for="pwd"]').addClass('select');
- $('label[for="user"]').removeClass('select');
- });
- $('.loginBtn').click(function(){
- var account = $("#user").val();
- var password = $("#pwd").val();
- var autoLogin = $("#autoLogin").val();
- if (account == "") {
- dialogDiv('请输入用户名','确定','Display');
- return false;
- }
- if (password == "") {
- dialogDiv('请输入密码','确定','Display');
- return false;
- }
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- url: $("#form1").attr('action'),
- type: 'POST',
- dataType: 'json',
- data: {
- account:account,
- password:password,
- autoLogin:autoLogin,
- },
- 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');
- }
- }
- })
- });
- // 手机动态码登录
- var regularMobile = /^13[0-9]{9}$|14[0-9]{9}$|15[0-9]{9}$|18[0-9]{9}$|17[0-9]{9}$/; // 验证手机号正则
- $('#J_dologinByMobile').on('click', function() {
- var mobileValue = $.trim($('input[name=mobile]').val());
- var verfyCodeValue = $.trim($('input[name=verfy_code]').val());
- var isQuick = $("#is_quick").val();
- if (mobileValue == "") {
- dialogDiv('请输入手机号','确定','Display');
- $('input[name=mobile]').focus();
- return false;
- }
- if (mobileValue != "" && !regularMobile.test(mobileValue)) {
- dialogDiv('手机号码格式不正确','确定','Display');
- return false;
- }
- if (verfyCodeValue == "") {
- dialogDiv('请填写验证码','确定','Display');
- $('input[name=verfy_code]').focus();
- return false;
- }
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- url: $("#form2").attr('action_to'),
- type: 'POST',
- dataType: 'json',
- data: {
- mobile:mobileValue,
- mobile_code:verfyCodeValue,
- },
- 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');
- }
- }
- })
- });
- //登录获取验证码
- $("#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==1)
- {
- $.ajax({
- headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
- url: $("#form2").attr('action'),
- type: 'POST',
- dataType: 'json',
- data: {
- mobile:mobileValue,
- },
- 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');
- }
- }
- })
- }
- }
- });
- function Register() {
- window.location.href = $("#indexRegister").val();
- return false;
- }
- function Display() {
- $("#MyDiv").remove();
- $("#fade").remove();
- }
- function create_resume() {
- window.location.href = +"?m=Aio&c=Members&a=createresume";
- return false;
- }
- //身份证注册
- $("#cardreg").click(function () {
- var card_mobile = $.trim($("#mobile").val());
- var mobilevcode = $.trim($("#mobilevcode").val());
- if(card_mobile=="")
- {
- dialogDiv('手机号不能空','确定','refresh');
- $("#mobile").focus();
- return false;
- }
- if(mobilevcode == "")
- {
- dialogDiv('验证码不能空','确定','refresh');
- $("#mobilevcode").focus();
- return false;
- }
- $.ajax({
- type:"post",
- url:root + "?m=Aio&c=Members&a=register",
- dataType:"json",
- data:$("#card_reg").serialize(),
- success:function (res) {
- console.log(res);
- if(res.status)
- {
- window.location.href = res.data;
- }
- else
- {
- dialogDiv(res.msg,'确定','toback');
- }
- }
- })
- });
- $("#saveresume").click(function () {
- var username = $("input[name='username']").val();
- var education = $('#education').val();
- var salary = $("#salary").val();
- var email = $("#email").val();
- if(username == '' || username == null)
- {
- dialogDiv("姓名不能为空",'确定','refresh');
- return ;
- }
- else if(education == '' || education == null)
- {
- dialogDiv("学历不能为空",'确定','refresh');
- return ;
- }
- else if(salary == '' || salary == null)
- {
- dialogDiv("薪资不能为空",'确定','refresh');
- return ;
- }
- // else if(email =='' || email == null)
- // {
- // dialogDiv("email不能为空",'是','refresh');
- // return ;
- // }
- else
- {
- $.ajax({
- url:root + "?m=Aio&c=Members&a=createresume",
- type:'POST',
- dataType:"JSON",
- data:$("#createresume").serialize(),
- success:function (res) {
- if(parseInt(res.status))
- {
- dialogDiv(res.msg,'确定','savelocation');
- }
- else
- {
- dialogDiv(res.msg,'确定','refresh');
- }
- }
- })
- }
- });
- $("#saveresume2").click(function () {
- var username = $("input[name='username']").val();
- var education = $('#education').val();
- var salary = $("#salary").val();
- var email = $("#email").val();
- if(username == '' || username == null)
- {
- dialogDiv("姓名不能为空",'确定','refresh');
- return ;
- }
- else if(education == '' || education == null)
- {
- dialogDiv("学历不能为空",'确定','refresh');
- return ;
- }
- else if(salary == '' || salary == null)
- {
- dialogDiv("薪资不能为空",'确定','refresh');
- return ;
- }
- // else if(email =='' || email == null)
- // {
- // dialogDiv("email不能为空",'是','refresh');
- // return ;
- // }
- else
- {
- $.ajax({
- url:root + "?m=Aio&c=Members&a=editresume",
- type:'POST',
- dataType:"JSON",
- data:$("#editresume").serialize(),
- success:function (res) {
- if(parseInt(res.status))
- {
- dialogDiv(res.msg,'确定','savelocation');
- }
- else
- {
- dialogDiv(res.msg,'确定','refresh');
- }
- }
- })
- }
- });
- function savelocation() {
- window.location.href = 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<newsidinfoarray.length; i++){
- if(newsidinfoarray[i].substring(0,2)=='c='){
- newsids=newsidinfoarray[i].split("=");//对获得的参数字符串按照“=”进行分割
- newsid=newsids[1];//得到参数值
- }
- }
- if((newsid=="Job")||(newsid=="job")){
- if(newsidinfo.indexOf("flag")!=-1){
- $(".foot-child").css('background','none');
- $('#zyjs').css('background','url(/Application/Aio/View/default/public/images/footer/footer-zyjs-hover.png) no-repeat');
- }else if(newsidinfo.indexOf("advice")!=-1){
- $(".foot-child").css('background','none');
- } else{
- $(".foot-child").css('background','none');
- $('#zxzw').css('background','url(/Application/Aio/View/default/public/images/footer/footer-zxzw-hover.png) no-repeat');
- }
- }else if((newsid=="Company")||(newsid=="company")){
- $(".foot-child").css('background','none');
- $('#mqzp').css('background','url(/Application/Aio/View/default/public/images/footer/footer-mqzp-hover.png) no-repeat');
- }else if((newsid=="News")||(newsid=="news")){
- $(".foot-child").css('background','none');
- $('#gkxx').css('background','url(/Application/Aio/View/default/public/images/footer/footer-gkxx-hover.png) no-repeat');
- }else if((newsid=="Qianren")||(newsid=="qianren")){
- $(".foot-child").css('background','none');
- $('#sbcx').css('background','url(/Application/Aio/View/default/public/images/footer/footer-sbcx-hover.png) no-repeat');
- }else if(newsid=="members"){
- if(newsidinfo.indexOf("index")!=-1){
- $(".foot-child").css('background','none');
- }else if(newsidinfo.indexOf("login")!=-1){
- $(".foot-child").css('background','none');
- }else if(newsidinfo.indexOf("personal")!=-1){
- $(".foot-child").css('background','none');
- }else if(newsidinfo.indexOf("register")!=-1){
- $(".foot-child").css('background','none');
- }else{
- $(".foot-child").css('background','none');
- $('#jldy').css('background','url(/Application/Aio/View/default/public/images/footer/footer-jldy-hover.png) no-repeat');
- }
- }
- }
|