window.wd = {}; wd.body = $("body"); 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((a, b) => fn($(b), a)); return this; }; $.fn.wlog = function (disable) { if (!disable && localstorage.getitem("wd")) { console.log("watch:", this); } return this; }; wd.nav = { init: function (id) { this.a = $(id); if(!this.a.length) { wd.error("导航id错误!"); return; } setinterval(() => { document.documentelement.style.setproperty("--nav", this.a.height() + "px"); }, 300); 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; if (!this.sign_dark && sign) { $(window).scroll(() => { let top = $(window).scrolltop(); if (top > 0) { this.a.addclass("wd-dark"); } else { this.a.removeclass("wd-dark"); } }); } return this; } }; wd.auto_reload = () => { let window_width_1 = $(window).width(); $(window).resize(function () { if (window_width_1 > 768) { if (!($(window).width() > 768)) { location = location; } } else { if ($(window).width() > 768) { location = location; } } }); }; wd.sub_detail = () => { $(".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) { if (time) { settimeout(() => { $("img[lazy]").each(function () { $(this).attr("src", $(this).attr("lazy")).removeattr("lazy"); }); }, time); } }; wd.pcmo = () => { isfrontenv() && $("body").each(function () { let body = $(this); let a = innerwidth; let e = ["s", "a"]; if (a > 768) { $(this).addclass(e[0]) } else { $(this).addclass(e[1]) } requestanimationframe(function c() { let b = $(window).width(); if (b == a) { requestanimationframe(c); return } if (b > 768) { body.addclass(e[0]); body.removeclass(e[1]) } else { body.removeclass(e[0]); body.addclass(e[1]) } a = b; requestanimationframe(c) }) }); }; wd.click_scroll = () => { $("[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.license = () => { $("[wa-license]").each(function () { let src = $(this).attr("wa-license"); $(this).append(''); $(this).html($(this).html().replace("营业执照", "营业执照")); let pop = $("
").addclass("wd-20230226140538").each(function () { let parent = $(this); $.get("/fwebapi/cms/baseconfig/get", s => { var t; s = s.data.data.businessimgurl, (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('