...
|
...
|
@@ -133,7 +133,7 @@ var Bll = { |
|
|
|
|
|
var d = new common.dialog({
|
|
|
title: title,
|
|
|
width: '60%',
|
|
|
width: '800px',
|
|
|
content: common.util.__template2($("#wqt-template1").html(), item),
|
|
|
button: [{
|
|
|
value: "提交",
|
...
|
...
|
@@ -232,7 +232,7 @@ $(document).on("click", "#dapeiTable .edit", function() { |
|
|
}
|
|
|
}, function(data) {
|
|
|
Bll.toast("添加搭配", data.data, "/netSale/updateCollocation");
|
|
|
});
|
|
|
}, true);
|
|
|
// item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}];
|
|
|
// Bll.toast("添加搭配",item,"/netSale/updateCollocation");
|
|
|
});
|
...
|
...
|
@@ -272,52 +272,67 @@ common.edit.ajaxfileupload(".fenmianfile", { |
|
|
item.push(data);
|
|
|
goodsList[$(this).data("index")].goodsImagesList = item;
|
|
|
$(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data));
|
|
|
$(this).parents(".form-group").next().find('.cover-color').append($($('#colorCoverTemp').html()));
|
|
|
} else {
|
|
|
common.util.__tip(response.message);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$('.cover-color').on("click", ".btn-metro", function() {
|
|
|
var index = $(this).parents(".form-group").prev().find('.cover-image-list').data("index");
|
|
|
var index1 = $(this).parents(".cover-color-box").index();
|
|
|
//颜色封面点击事件
|
|
|
$('.cover-image-list').on("click", ".btn-metro", function() {
|
|
|
var index = $(this).parents(".cover-image-list").data("index");
|
|
|
var index1 = $(this).parents(".cover-image-item").index();
|
|
|
var item = goodsList[index].goodsImagesList[index1];
|
|
|
var $groups = $(this).parents(".cover-color-box");
|
|
|
var colorIndex = $(this).index();
|
|
|
|
|
|
if ($(this).hasClass('info')) {
|
|
|
$(this).removeClass('info');
|
|
|
} else {
|
|
|
$groups.siblings('.cover-color-box').each(function() {
|
|
|
$(this).parents('.cover-image-item').siblings().each(function() {
|
|
|
$(this).find('.btn-metro').eq(colorIndex).removeClass('info');
|
|
|
});
|
|
|
|
|
|
$(this).siblings('.btn-metro').removeClass('info').end().addClass('info');
|
|
|
}
|
|
|
|
|
|
item.isDefault = $groups.find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N';
|
|
|
var isDefault = $(this).parents('.cover-color').find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N';
|
|
|
var genderCover = $(this).parents('.cover-color').find('.info').index() >= 0 ? $(this).parents('.cover-color').find('.info').index() : 0;
|
|
|
|
|
|
if ($groups.find('.btn-metro').eq(1).hasClass('info')) {
|
|
|
item.genderCover = 1;
|
|
|
} else if (item.genderCover = $groups.find('.btn-metro').eq(2).hasClass('info')) {
|
|
|
item.genderCover = 2;
|
|
|
} else {
|
|
|
item.genderCover = 0;
|
|
|
$.each(goodsList[index].goodsImagesList, function(i, value) {
|
|
|
if (value.genderCover == genderCover) {
|
|
|
value.genderCover = 0;
|
|
|
}
|
|
|
if (value.isDefault == isDefault) {
|
|
|
value.isDefault = 'N';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
item.genderCover = genderCover;
|
|
|
item.isDefault = isDefault;
|
|
|
|
|
|
});
|
|
|
$(document).on("click", ".goods-color a", function() {
|
|
|
//商品封面点击事件
|
|
|
$(document).on("click", ".cover-goods a", function() {
|
|
|
var index = $(this).data("index");
|
|
|
var item = goodsList[index];
|
|
|
if ($(this).hasClass("info")) {
|
|
|
$(this).removeClass("info");
|
|
|
} else {
|
|
|
$('.goods-color a').removeClass("info");
|
|
|
$('.cover-goods a').removeClass("info");
|
|
|
$(this).addClass("info");
|
|
|
}
|
|
|
item.isDefault = $(this).hasClass("info") ? "Y" : "N";
|
|
|
});
|
|
|
|
|
|
//封面图删除
|
|
|
$(document).on('click', '.remove-item-btn', function() {
|
|
|
var index = $(this).parents(".cover-image-list").data("index");
|
|
|
var index1 = $(this).parents(".cover-image-item").index();
|
|
|
$(this).parents('.cover-image-item').remove();
|
|
|
goodsList[index].goodsImagesList.splice(index1, 1);
|
|
|
console.log(goodsList[index].goodsImagesList);
|
|
|
});
|
|
|
|
|
|
//单独保存封面
|
|
|
$(document).on("click", "#fenMainSave", function() {
|
|
|
|
|
|
var data = GOLABDATA.fire("fenmian");
|
...
|
...
|
@@ -333,8 +348,6 @@ GOLABDATA.on("fenmian", function() { |
|
|
goodsImagesBoList: []
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$.each(goodsList, function(index, item) {
|
|
|
if (item.isDefault == "Y") {
|
|
|
map.productSkc = item.productSkc;
|
...
|
...
|
|