...
|
...
|
@@ -3,7 +3,8 @@ |
|
|
* @author: jiangfeng<jeff.jiang@yoho.cn>
|
|
|
* @date: 16/7/20
|
|
|
*/
|
|
|
|
|
|
var dialog = require('../plugins/dialog');
|
|
|
var _confirm = dialog.Confirm;
|
|
|
|
|
|
var FavoriteBrand = {
|
|
|
init: function() {
|
...
|
...
|
@@ -66,6 +67,12 @@ var FavoriteBrand = { |
|
|
FavoriteBrand.doCancelMulti(shopId.join(','), brandId.join(','));
|
|
|
});
|
|
|
},
|
|
|
_showConfirm: function(cb) {
|
|
|
new _confirm({
|
|
|
content: '<h1 class="title">确认删除</h1><p>您确定要删除该收藏么?</p>',
|
|
|
cb: cb
|
|
|
}).show();
|
|
|
},
|
|
|
moveSlide: function(ele) {
|
|
|
var wrap = $(ele).parent().next('.slide-wrap');
|
|
|
var currLi = $('ul li.show', wrap);
|
...
|
...
|
@@ -79,23 +86,27 @@ var FavoriteBrand = { |
|
|
}
|
|
|
},
|
|
|
doCancel: function(ids, type) {
|
|
|
$.post('/me/collection/cancel', {
|
|
|
type: type || 'brand',
|
|
|
ids: ids
|
|
|
}, function(data) {
|
|
|
if (data.code === 200) {
|
|
|
location.href = '/me/collection/brand';
|
|
|
}
|
|
|
this._showConfirm(function() {
|
|
|
$.post('/me/collection/cancel', {
|
|
|
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';
|
|
|
}
|
|
|
this._showConfirm(function() {
|
|
|
$.post('/me/collection/cancel/multi', {
|
|
|
shops: shops,
|
|
|
brands: brands
|
|
|
}, function(data) {
|
|
|
if (data.code === 200) {
|
|
|
location.href = '/me/collection/brand';
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
};
|
...
|
...
|
|