Authored by lijian

fix 图片排序

... ... @@ -318,6 +318,16 @@ function renderGoodList() {
"男": 1,
"女": 2
};
goodsList.forEach(function (item, index) {
if (item && item.goodsImagesList) {
console.log((item.goodsImagesList));
for (var i = 0; i < item.goodsImagesList.length; i++) {
if (!item.goodsImagesList[i]) {
item.goodsImagesList.splice(i, 1);
}
}
}
});
var gender = map[window.NETSALEDATA.baseProductInfo.baseProduct.gender]||3;
$("#fenmianWrap").html(common.util.__template2($("#fenmianTemp").html(), {
goodsList: goodsList,
... ... @@ -426,20 +436,24 @@ $('#fenmianWrap').on("click", ".btn-metro", function () {
var colorIndex = $(this).data("i");
if (colorIndex == 0) {
list.forEach(function (item, index) {
if (index == index1) {
item.isDefault = "Y";
item.genderCover = 0;
} else {
item.isDefault = "N";
if(item){
if (index == index1) {
item.isDefault = "Y";
item.genderCover = 0;
} else {
item.isDefault = "N";
}
}
});
} else {
list.forEach(function (item, index) {
if (index == index1) {
item.genderCover = colorIndex;
item.isDefault = "N";
} else {
item.genderCover = 0;
if(item){
if (index == index1) {
item.genderCover = colorIndex;
item.isDefault = "N";
} else {
item.genderCover = 0;
}
}
});
// item.genderCover = colorIndex;
... ...