Authored by 王水玲

购物车商品选择bug修改

... ... @@ -36,13 +36,15 @@ function GoodInfo(properties) {
this.buy_number = properties.buy_number;
this.product_sku = properties.product_sku;
this.selected = properties.selected;
this.hasPromotion = properties.hasPromotion;
}
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').on('touchstart', '.checkbox', function() {
var $this = $(this),
$good = $this.closest('.shopping-cart-good'),
id = $good.data('id');
id = $good.data('id'),
promotion = $good.data('promotion');
var goodsList = [],
goodInfo = {};
... ... @@ -55,6 +57,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
goodInfo.goods_type = $('#cartType').val();
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
goodInfo.product_sku = id;
goodInfo.hasPromotion = promotion;
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
goodsList.push(new GoodInfo(goodInfo));
... ...