(function() { let body = $("body"); if(isFrontEnv()) { body.addClass("cn-show"); } else { body.addClass("cn-make"); } })(); $(() => { $(".pubNav .p_list .p_loopitem a").filter(`[href='${location.pathname}']`).addClass("light"); $("a.backtop").click(function() { $("body, html").stop().animate({ "scrollTop": 0 }); }); $(".saf-cateLink a").each(function() { (function(a) { var href = a.attr("href"); var sub = $("
").addClass("cn_Relist"); $(".saf-ReList > .p_item").append(sub); $.get(href, function(r) { $(r).filter(".main").find(".cnReInfo .p_list").children().appendTo(sub); }); })($(this)); }); $(".saf-search a").click(function(){ if($(".saf-search input").val() == ""){ $(".saf-search").addClass("is-invalid"); $(".saf-search input").attr("placeholder","关键词不能为空!"); }else{ location.href = "/globalSearch.html?keywords="+encodeURI($(".saf-search input").val())+"&appIds=all"; } }) $("#c_static_001-16717571543760 .e_h3-12").each(function(i){ $(this).click(function(){ $("#c_static_001-16717571543760 .e_h3-12.light").removeClass("light"); $(this).addClass("light"); $("#c_static_001-16717571543760 .e_loop-17 .p_loopitem.light").removeClass("light"); $("#c_static_001-16717571543760 .e_loop-17 .p_loopitem").eq(i).addClass("light"); }) }) $(".header ul li.p_level1Item .p_level2Box li.p_level2Item a, .saf-footerNav ul li.p_level1Item ul.p_level2Box li.p_level2Item p.p_menu2Item a").click(function() { var href= $(this).attr("href"); if (href.indexOf("training") >= 0){ var DivId1 = $(this).attr("href").replace("/training.html",""); $("html, body").animate({ scrollTop: $(DivId1).offset().top - 100 }, 1000); }; if (href.indexOf("business") >= 0){ var DivId2 = $(this).attr("href").replace("/business.html",""); $("html, body").animate({ scrollTop: $(DivId2).offset().top - 100 }, 1000); }; if (href.indexOf("cooperation") >= 0){ var DivId3 = $(this).attr("href").replace("/cooperation.html",""); $("html, body").animate({ scrollTop: $(DivId3).offset().top - 100 }, 1000); }; if (href.indexOf("pioneer") >= 0){ var DivId4 = $(this).attr("href").replace("/pioneer.html",""); $("html, body").animate({ scrollTop: $(DivId4).offset().top - 100 }, 1000); }; }); }); $.fn.svg = function(name, wrapper) { if (!$.fn.svg_init) { $.fn.svg_init = !$.fn.svg_init; setInterval(() => { $("[cn-svg]").each(function() { let svg = $(this).attr("cn-svg") || ""; let wrapper = $(this).attr("cn-svg-wrapper"); let index = $(this).attr("cn-svg-index"); $(this).removeAttr("cn-svg cn-svg-wrapper cn-svg-index")[svg.indexOf("#") > -1 ? "append" : "prepend"]($(".cn-svgs ." + svg.replace("#", "")).find("svg").clone().each((b,a) => { wrapper && $(a).wrap($("
").addClass(wrapper, wrapper + "-" + ++index)); })[wrapper?"parent":"first"]()); }); }, 60); } name && this.each((b,a) => (new RegExp("\\+","ig").test(name)?name.slice(0, -1):name.split(",")[b]) && $(a).attr("cn-svg", new RegExp("\\+","ig").test(name)?name.slice(0, -1):name.split(",")[b]).attr("cn-svg-wrapper", wrapper || "").attr("cn-svg-index", b)); }; $(()=>{ $("body").svg(); }); $(()=>{ $(".cn-show [saf-loop-swiper]").each(function(i){ let ss = $(this).attr("saf-loop-swiper"); if(ss == "true"){ let auto = $(this).attr("saf-sw-auto").split(","); if(auto[0] == "true") { var autoplay = { delay: parseInt(auto[1]), pauseOnMouseEnter:true, disableOnInteraction: false, }; } else { var autoplay = false; }; var loop = $(this).attr("saf-sw-loop"); if(loop == "true"){ var loop = true; }else { var loop = false; }; let between = parseInt($(this).attr("saf-sw-between")); let num = $(this).attr("saf-sw-num").split(","); $(this).find(".p_list").addClass("saf-swiper"+i).children(".p_loopitem").addClass("swiper-slide").css("flex","none").wrapAll("
"); let safbar= "
"; $(this).find(".p_list").append(safbar); $(".saf-swiper"+i+" .s_prev").svg("prev"); $(".saf-swiper"+i+" .s_next").svg("next"); var swiper = new Swiper(".saf-swiper"+i+" .swiper-container", { autoplay:autoplay, loop:loop, slidesPerView: num[0], speed:800, spaceBetween: between, pagination: { el: ".saf-swiper"+i+" .saf-cn-pagination", }, navigation: { nextEl: ".saf-swiper"+i+" .s_next", prevEl: ".saf-swiper"+i+" .s_prev", }, breakpoints: { 0: { slidesPerView: num[3], spaceBetween: between }, 768: { slidesPerView: num[2], spaceBetween: between }, 1024: { slidesPerView: num[1], spaceBetween: between }, 1400: { slidesPerView: num[0], spaceBetween: between } } }); } }) }) //无数据提示 $(()=>{ $(".p_nodata").each(function(){ $(this).html('

Sorry,本栏目暂无数据

当前栏目暂无内容,您可以浏览其他页面或者返回首页

'); }) }) $(()=>{ var mo = $(".saf-mo").attr("saf-mo"); if(mo == "true"){ $("body").addClass("cn-shield-mo").append(`

请先确认电脑端框架

手机端适配在电脑端框架确定后2-3个工作日完成

`); } });