Authored by 梁志锋

购物车商品数量取返回值

... ... @@ -364,7 +364,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
loading.hideLoadingMask();
if (res.code === 200) {
cartNum = numInCart + buyNumber;
cartNum = res.data.goods_count;
if (cartNum > 99) {
cartNum = '99+';
}
... ...
... ... @@ -27,6 +27,13 @@ $('.shopping-cart-good .name').each(function() {
this.mlellipsis(2);
});
function GoodInfo(properties) {
this.goods_type = properties.goods_type;
this.buy_number = properties.buy_number;
this.product_sku = properties.product_sku;
this.selected = properties.selected;
}
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').on('touchstart', '.checkbox', function() {
var $this = $(this),
... ... @@ -43,12 +50,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
isSelected = false;
}
function GoodInfo(properties) {
this.goods_type = properties.goods_type;
this.buy_number = properties.buy_number;
this.product_sku = properties.product_sku;
this.selected = properties.selected;
}
goodInfo.goods_type = cartType;
goodInfo.selected = isSelected ? 'N' : 'Y';
... ... @@ -174,17 +176,10 @@ function didUpdateAllGoodsCheckStatus() {
}
function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
var goodInfo = {};
var $goods = $('.cart-content:not(.hide) .shopping-cart-good');
var $good = null;
var goodsList = [];
function GoodInfo(properties) {
this.goods_type = properties.goods_type;
this.buy_number = properties.buy_number;
this.product_sku = properties.product_sku;
this.selected = properties.selected;
}
var goodInfo = {},
$goods = $('.cart-content:not(.hide) .shopping-cart-good'),
$good = null,
goodsList = [];
goodInfo.goods_type = type;
goodInfo.selected = isSelected ? 'N' : 'Y';
... ...