var hock = true; var layerindex; /** * 发送信息 * @param type 0 在线留言 1 商桥沟通 * @param module 消息来源页面 * @param point 页面埋点 */ function sendmsg(type= 0,module='index',point=''){ if(type == 1){ window.open(bd_link); }else{ $('#modal_source_module').val(module); $("#modal_source_point").val(point); layerindex = layer.open({ type: 1, title:false, shadeclose:1, closebtn:0, skin: 'w-layer-form', area:['660px','320px'], content:$('.pupmodal') }); $("#layerindex").val(layerindex); } } /** * 提交弹出表单 * @param obj */ function modalmsg(obj){ var loading = layer.load(2), post_url = $(obj).data('href'), point = $("#modal_source_point").val() address = $("#modal_source_address").val() module = $("#modal_source_module").val() tel = $("#modal_tel").val(), captcha = $("#modal-captcha").val(); $.ajax({ type: "post", datatype: "json", url: post_url, data: {tel: tel, source_point: point,source_module:module,address:'',name:'游客',captcha:captcha}, success: function (data) { if(data.code == 2012){ layer.close(loading); layer.msg("您的信息已提交,我们会尽快与您联系,请保持电话畅通!"); formitem[0].reset(); // 提交成功重置 $('#verifyimg').click(); } else if(data.code == 4013){ layer.close(loading); layer.msg(data.msg); $('#verifyimg').click(); $("#float_captcha").val('').focus(); } else { layer.close(loading); layer.msg(data.msg); } }, error: function () { layer.close(loading); layer.msg(res.msg); } }); } function closemodal(){ layer.closeall(); } function refreshverify(url,obj=$('#verifyimg')) { timestamp = new date().gettime(); obj.attr('src', url + timestamp); } function closefloat(){ $(".bottom-float").hide(); $(".bottom-float").next('div').hide(); } function floatmsg(formobj=$('#floatform'),verifyimgobj=$("#verifyimg"),captchaobj=$("#float_captcha"),islayer = false){ let formitem = formobj; if(!hock) return; var _form = formitem.serializearray(); var f = {}; var _place = {}; $.each(_form, function (i, field) { f[field.name] = field.value; _place[field.name] = $('*[name=' + field.name + ']').attr('placeholder'); }); if (f.tel == '' || f.tel == _place.mobile) { layer.msg('请输入您的电话'); $('*[name=tel]').focus(); } else if (f.captcha == '' || f.captcha == _place.captcha) { layer.msg('请输入验证码'); $('*[name=captcha]').focus(); } else { var layerindex = $("#layerindex").val(); hock = false; var option = { url: "/index/message/addmessage", type : 'post', datatype : 'json', success : function(data) { hock = true; if(data.code == 2012){ layer.closeall(); layer.msg("您的信息已提交,我们会尽快与您联系,请保持电话畅通!",{},function (){ }); verifyimgobj.click(); formitem[0].reset(); // 提交成功重置 } else if(data.code == 4013){ layer.msg(data.msg); verifyimgobj.click(); captchaobj.val('').focus(); } else { layer.msg(data.msg); } }, fail:function (res){ hock = true; layer.msg(res.msg); } }; formitem.ajaxsubmit(option); } } function myqingfeng(){ $(".nav li").on('mouseover',function(){ let index =$(this).index(), itemcon = $(".nav-container .child-item"), currentcon = itemcon.eq(index); $(this).addclass('active').siblings().removeclass('active'); itemcon.removeclass('active').eq(index).addclass("active"); currentcon.find(".animate-nav").each(function( index ) { $( this ).addclass("animated fadeinup").css({'animation-delay': (index/10)+'s'}); }); $(this).parents(".header").addclass('hover'); $(".dropdown-nav").stop().slidedown(); }) $(".header").on("mouseleave",function (){ $(this).removeclass("hover"); $(".dropdown-nav").stop().slideup(function (){ $(".child-item").removeclass('active'); }); }) $('.counter').countup(); $('.paroller').paroller(); $('.channel-nav li').each(function (index,item){ $(this).on('click',function (){ let tocontent = $(this).find('a').attr('data-href'); $.scrollto(tocontent,1000); }) }) if (!(/msie [6|7|8|9]/i.test(navigator.useragent))){ try{ var wow = new wow(); if(wow){ new wow({ boxclass: 'wow', animateclass: 'animated', offset: 100, mobile: true, live: true }).init(); } }catch (e){ console.log(e) } }; $(window).scroll(function () { var scrolltop = $(window).scrolltop(), headerheight = $('.header').outerheight(true); if(scrolltop >= 30){ $('.header').addclass('header-min'); }else{ $('.header').removeclass('header-min'); } }); $('.bottom-float').scrolltofixed( { bottom: 0, limit: function() { var limit = 0; limit = $('.footer').offset().top - $(this).outerheight(true) - 10; return limit; }, index:999 }); } myqingfeng();