...
|
...
|
@@ -575,6 +575,40 @@ Cart = { |
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 清除失效商品
|
|
|
*/
|
|
|
removeInvalid: function() {
|
|
|
var invalidEles;
|
|
|
var products = [];
|
|
|
var dialog = new _confirm({
|
|
|
content: '您确定要清除失效商品吗?',
|
|
|
cb: function() {
|
|
|
dialog.close();
|
|
|
|
|
|
invalidEles = $('.invalid-pros ul li.chk');
|
|
|
|
|
|
if (invalidEles.length > 0) {
|
|
|
$(invalidEles).each(function() {
|
|
|
products.push(JSON.parse($(this).attr('data-product_info')));
|
|
|
});
|
|
|
|
|
|
Util.ajax({
|
|
|
url: '/shopping/cart/product/remove',
|
|
|
data: {skuList: JSON.stringify(products)},
|
|
|
type: 'DELETE',
|
|
|
success: function(res) {
|
|
|
Util.refreshCart(res, function() {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
new _alert('购物袋中没有失效商品!').show();
|
|
|
}
|
|
|
}
|
|
|
}).show();
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|