Authored by 梁志锋

购物车修改

... ... @@ -26,6 +26,8 @@ lazyLoad($('img.lazy'));
if ('advance' === cartType) {
$cartContent.toggleClass('hide');
$('presell-cart-nav').addClass('active');
$('common-cart-nav').removeClass('active');
}
if ($('.cart-nav').length > 0) {
... ... @@ -39,8 +41,10 @@ if ($('.cart-nav').length > 0) {
if (cartType === 'ordinary') {
cartType = 'advance';
$('#cartType').val('advance');
} else {
cartType = 'ordinary';
$('#cartType').val('ordinary');
}
$this.siblings('.active').removeClass('active');
... ...
... ... @@ -14,7 +14,6 @@ var dialog = require('../me/dialog'),
orderInfo = require('./order-info').orderInfo;
var $selectAllBtn = $('.balance .checkbox'),
cartType = $('#cartType').val(),
requesting = false;
ellipsis.init();
... ... @@ -43,7 +42,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
var goodsList = [],
goodInfo = {};
goodInfo.goods_type = cartType;
goodInfo.goods_type = $('#cartType').val();
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
goodInfo.product_sku = id;
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
... ... @@ -62,7 +61,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
} else {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
window.history.go(0);
window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
} else if (data.code === 400) {
tip.show('网络异常');
}
... ... @@ -186,7 +185,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
//全选按钮点击事件
$selectAllBtn.on('touchend', function() {
bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), cartType, didUpdateAllGoodsCheckStatus);
bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), $('#cartType').val(), didUpdateAllGoodsCheckStatus);
});
$('.down').on('touchend', function() {
... ...