...
|
...
|
@@ -46,18 +46,24 @@ var FavoriteBrand = { |
|
|
|
|
|
$('.btn.cancel', $root).click(function() {
|
|
|
var id = $(this).parents('.brand-info').data('id');
|
|
|
var type = $(this).parents('.brand-info').data('type');
|
|
|
|
|
|
FavoriteBrand.doCancel(id);
|
|
|
FavoriteBrand.doCancel(id, type);
|
|
|
});
|
|
|
|
|
|
$('.favorite-cancel', $root).click(function() {
|
|
|
var ids = [];
|
|
|
var shopId = [];
|
|
|
var brandId = [];
|
|
|
|
|
|
$('.brand-info.choose', $root).each(function() {
|
|
|
ids.push($(this).data('id'));
|
|
|
if ($(this).data('type') === 'shop') {
|
|
|
shopId.push($(this).data('id'));
|
|
|
} else if ($(this).data('type') === 'brand') {
|
|
|
brandId.push($(this).data('id'));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
FavoriteBrand.doCancel(ids.join(','));
|
|
|
FavoriteBrand.doCancelMulti(shopId.join(','), brandId.join(','));
|
|
|
});
|
|
|
},
|
|
|
moveSlide: function(ele) {
|
...
|
...
|
@@ -72,15 +78,25 @@ var FavoriteBrand = { |
|
|
$(currLi).removeClass('show');
|
|
|
}
|
|
|
},
|
|
|
doCancel: function(ids) {
|
|
|
doCancel: function(ids, type) {
|
|
|
$.post('/me/collection/cancel', {
|
|
|
type: 'brand',
|
|
|
type: type || 'brand',
|
|
|
ids: ids
|
|
|
}, function(data) {
|
|
|
if (data.code === 200) {
|
|
|
location.href = '/me/collection/brand';
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
doCancelMulti: function(shops, brands) {
|
|
|
$.post('/me/collection/cancel/multi', {
|
|
|
shops: shops,
|
|
|
brands: brands
|
|
|
}, function(data) {
|
|
|
if (data.code === 200) {
|
|
|
location.href = '/me/collection/brand';
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|