Authored by OF1706

modify num for checked

... ... @@ -287,6 +287,8 @@ Cart = {
modNum: function() {
var $this = $(this);
var $item = $this.closest('li[data-role=pitem]');
var $btn = $item.find('.cart-item-check');
var item;
// var storagenum = $item.data('storagenum') ? $item.data('storagenum') * 1 : 0;
var countJSON = {};
... ... @@ -305,6 +307,28 @@ Cart = {
capi.cartItemNumChg($.extend(countJSON, {
sku: $item.data('id')
}));
if (!$item.hasClass('active')) {
if (!$btn.hasClass('cart-item-checked') && $btn.data('tipnostore')) { // 无库存提示
toastNoStore($item);
$item.find('.cart-item-check').addClass('cart-item-checked');
return;
}
item = {
product_sku: $item.data('id'),
selected: $btn.hasClass('cart-item-checked') ? 'N' : 'Y',
buy_number: $item.data('productnum'),
goods_type: $item.data('goodstype'),
promotion_id: $item.data('promotionid') ? $item.data('promotionid') : 0
};
return capi.choiceOut(item);
} else {
return;
}
},
reAdd2Cart: function() {
... ...