...
|
...
|
@@ -41,25 +41,14 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { |
|
|
id = $good.data('id');
|
|
|
|
|
|
var goodsList = [],
|
|
|
goodInfo = {},
|
|
|
isSelected = true;
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
isSelected = true;
|
|
|
} else {
|
|
|
isSelected = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
goodInfo = {};
|
|
|
|
|
|
goodInfo.goods_type = cartType;
|
|
|
goodInfo.selected = isSelected ? 'N' : 'Y';
|
|
|
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
|
|
|
goodInfo.product_sku = id;
|
|
|
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
|
|
|
|
|
|
goodsList.push(new GoodInfo(goodInfo));
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: 'select',
|
...
|
...
|
@@ -92,8 +81,8 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { |
|
|
rightBtnText: '确定'
|
|
|
}
|
|
|
}, function() {
|
|
|
var id = $this.closest('.shopping-cart-good').data('id');
|
|
|
var count = $this.data('count');
|
|
|
var id = $this.closest('.shopping-cart-good').data('id'),
|
|
|
count = $this.data('count');
|
|
|
|
|
|
$.ajax({
|
|
|
method: 'post',
|
...
|
...
|
@@ -119,7 +108,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { |
|
|
tip.show('网络异常');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
function requestUpdateAllGoodsCheckStatus(theGoods, successHandeler) {
|
...
|
...
|
@@ -140,7 +128,7 @@ function requestUpdateAllGoodsCheckStatus(theGoods, successHandeler) { |
|
|
tip.show(res.message);
|
|
|
}
|
|
|
},
|
|
|
error: function(err) {
|
|
|
error: function() {
|
|
|
tip.show('网络异常');
|
|
|
},
|
|
|
complete: function() {
|
...
|
...
|
@@ -196,26 +184,9 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { |
|
|
requestUpdateAllGoodsCheckStatus(goodsList, handlerAfterTouch);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//是否要全选
|
|
|
function willBeSelected($this) {
|
|
|
var isSelected = true;
|
|
|
|
|
|
if ($this.hasClass('icon-cb-checked')) {
|
|
|
isSelected = true;
|
|
|
} else {
|
|
|
isSelected = false;
|
|
|
}
|
|
|
|
|
|
return isSelected;
|
|
|
}
|
|
|
|
|
|
//全选按钮点击事件
|
|
|
$selectAllBtn.on('touchend', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
bottomCheckBoxHandeler(willBeSelected($this), cartType, didUpdateAllGoodsCheckStatus);
|
|
|
bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), cartType, didUpdateAllGoodsCheckStatus);
|
|
|
});
|
|
|
|
|
|
$('.down').on('touchend', function() {
|
...
|
...
|
|