const pageIndex = sysConfig.actionname=='index' && sysConfig.controllername == 'index'; var swiperData = { // effect: 'cube', loop:pageIndex, // effect: 'coverflow', grabCursor: true, centeredSlides: true, slidesPerView: 'auto', coverflowEffect: { // rotate: 50, // stretch: 0, // depth: 100, // modifier: 1, // slideShadows: true, }, pagination: { el: '.swiper-pagination', }, on:{ // init:function(swiper){ // slide=this.slides.eq(0); // slide.addClass('ani-slide'); // }, // transitionStart: function(){ // for(i=0;i 10){ $("#head").css('background','white'); }else{ $("#head").css('background','transparent'); } }) $(window).scroll(); $('#menu .list li').click(function(ev){ if($(this).find('.iconfont').length == 0) return; $(this).find('>ul').slideToggle(); if($(this).hasClass('active')){ $(this).removeClass('active') }else $(this).addClass('active'); $(this).siblings('.active').find(">ul").slideUp() $(this).siblings('.active').removeClass('active'); ev.stopPropagation(); }) $("#menu .close").click(function(){ $("#menu .main").fadeOut(); }) $("#menu .menu").click(function(){ $("#menu .main").fadeIn(); }) $(".auth_jump").click(function(){ if(loginIs) location.href = $(this).attr('href'); else base.login(0); return false; }) // type =0鐧诲綍 1娉ㄥ唽 base.login = function(type){ $("#login .box").hide(); if(type == 0) $("#login .login-box").show(); else $("#login .register-box").show(); $(".codeImg").click(); $("#login").fadeIn(); } $("#head .info .login span").click(function(){ base.login($(this).index()-1); }) $("#login .mask,#login .login-close").click(function(){ $("#login").fadeOut(); }) $("#login .register").click(function(){ base.login(1); }) $(".jump_login").click(function(){ base.login(0); }) form.verify({ account: function(value, item){ //value锛氳〃鍗曠殑鍊笺€乮tem锛氳〃鍗曠殑DOM瀵硅薄 if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s路]+$").test(value)){ return '璐﹀彿涓嶈兘鏈夌壒娈婂瓧绗?; } // if(value.length < 6 || value.length > 25){ // return '璐﹀彿涓?-25涓瓧绗?; // } } ,password: [ /^[\S]{6,12}$/ ,'瀵嗙爜蹇呴』6鍒?2浣嶏紝涓斾笉鑳藉嚭鐜扮┖鏍? ], address: function(value, item){ //value锛氳〃鍗曠殑鍊笺€乮tem锛氳〃鍗曠殑DOM瀵硅薄 if(value.length < 4){ return '鍦板潃涓嶈兘灏忎簬4涓瓧绗?; } } }); form.on('submit(login)', function(data){ var data = data.field , url = ''; if(data['type'] == 'login') url = '/login'; else url = '/register'; $.post(url,data,function(res){ $(".codeImg").click(); layer.msg(res.msg,function(){ if(res.code != 0) location.reload(); }); }) return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆 }); $(".codeImg").click(function(){ $(this).attr('src','/captcha.html?t='+new Date().getTime()); }) base.auth = function(id,fun){ $(id).click(function(){ if(loginIs) fun(); else{ base.login(0); } }) } })