");
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 = $("
");
});
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:''
};