window.wd = {}; wd.body = $("body"); wd.body.addClass("w"); if(window?.pageObj?.isHomePage) { wd.body.addClass("wd-index"); } else { wd.body.addClass("wd-sub"); } wd.log = function (...msg) { if (localStorage.getItem("wd")) { console.log.apply(null, msg); } }; wd.error = function (...msg) { if (localStorage.getItem("wd")) { console.error.apply(null, msg); } }; if (window.gsap) { wd.ani = gsap; } else { wd.log("娌℃湁寮曞叆gsap"); } $.fn.a = $.fn.addClass; $.fn.c = $.fn.css; $.fn.e = $.fn.each; $.fn.f = $.fn.find; $.fn.r = $.fn.removeClass; $.fn.eachh = function (fn) { this.each(function(a, b) { fn.call(this, $(b), a) }); return this; }; $.fn.wlog = function (disable) { if (!disable && localStorage.getItem("wd")) { console.log("watch:", this); } return this; }; wd.nav = { init: function () { this.a = $(".wd-nav"); if(!this.a.length) { console.error("娌℃湁鐨勭潃涓诲鑸?"); return; } this.a.addClass("wd-nav"); return this; }, dark: function () { this.sign_dark = true; this.a.addClass("wd-dark"); return this; }, auto: function () { this.sign_auto = true; document.addEventListener("wheel", e => { e.deltaY > 0 ? this.a.addClass("wd-nav-hide") : this.a.removeClass("wd-nav-hide"); }); return this; }, scroll: function () { this.sign_scroll = true; let d = () => { let top = $(window).scrollTop(); if (top > 0) { this.a.addClass("wd-dark"); } else { this.a.removeClass("wd-dark"); } }; if (!this.sign_dark && this.sign_scroll) { $(window).scroll(() => { d(); }); }; d(); return this; } }; wd.auto_reload = { init() { return this; }, start(enable) { if(!enable) { return; } let a = innerWidth; $(window).resize(function () { if (a > 768) { if (!(innerWidth > 768)) { location.reload(); } } else { if (innerWidth > 768) { location.reload(); } } }); } }; wd.auto_p = { init() { return this; }, start() { $("[wa-auto-p]").each(function() { let a = $(this).text(); a = a.trim(); let b = a.split(/\n/g); b = b.reduce((a,b) => a + "

"+b+"

", ""); $(this).html(b); }); } }; wd.auto_sub_detail = { init() { return this }, start() { $(".wd-sub-detail").each(function () { $(this).removeClass([...this.classList].filter(a => a.includes("e_richText-"))); }); } }; wd.page_prev_next = (a = "涓婁竴涓?涓嬩竴涓?) => { $("[wa-page-prev], [wa-page-next]").each(function (i) { $(this).prepend(wd.d("", "", "span").text(a.split(",")[i] + "锛?)); $(this).find("a").each(function () { if ($(this).text().trim()) { return; } $(this).text("鏃?); }); }); }; wd.img_lazy = function (time) { setTimeout(() => { $("img[lazy]").each(function () { $(this).attr("src", $(this).attr("lazy")).removeAttr("lazy"); }); }, 1000 + (time || 0)); }; wd.auto_pcmo = { init() { return this; }, start() { let a = innerWidth; let e = ["s", "a"]; if (a > 768) { wd.body.addClass(e[0]) } else { wd.body.addClass(e[1]) } $(window).resize(() => { let b = innerWidth; if (b == a) { return } if (b > 768) { wd.body.addClass(e[0]); wd.body.removeClass(e[1]) } else { wd.body.removeClass(e[0]); wd.body.addClass(e[1]) } a = b; }); } }; wd.auto_click_scroll = { init() { return this; }, start() { $("[wa-click-scroll]").each(function () { let a = $(this).attr("wa-click-scroll").split(","); let target = $(a[0]); if(!target.length) { wd.error("鐐瑰嚮婊氬姩鐨勭洰鏍囨棤鏁堬紒"); return; } let nav_id = a[1]; let nav = $(nav_id); if(!nav.length) { wd.error("瀵艰埅ID鏃犳晥锛?); return; } $(this).click(function () { $("html").animate({ scrollTop: $(a[0]).offset().top - (a.length == 1 ? 0 : $(a[1]).height()) }); }); }); } }; wd.auto_license = { init() { return this; }, start() { $("[wa-license]").each(function () { let src = $(this).attr("wa-license"); $(this).html($(this).html().replace("钀ヤ笟鎵х収", "钀ヤ笟鎵х収")); if(!$(".wd-20230226140538").length) { $("
").addClass("wd-20230226140538").each(function () { let parent = $(this); $.get("/fwebapi/cms/baseConfig/get", s => { var t; s = s.data.data.businessImgUrl; if(!s) return; (t = new Image).src = "https://omo-oss-image.thefastimg.com/" + s, t.setAttribute("crossOrigin", "Anonymous"), t.onload = function () { !function (s, t) { if (!$(".businessCanvas").length) { $("body").append('