window.wd = {}; wd.body = $("body"); wd.width = $(window).width(); wd.height = $(window).height(); wd.log = function(...msg) { if(localstorage.getitem("wd")) { console.log.apply(null, msg); } }; $.fn.wlog = function(disable) { if(!disable && localstorage.getitem("wd")) { console.log("watch:", this); } return this; }; wd.bread = () => { $(".p_breadcrumb").parent().addclass("wd-bread"); }; $.fn.weach = function(disable) { if(!disable) { wd.log("watch: length - ", this.length); this.each(function() { wd.log("watch:", this); }); } return this; }; wd.grid = () => { let ding_pc_mo = (dom, config) => { config = config.split(";"); let pc_config = config[0].split(","); let mo_config = config[1]?config[1].split(","):"1,15".split(","); let abbr = (config) => { if(config.length == 1) config[1] = "15"; config = config.map((a,b) => { if(!(a.match(/[a-za-z\%]*/g).filter(a => a.trim()) || []).length) { return (["repeat(#, 1fr)", "#px"][b]).replace("#", a); } return a; }); return config; }; pc_config = abbr(pc_config); mo_config = abbr(mo_config); let current_mode = innerwidth; let s = () => { let config = innerwidth > 768?pc_config:mo_config; dom.css({ display:"grid", "grid-template-columns": config[0], "grid-gap":config[1] }); }; s(); let change = () => { if(innerwidth > 768) { if(!(current_mode > 768)) { current_mode = innerwidth; s(); } } else { if(current_mode > 768) { current_mode = innerwidth; s(); } } } window.addeventlistener('resize', change); window.addeventlistener('pageshow', change); window.addeventlistener('domcontentloaded', change); }; let wa_dg = () => { $("[wa-dg]").each(function() { const a = $(this).attr("wa-dg"); $(this).removeattr("wa-dg"); let t = $(this); if($(this).hasclass("s_list")) { t = $(this).find("> div > .p_list"); } ding_pc_mo(t, a); }); }; wa_dg(); setinterval(function() { wa_dg(); }, 100); }; wd.auto_css =() => { if(localstorage.getitem("wd")) { let style = ``; $("[class*=e_richtext]").filter(function() { let loop_item = $(this).closest(".p_loopitem"); if(!loop_item.length) { return 1; } if(loop_item.length && loop_item.index() == 0) { return 1; } }).each(function() { let id = $(this).closest("[id*='c_static_']").attr("id"); let class_name = $(this).attr("class").split(" ").filter(a => { if(a.includes("e_richtext")) return a; }).join(""); style += "#" + id + " ." + class_name + "{}"; }); $("[class*='e_container-'] > .p_item").each(function() { let id = $(this).closest("[id]").attr("id"); let container = $(this).closest("[class*='e_container-']").attr("class").split(" ")[0]; style += "#" + id + " ." + container + " > " + ".p_item:nth-child(" + ($(this).index() + 1) + ") {}"; }); $(".p_loopitem").each(function() { let id = $(this).closest("[id]").attr("id"); let loop = $(this).closest(".s_list").attr("class").split(" ")[0]; style += "#" + id + " ." + loop + " .p_loopitem:nth-child(" + ($(this).index() + 1) + ") {}"; }); $("head").append(""); } }; 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('