");
skype.insertAfter(phone);
}
return {
skype
};
};
wd.auto_break_line = {
init() {
return this;
},
start() {
$("[wa-break-line]").each(function () {
$(this).html("
");
});
}
};
wd.auto_swiper = {
init: function () {
return this;
},
start: function (id) {
$(id??"[wa-swiper]").each(function () {
let _this = $(this);
let a = $(this).attr("wa-swiper");
let aa = wd.string_to_object(a);
let config = {
slidesPerView: 3,
spaceBetween: 30,
centeredSlides: false,
loop: false
};
aa.view && (config.slidesPerView = aa.view);
aa.center && (config.centeredSlides = true);
aa.loop && (config.loop = true);
aa.between && (config.spaceBetween = aa.between);
aa.grid && (config.grid = {
rows: aa.grid
})
aa.autoplay && (config.autoplay = {
delay: aa.autoplay,
disableOnInteraction: false,
pauseOnMouseEnter: false
});
aa.mobile && (config.breakpoints = {
240: {
slidesPerView: aa.mobile,
spaceBetween: 0,
},
768: {
slidesPerView: config.slidesPerView,
spaceBetween: config.spaceBetween
}
});
let handle = () => {
$(this).css("display", "block").css("overflow", "hidden");
$(this).find(aa.s??".p_loopitem").wrap("
").parent().parent().css("display", "block").end().wrapAll('
');
if (aa.pagination) {
$(this).find(".swiper").append('');
config.pagination = {
el: _this.find(".swiper-pagination").get(0),
clickable: true
};
}
if (aa.navigation) {
$(this).find(".swiper").append('
');
config.navigation = {
nextEl: _this.find('.swiper-button-next').get(0),
prevEl: _this.find('.swiper-button-prev').get(0)
};
}
new Swiper(_this.find(".swiper").get(0), config);
}
if(aa.mo) {
if(innerWidth > 768) return;
handle();
} else if (aa.pc) {
if(innerWidth > 768) {
handle();
}
} else {
handle();
}
});
}
};
wd.auto_no_data = {
init: function () {
return this;
},
start: function () {
$("[wa-no-data").each(function () {
$(this).find(".p_nodata").each(function () {
$(this).addClass("wd-20230603155427");
$(this).attr("wa-svg", "no-data#");
$(this).html(`
鏆傛棤鏁版嵁锛?/p>`);
});
});
}
};
wd.auto_highlight = {
init: function () {
return this;
},
start: function () {
$("[wa-highlight]").each(function () {
let s = $(this).attr("wa-highlight") || "a";
let class_name = "wd-current";
if (s.includes(",")) {
s = s.split(",");
class_name = s[1];
s = s[0];
}
$(this).find("a").each(function () {
if (location.href.includes(this.href)) {
let _this = this;
if (s == "a") {
$(this).addClass(class_name);
} else {
$(s).each(function () {
if (this.contains(_this)) {
$(this).addClass(class_name);
}
});
}
}
});
});
return;
}
};
wd.zj = (a) => {
if(typeof a == "number") {
if(a) {
wd.body.a("zj");
let w = function(type) {
let config = $(this).attr("wa-zj-" + type).split(",");
let number;
let info = "";
if(config.length == 1) {
number = 0;
info = config[0].trim();
} else {
number = parseInt(config[0]);
info = config[1].trim();
}
if(config.filter(c => c.trim() == "all").length) {
info = config.slice(-2)[0];
$(this)[type](window[info]);
return;
}
if($(this).text().replace(/\s*/g, "").length > number) {
return;
}
$(this)[type](window[info]);
};
$("[wa-zj-text]").each(function() {
w.call(this, "text");
});
$("[wa-zj-html]").each(function() {
w.call(this, "html");
});
$("[wa-zj-append]").each(function() {
w.call(this, "append");
});
}
}
if(typeof a == "function") {
setTimeout(() => {
if(wd.body.hasClass("zj")) {
a && a();
}
}, 10);
}
};
wd.auto_detail_next_prev_none = {
init: function () {
return this;
},
start: function (text) {
requestAnimationFrame(function a() {
$(".s_title:contains(鏃?", "[wa-prev-next]").not(".wd").each((a, b) => $(b).addClass("wd").each((c, d) => $(d).text().includes("鏃?) ? $(d).html($(d).html().replace("鏃?, text ? text : "None")) : ""));
requestAnimationFrame(a);
});
return this;
}
};
wd.empty_info = (list, method, content, direct) => {
$(list).each(function () {
if (!direct && $(this).text().trim()) {
return;
}
$(this)[b](c);
});
};
wd.hash = {
init: function (nav) {
let _this = this;
if(nav) {
this.nav = $(nav);
} else {
this.nav = $(".wd-nav");
if(localStorage.wd && !$(_this.nav).length) {
console.error("hash nav error!");
return;
}
}
this.hash_info = {};
this.prev_hash = "";
$("body").click(e => {
let href = $(e.target).attr("href") || $(e.target).closest("a").attr("href");
if (href && href.includes("#") && location.href.includes(href)) {
let dom = href.split("#")[1];
if (dom && _this.hash_info[dom]) {
e.preventDefault();
$("html,body").animate({
scrollTop: $(_this.hash_info[dom])?.offset()?.top - (_this.nav ? $(_this.nav).height() : 0)
});
}
}
});
$(window).on("load", function () {
let hash = location.hash;
if (hash) {
let dom = hash.split("#")[1];
if (dom && _this.hash_info[dom]) {
$("html").animate({
scrollTop: $(_this.hash_info[dom])?.offset()?.top - (_this.nav_id ? $(_this.nav_id).height() : 0)
});
}
}
});
return this;
},
core: function () {
let _this = this;
let a = location.hash;
if (a && a != _this.prev_hash) {
_this.prev_hash = a;
let b = _this.hash_info[a.slice(1)];
if (b) {
$("html,body").animate({
scrollTop: $(b)?.offset()?.top - (_this.nav ? $(_this.nav).height() : 0)
});
}
}
return _this;
},
start: function () {
let _this = this;
requestAnimationFrame(function z() {
_this.core();
requestAnimationFrame(z);
});
return this;
},
add: function (info) {
this.hash_info = Object.assign(this.hash_info, info);
this.core();
return this;
}
};
wd.scroll_animation = {
init: function () {
this.started = 1;
wd.body.addClass("wd-start-animation");
$("[wa--sa]").each(function () {
let a = $(this).attr("wa--sa");
if (a) {
$(a).each(function () {
$(this).attr("wa-sa", "");
});
} else {
$(".p_loopitem", this).each(function () {
$(this).attr("wa-sa", "");
});
}
});
$(".s_title, s_subtitle, .s_summary, .s_img, .s_line, .s_link, .s_body, .s_button1, .btn-primary, [class*='e_credible'], [class*='e_richText'], [class*='e_provider'], [class*='e_text-'],.p_page ").attr("wa-sa", "");
return this;
},
start:function() {
let timer;
$(window).scroll(() => {
clearTimeout(timer);
timer = setTimeout(() => {
this.ani();
}, 20);
});
this.ani();
return this;
},
ani: function () {
let index = 0;
$("[wa-sa]:not('[wa-no-sa]'):not('[wa-sa-ani]')").each(function () {
let top = this.getBoundingClientRect().top;
if (top < innerHeight) {
index++;
$(this).attr("wa-sad", index);
}
});
$("[wa-sad]").eachh((a) => {
wd.st(() => {
a.removeAttr("wa-sad");
a.removeAttr("wa-sa");
a.attr("wa-sa-ani", "");
}, a.attr("wa-sad") * 50);
});
},
add: function (a) {
if(!this.started) return;
$(a).attr("wa-sa", "");
this.ani();
}
};
wd.forbidden_words = {
init: function () {
this.money_words = [];
this.money_words.push(["鍥藉"]);
this.money_words.push(["瀹岀編"]);
this.money_words.push(["绗竴"]);
this.money_words.push(["寮曢"]);
this.money_words.push(["棰嗗厛"]);
this.money_words.push(["浼樼"]);
this.money_words.push(["鏈€"]);
return this;
},
start: function () {
let _this = this;
let children = (a) => {
a.contents().each(function () {
if (this.nodeType == 3) {
let text = $(this).text().trim();
if (text) {
_this.money_words.forEach(c => {
if (text.includes(c)) {
this.textContent = this.textContent.replace(new RegExp(c[0], "g"), c.length > 1 ? c[1] : "");
}
});
}
} else {
children($(this));
}
});
};
$(".s_title, .s_summary, .s_link").eachh(a => {
children(a);
});
return _this;
},
add: function (...a) {
let _this = this;
if (a) {
_this.money_words.push([a]);
_this.start();
}
return _this;
}
};
wd.wd = (...z) => {
if (isFrontEnv()) {
$(() => {
if (z.length == 1) {
z[0]();
return;
}
if (z.length == 2) {
$(z[0]).each(function () {
z[1]($(this));
});
return;
}
if (z.length == 3) {
z[2]($(z[0]));
}
});
}
};
wd.pc = () =>{
return function(a) {
if(innerWidth > 768) {
a();
}
}.bind(window);
};
wd.mo = () =>{
return function(a) {
if(innerWidth > 768) {
return;
}
a();
}.bind(window);
};
wd.cursor = {
init: function () {
this.cursor = wd.d("wd-cursor").get(0);
this.x = 0;
this.y = 0;
wd.body.appendTo("body");
},
start: function () {
let _this = this;
document.addEventListener("mousemove", e => {
_this.x = e.clientX;
_this.y = e.clientY;
wd.ani.to(_this.cursor, _this.x);
wd.ani.to(_this.cursor, _this.y);
});
}
};
wd.mouse_img = (a, children) => {
a.addClass("wd-mouse-img-effect");
if (children) {
a.find("img").wrap("
");
} else {
a.children().wrapAll("
");
}
let wc = a.find(".wc");
let b = a.offset().left;
let c = a.width();
let ratio, in_timer;
a.hover(function () {
c = a.width();
in_timer = setTimeout(() => {
a.attr("in", "in");
}, 500);
a.mousemove(function (e) {
if (!a.attr("in")) {
return;
}
ratio = ((e.screenX - b) - c / 2) / c;
requestAnimationFrame(() => {
wc.css("transform", "translateX(" + ratio * 10 + "px) skew(" + ratio * 0.1 + "deg, " + ratio * 0.1 + "deg)");
});
});
}, function () {
clearTimeout(in_timer);
requestAnimationFrame(() => {
wc.css("transform", "none").removeAttr("in");
});
});
};
wd.auto_append = {
init:function() {
return this;
},
start:function() {
$("[wa-append]").each(function() {
let a = $(this).attr("wa-append");
let b = a.slice(-1) == "#";
let c = a;
if(b) {
c = c.slice(0,-1)
}
c = c.split(",")
$(this).find(c[0]).each(function(i) {
$(this)[b?"prepend":"append"]($(c[1]).eq(i).clone());
});
});
}
};
wd.auto_sub_banner = {
init: function () {
let container = $("[wa-sub-img-banner]").parent().addClass("wsb-container").each(function () {
$(this).find(".s_title").removeAttr("class").wrapAll("
").each(function (i) {
if($(this).find("p").length) {
$(this).addClass("w" + (i + 1));
$(this).find("p").each(function() {
if($(this).text().match(/[a-zA-Z]+/g)) {
$(this).addClass("wd-words-en");
}
$(this).html($(this).text().trim().split("").reduce((a, b) => a + "
" + b + "", "")).find("span").each(function (ii) {
if (Math.random() > 0.5) {
$(this).css("animation-delay", 0.5 + i * 0.1 + Math.random() * 0.3 + "s");
}
});
});
return;
}
$(this).addClass("w" + (i + 1)).html($(this).text().trim().split("").reduce((a, b) => a + "
" + b + "", "")).find("span").each(function (ii) {
if (Math.random() > 0.5) {
$(this).css("animation-delay", 0.5 + i * 0.1 + Math.random() * 0.3 + "s");
}
});
});
$($(this).find("[wa-sub-img-banner]").attr("wa-sub-img-banner")).each((a, b) => $(this).find(".w").css("margin-top", $(b).height() / 2));
});
container.each(function () {
if ($(this).find(".detail").length) {
$(this).children(".w").addClass("detail");
}
});
this.container = container;
return this;
},
start: function () {
setTimeout(() => {
this.container.addClass("ws");
}, 10 ** 3);
}
};
wd.auto_svg = {
init: function () {
return this;
},
start: function () {
setInterval(() => {
$("[wa-svg]").each(function () {
let svg = $(this).attr("wa-svg") || "";
if (!svg) return;
let wrapper = $(this).attr("wa-svg-wrapper");
$(this).removeAttr("wa-svg wa-svg-wrapper");
let svg_name = svg.replace("#", "");
let svg_wrapper = $(".wd-svgs ." + svg_name);
$(this)[svg.indexOf("#") > -1 ? "append" : "prepend"](svg_wrapper.find("svg").clone().each((b, a) => {
wrapper && $(a).wrap($("
").addClass(wrapper));
})[wrapper ? "parent" : "first"]());
});
}, 60);
if(!this.inited) {
this.inited = 1;
this.start();
}
return this;
},
svg: function (selector, _name, wrapper) {
let _this = this;
$(selector).each((b, a) => {
let name = new RegExp("\\+", "ig").test(_name) ? _name.slice(0, -1) : _name.split(",")[b];
$(a).attr("wa-svg", name);
if (wrapper) {
$(a).attr("wa-svg-wrapper", wrapper);
}
});
}
};
wd.auto_letters = function () {
let effect = function () {
let a = 0;
let self = this;
let target = $(this).attr("wa-letters") ? $($(this).attr("wa-letters")).filter(function () {
return this.contains(self);
}) : $(this);
target.mouseenter(() => {
if (!a) {
a = 1;
let text = $(this).text().trim();
$(this).height($(this).height());
$(this).text("");
let render = (b) => {
let i = 0, m = b.length;
let r = () => {
$(this).text(b[i]);
i++;
if (i > m - 1) {
a = 0;
return;
}
setTimeout(() => {
r();
}, 100 / text.length);
}
r();
};
let w = () => {
let s = [];
let ss = [];
text.split("").forEach((a, b) => {
let substring = text.slice(0, b + 1);
s.push(substring);
});
ss.push("");
ss.push("");
s.forEach((a, b) => {
a.split("").forEach((c, d) => {
Array(s.length).fill("").forEach((e, f) => {
let t = c.split("")[f];
if (!t) return;
ss.push(a.slice(0, -1) + t);
});
});
});
render(ss);
};
w();
}
});
};
setInterval(() => {
$("[wa-letters]").not(".wd-in").addClass("wd-in").each(function () {
effect.call(this);
});
}, 500);
}
wd.auto_footer_nav = function () {
let top = $("[wa-nav-top]");
top.length && top.parent().find(top.attr("wa-nav-top") || ".p_level1Item").each(function () {
$(this).clone().appendTo($("[wa-nav-footer]"));
});
this.scroll_animation.add("[wa-nav-footer] > li");
};
wd.auto_scroll_down = function () {
$("[wa-scroll-down]").each(function () {
$(this).append(`
`);
});
};
wd.auto_update_nav_footer_height = function () {
let top = $("[wa-nav]").closest("[id]");
let footer = $("[wa-footer]").closest("[id]");
let a = function () {
if(top.length) document.documentElement.style.setProperty(`--nav`, top.height() + "px");
if(footer.length) document.documentElement.style.setProperty(`--footer`, footer.height() + "px");
}
a();
$(window).resize(function() {
a();
});
$(window).on("load", function() {
a();
let _top = top.height();
let _footer = footer.height();
let __top,__footer;
setInterval(function() {
__top = top.height();
if(__top != _top) {
_top = __top;
a();
}
__footer = footer.height();
if(__footer != _footer) {
__footer = _footer;
a();
}
}, 100);
});
};
wd.auto_sub_cate = function() {
$("[wa-sub-cate]").each(function() {
$("
").addClass("wd-sub-cate-auto").attr("wmc", "").append($(this).find("a").clone().wrap($("
").addClass("wd-item").attr("wa-sa", "")).parent()).insertAfter(this).find("a").each(function() {
let a = $(this);
let href = this.href;
if(location.href.includes(href)) {
this.classList.add("wd-current");
}
});
});
};
wd.si = (fn, time) => {
return setInterval(() => {
fn();
}, time);
};
wd.st = (fn, time) => {
return setTimeout(() => {
fn();
}, time);
};
wd.auto_cal_height = () => {
$("[wa-cal-height]").each(function() {
let a = $(this).attr("wa-cal-height").split(";");
let target = a[0], $target;
let pcmo = a.length == 4?a[3]:"pcmo";
if(target == "this") {
$target = $(this);
} else {
$target = $(target);
if(!$target.length) {
console.error("wa-cal-height-target: " + target + " --- 涓嶅瓨鍦?);
return;
}
}
let source = a[1];
let $source = $(source);
if(!$source.length) {
console.error("wa-cal-height-source: " + source + " --- 涓嶅瓨鍦?);
return;
}
let current_height = $source.height();
let height = current_height;
let update = () => {
$target.get(0).style.setProperty("--height-" + a[2], current_height + "px");
};
update();
let handle = () => {
height = $source.height();
if(height != current_height) {
current_height = height;
update();
}
};
wd.si(a => {
if(pcmo == "pc") {
wd.pc()(a => {
handle();
});
} else if (pcmo == "mo") {
wd.mo()(a => {
handle();
});
} else {
handle();
}
}, 200);
});
};
wd.auto_100vh = () => {
let _window;
if(window.parent == this.window) {
_window = window;
} else {
_window = window.parent;
}
let handle = () => {
wd.body.get(0).style.setProperty("--100vh", _window.innerHeight + "px");
};
handle();
let current_height = _window.innerHeight;
let height = current_height;
$(window).resize(() => {
height = _window.innerHeight;
if(current_height != height) {
current_height = height;
handle();
}
});
};
wd.auto_trim = () => {
$("[wa-trim]").each(function() {
$(this).text($(this).text().trim());
});
};
wd.auto_seo_page = () => {
$("[wa-seo-page]").each(function() {
$(this).parent().append(`
SEO鏍囩
SEO TAGS
`);
$(".s_title:contains(鏍囩绠$悊)").first().closest("div[id^='c_']").addClass("wd-tag-list");
$("div[class*='e_richText']:contains(鎬庝箞鎵嶈兘閫夋嫨涓€娆鹃€傚悎鎮ㄧ殑锛?").parents("[id^='c_']").filter(function() {
return $(this).parent().hasClass("main");
}).addClass("wd-tag-detail");
});
};
wd.auto = () => {
$(() => {
if(isFrontEnv()) {
wd.auto_trim();
wd.auto_100vh();
wd.auto_cal_height();
wd.auto_sub_cate();
wd.auto_update_nav_footer_height();
wd.auto_scroll_down();
wd.auto_footer_nav();
wd.auto_letters();
wd.auto_svg.init().start();
wd.auto_seo_page();
wd.auto_sub_banner.init().start();
wd.auto_highlight.init().start();
wd.auto_no_data.init().start();
wd.auto_swiper.init().start();
wd.auto_break_line.init().start();
wd.auto_scroll.init().start();
wd.auto_grid.init().start();
wd.auto_tab.init().start();
wd.auto_ce.init().start();
wd.auto_seo.init().start();
wd.auto_license.init().start();
wd.auto_click_scroll.init().start();
wd.auto_sub_detail.init().start();
wd.auto_p.init().start();
wd.auto_reload.init().start(1);
wd.auto_append.init().start();
}
});
}
wd.pop = (h) => {
let pop = $(".wd-pop-info");
if(!pop.length) {
wd.body.append(`
`);
pop = $(".wd-pop-info");
pop.click((e)=> {
if(e.target == pop.get(0)) {
pop.removeClass("wd-show");
}
});
}
let container = pop.find(".wd-container");
let close = pop.find(".wd-close");
close.click(() => {
pop.removeClass("wd-show");
});
container.empty().html(h);
pop.addClass("wd-show");
};
wd.wrap_table = () => {
$("[wa-wrap-table]").find("table").each(function() {
$(this).wrap("
");
});
};
wd.auto_href = (config) => {
$("a").filter((a,b) => Array.from(b.attributes).filter(c => c && c.name.includes("wa-href-")).length).each(function() {
let href = Array.from(this.attributes).filter(c => c.name.includes("wa-href-")).map(a => a.name);
if(href && href[0]) {
$(this).attr("href", config[href[0].split("wa-href-")[1]] || "");
}
});
};
wd.delay = (time) => {
return (fn) => {
return timer = setTimeout(() => {
fn();
}, time);
}
};