推荐品牌
";
else if (i == list.length - 1)
html += "";
else
html += "";
}
$("#xnav").html(html);
}
else if (jsonData.Code == 0) {
alert(jsonData.Message);
}
else if (jsonData.Code == -1) {
alert(jsonData.Message);
}
},
});
}
//绑定二级三级分类
function BindClass2(fid) {
$.ajax({
type: "POST",
url: "/product/productclass.aspx/GetProductClass",
contentType: "application/json;charset:UTF-8",
data: "{count:100,cid:" + fid + "}",
dataType: "JSON",
async: false,
success: function (data) {
var jsonData = $.parseJSON(data.d);
if (jsonData.Code == 1) {
var clalist = jsonData.Data;
if (clalist == "") return;
var list = clalist.split(';');
if (list.length == 0) return;
var html = "";
for (var i = 0; i < list.length; i++) {
//二级
var iddt = "";
var iddd = "";
if (list[i].split('|')[0] == 617 || list[i].split('|')[0] == 618 || list[i].split('|')[0] == 693 || list[i].split('|')[0] == 922 || list[i].split('|')[0] == 1453) {
iddt = " id=\"yongpindt\" ";
iddd = " id=\"yongpin\" ";
}
html += "- " + list[i].split('|')[1] + "
";
//三级
$.ajax({
type: "POST",
url: "/product/productclass.aspx/GetProductClass",
contentType: "application/json;charset:UTF-8",
data: "{count:100,cid:" + list[i].split('|')[0] + "}",
dataType: "JSON",
async: false,
success: function (data) {
var jsonData = $.parseJSON(data.d);
if (jsonData.Code == 1) {
var class3 = jsonData.Data;
if (class3 != "") {
var listC3 = class3.split(';');
if (listC3.length > 0) {
html += "- ";
for (var j = 0; j < listC3.length; j++) {
html += "" + listC3[j].split('|')[1] + "";
}
html += "
";
}
}
}
}
})
html += "
";
}
$(".pro_mc").html(html);
}
else if (jsonData.Code == 0) {
alert(jsonData.Message);
}
else if (jsonData.Code == -1) {
alert(jsonData.Message);
}
},
});
}
//点击一级分类
function Class1Click(z, cid) {
var nav = document.getElementById("xnav");
var navlist = nav.children;
for (var i = 0; i < navlist.length; i++) {
navlist[i].className = "";
}
navlist[z].className = "active";
if (z != 0 && z != navlist.length - 1)
$(navlist[z]).css("border-radius", "0px");
BindClass2(cid);
}
//绑定一级分类
BindClass1(0);
//绑定二级三级分类
BindClass2(5);