...
|
...
|
@@ -12,11 +12,11 @@ function _favBack(data) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
function _favShop(shopId, isAdd) {
|
|
|
$.post('/product/shop/togglecollect', {shopId: shopId, type: isAdd ? '' : 'add'}, function(data) {
|
|
|
_favBack(data);
|
|
|
});
|
|
|
}
|
|
|
// function _favShop(shopId, isAdd) {
|
|
|
// $.post('/product/shop/togglecollect', {shopId: shopId, type: isAdd ? '' : 'add'}, function(data) {
|
|
|
// _favBack(data);
|
|
|
// });
|
|
|
// }
|
|
|
|
|
|
function _favBrand(brandId, isAdd) {
|
|
|
$.post('/product/brand/togglecollect', {brandId: brandId, type: isAdd ? '' : 'add'}, function(data) {
|
...
|
...
|
@@ -26,13 +26,8 @@ function _favBrand(brandId, isAdd) { |
|
|
|
|
|
$('#brand-fav').click(function() {
|
|
|
var $banner = $(this).parents('.brand-banner');
|
|
|
var shopId = $banner.data('shop');
|
|
|
var brandId = $banner.data('brand');
|
|
|
var isAdd = $(this).hasClass('coled');
|
|
|
|
|
|
if (shopId) {
|
|
|
_favShop(shopId, isAdd);
|
|
|
} else if (brandId) {
|
|
|
_favBrand(brandId, isAdd);
|
|
|
}
|
|
|
_favBrand(brandId, isAdd);
|
|
|
}); |
...
|
...
|
|