function WD() {} ;WD.prototype.init = function() { this.body = $("body"); if (isFrontEnv()) { if(document.title.indexOf("/") != -1 || !document.title) { document.title = "闈掓睙鏈哄櫒"; } this.common(); this.body.addClass("wd"); this.index(); } else { this.body.addClass("make"); } }; WD.prototype.d = function() { var a = arguments; var dom_class = [].shift.call(a); var $dom = $("
").addClass(dom_class); return $dom; }; WD.prototype.min = function(callback) { if($(window).width() > 769) { callback(); } }; WD.prototype.mo = function(callback) { if($(window).width() < 768) { callback(); } }; WD.prototype.index = function() { var _this = this; if (!$("#c_portalResEbizads_banner-15890792765398198").length) { _this.sub(); return; } $("#wd-w_grid-1589086884590").addClass("wd-column-2"); $("#w_common_text-1589086941483, #w_common_text-1589086944886").wrapAll(_this.d("wd-center")); $("#w_common_text-1589086943349, #w_common_text-1589086946233").wrapAll(_this.d("wd-center")); $("#c_portalResProduct_list-15890870967512112, #wd-content_box-1589087133183-0").appendTo($("#wd-content_box-1589087073832-0")); $("#wd-w_grid-1589087097228").remove(); $("#wd-content_box-1589087073832-0").addClass("wd-align-center wd-justify-center"); $(".wd-videos").each(function() { var a = $(this); var b = a.find(".wd-item"); var c = b.find(".wd-word"); var d = _this.d("wd-left"); var e = _this.d("wd-right"); d.append(c); e.append(b); a.find(".wd-container").append(d).append(e); c.addClass("swiper-slide").wrapAll("
"); b.addClass("swiper-slide").wrapAll("
"); $.getScript("/upload/js/swiper.min.js", function() { var swiper_left = new Swiper(a.find('.wd-left .swiper-container'),{ loop: true }); var swiper_right = new Swiper(a.find('.wd-right .swiper-container'),{ slidesPerView: "auto", spaceBetween: 30, loop: true, navigation: { nextEl: a.find('.wd-right .swiper-button-next'), prevEl: a.find('.wd-right .swiper-button-prev') } }); }); }); // news $("#wd-w_grid-1589087067529").addClass("wd-column-2"); }; WD.prototype.sub = function() { var _this = this; this.body.addClass("sub"); $(window).load(function() { $(".svg-login").append(WDSVG.LOGIN); $(".svg-register").append(WDSVG.REGISTER); $(".svg-cart").append(WDSVG.CART); $(".svg-order").append(WDSVG.ORDER); }); // 鑽h獕璇佷功 $(".wd-20200701215748").each(function() { var a = $(this); a.addClass("wd-pc"); var b = a.find("tr:even"); var c = $("
").addClass("w20200818004815").addClass("wd-mo"); b.each(function() { var title = $(this).next().find("td"); if(!title.length) { return; } $(this).find("td").each(function(i) { var item = $("
").addClass("wd-item"); item.append($(this).find("img").clone()); item.append("

" + title.eq(i).text() + "

"); c.append(item); }); }); c.insertAfter(a); }); // 鍏徃鐩稿唽 $(".wd-20200702004252").each(function() { var a = $(this); a.addClass("wd-pc"); var b = a.find("tr:even"); var c = $("
").addClass("w20200818004815").addClass("wd-mo"); b.each(function() { var title = $(this).next().find("td"); if(!title.length) { return; } $(this).find("td").each(function(i) { var item = $("
").addClass("wd-item"); item.append($(this).find("img").clone()); item.append("

" + title.eq(i).text() + "

"); c.append(item); }); }); c.insertAfter(a); }); // sub banner image $("#w_fimg-1589158474619,#w_fimg-1591197332375, #w_fimg-1589768423286,#w_fimg-1590665401804,#w_fimg-1595864821080,#w_fimg-1590682259981,#w_fimg-1589769497253,#w_fimg-1589769657679,#w_fimg-1589769860272,#w_fimg-1589772097415,#w_fimg-1591491384545,#w_fimg-1594174184928,#w_fimg-1589770096223,#w_fimg-1589770142124,#w_fimg-1589770231054,#w_fimg-1591200055671,#w_fimg-1591202454800,#w_fimg-1591204392857,#w_fimg-1594914791227,#w_fimg-1594914849856,#w_fimg-1594914802316,#w_fimg-1594863124784,#w_fimg-1594914756996,#w_fimg-1594914939545,#w_fimg-1594914913356").addClass("w-sub-banner"); $(".c_portalResProduct_detail-03001 .d_TextBox, .c_portalResProduct_detail-03001 .d_description table").each(function() { $(this).wrap("
"); }); this.sub_cate(); $("#w_grid-1591191870606").addClass("wd-footer"); $("#w_grid-1591488653342").addClass("wd-footer"); // products detail $(".c_portalResProduct_detail-03001 .p_interaction button:contains('鎵爜鍜ㄨ')").each(function() { $(this).parent().attr("href", "javascript:;").addClass("wd-products-detail-button-erweima").append(''); }); }; WD.prototype.sub_cate = function() { var _this = this; $(".c_portalResNews_category-01001, .c_portalResIntro_category-01001").each(function() { var a = $(this); a.addClass("wsub-cate-component"); var b = $("
"); b.addClass("wsub-pc-cate"); b.appendTo(a); b.append(a.find("a").clone().removeClass()); b.children().wrap("
"); }); $(".c_portalResProduct_category-01001").each(function() { return; var a = $(this); a.addClass("wsub-cate-component wsub-cate-products"); var b = $("
"); b.addClass("wsub-pc-cate"); b.appendTo(a); a.find(".content > li").each(function(i) { var a1 = $(this).find(".yjTitle a"); var item = $("
").addClass("witem"); item.append(a1.clone().removeClass()); b.append(item); if ($(this).find(".ejBox").length) { var sub = $("
").addClass("wsub-item wsub-item-" + i); sub.append($(this).find(".ejBox").find("a").clone().removeClass().wrap("
").parent().appendTo(item)); item.append(sub); item.find(".wli").wrapAll("
"); } }); b.find(".witem").hover(function() { var sub = $(this).find(".wsub-item"); if (sub.length) { sub.stop(true, false).slideDown(); } }, function() { var sub = $(this).find(".wsub-item"); if (sub.length) { sub.stop(true, false).slideUp(); } }); }); $(".c_portalResIntro_category-0100111").each(function() { var a = $(this); a.addClass("wsub-cate-component"); var b = $("
"); b.addClass("wsub-pc-cate"); b.appendTo(a); var timer = setInterval(function() { var links = a.find("a"); if (links.length) { clearInterval(timer); b.append(a.find("a").removeClass()); b.children().wrap("
"); } }, 500); }); // 浜岀骇鍒嗙被楂樹寒 $(".sub .wsub-cate-component > div.wsub-pc-cate .witem a").each(function() { if (location.href.indexOf($(this).attr("href")) != -1) { $(this).addClass("wcurrent"); if ($(this).parent().hasClass("wli")) { $(this).closest(".witem").children().first().addClass("wcurrent"); } localStorage.setItem("current-cate-url", $(this).attr("href")); return false; } // 璇︽儏椤甸潰鍒嗙被楂樹寒 var cate = localStorage.getItem("current-cate-url"); if (cate && cate == $(this).attr("href") && $(".c_portalResProduct_detail-01001, .c_portalResNews_detail-01001001").length) { $(this).addClass("wcurrent"); if ($(this).parent().hasClass("wli")) { $(this).closest(".witem").children().first().addClass("wcurrent"); } return false; } }); $(".wsub-pc-cate").prepend('
浜嗚В鏇村
').each(function() { var items = $(this).find(".witem"); var down = true; var max = items.length; $(this).find(".trigger").click(function() { if (!down) { return; } down = false; $(this).toggleClass("ws"); if (items.first().is(":hidden")) { new Promise(function(resolve, reject) { var index = 0; items.each(function(i) { setTimeout(function() { $(this).slideDown(); index++; if (index == max) { resolve(); } } .bind(this), i * 100); }); } ).then(function() { down = true; }); } else { new Promise(function(resolve, reject) { var index = 0; items.each(function(i) { setTimeout(function() { $(this).slideUp(); index++; if (index == max) { resolve(); } } .bind(this), max * 100 - i * 100); }); } ).then(function() { down = true; }); } }); }); $(".wsub-pc-cate").children().wrapAll('
'); }; WD.prototype.common = function() { var _this = this; $("img,a").removeAttr("title alt"); $(window).load(function() { $("div[id^='c_']").attr("loaded", "true"); _this.body.addClass("loaded"); }); $(".w_grid-000, .w_grid-001").each(function() { return; $(this).attr("id", "wd-" + $(this).attr("id")); $(this).attr("class", $(this).attr("class").replace("w_grid-000", "wd-w_grid-000")); var a = $(this).children().children().children(); $(this).children().remove(); $(this).append(a); a.each(function() { $(this).attr("id", "wd-" + $(this).attr("id")); }); }); this.header(); this.footer(); }; WD.prototype.header = function() { var _this = this; $("#c_portalResnav_main-15890762150416922, #w_fimg-1589076236545, #c_portalResPublic_codeContainer-15890762459558048").appendTo($("#wd-content_box-1589076198404-0")); $("#wd-w_grid-1589076198404").addClass("wd-header"); $("#w_fimg-1589076211090, #w_fimg-1589076236545, #c_portalResPublic_codeContainer-15890762459558048").wrapAll("
"); $("#w_fimg-1589076236545, #c_portalResPublic_codeContainer-15890762459558048").wrapAll("
"); $("#w_grid-1589076216299").remove(); }; WD.prototype.footer = function() { var _this = this; $("#w_common_text-1589076328208:contains('鎴愰兘')").closest(".w_grid-001").addClass("wd-footer-copyright").prev().addClass("wd-footer-contact"); // mobile footer bar //$("body").append(""); $("body").append(""); $(".w20200821140729").click(function() { history.back(-1); }); $(".footer-bar").find("a").each(function(i) { $(this).prepend(['','', '', ''][i]); }); }; (function() { $(function() { new WD().init(); }); })(); var WDSVG = { LOGIN:'', REGISTGER:'', CART:'', ORDER:'' };