Authored by 梁志锋

购物车修改

@@ -26,6 +26,8 @@ lazyLoad($('img.lazy')); @@ -26,6 +26,8 @@ lazyLoad($('img.lazy'));
26 26
27 if ('advance' === cartType) { 27 if ('advance' === cartType) {
28 $cartContent.toggleClass('hide'); 28 $cartContent.toggleClass('hide');
  29 + $('presell-cart-nav').addClass('active');
  30 + $('common-cart-nav').removeClass('active');
29 } 31 }
30 32
31 if ($('.cart-nav').length > 0) { 33 if ($('.cart-nav').length > 0) {
@@ -39,8 +41,10 @@ if ($('.cart-nav').length > 0) { @@ -39,8 +41,10 @@ if ($('.cart-nav').length > 0) {
39 41
40 if (cartType === 'ordinary') { 42 if (cartType === 'ordinary') {
41 cartType = 'advance'; 43 cartType = 'advance';
  44 + $('#cartType').val('advance');
42 } else { 45 } else {
43 cartType = 'ordinary'; 46 cartType = 'ordinary';
  47 + $('#cartType').val('ordinary');
44 } 48 }
45 49
46 $this.siblings('.active').removeClass('active'); 50 $this.siblings('.active').removeClass('active');
@@ -14,7 +14,6 @@ var dialog = require('../me/dialog'), @@ -14,7 +14,6 @@ var dialog = require('../me/dialog'),
14 orderInfo = require('./order-info').orderInfo; 14 orderInfo = require('./order-info').orderInfo;
15 15
16 var $selectAllBtn = $('.balance .checkbox'), 16 var $selectAllBtn = $('.balance .checkbox'),
17 - cartType = $('#cartType').val(),  
18 requesting = false; 17 requesting = false;
19 18
20 ellipsis.init(); 19 ellipsis.init();
@@ -43,7 +42,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -43,7 +42,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
43 var goodsList = [], 42 var goodsList = [],
44 goodInfo = {}; 43 goodInfo = {};
45 44
46 - goodInfo.goods_type = cartType; 45 + goodInfo.goods_type = $('#cartType').val();
47 goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y'; 46 goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
48 goodInfo.product_sku = id; 47 goodInfo.product_sku = id;
49 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', ''); 48 goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
@@ -62,7 +61,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -62,7 +61,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
62 } else { 61 } else {
63 $this.removeClass('icon-checkbox').addClass('icon-cb-checked'); 62 $this.removeClass('icon-checkbox').addClass('icon-cb-checked');
64 } 63 }
65 - window.history.go(0); 64 + window.location.href = '/cart/index/index?cartType=' + $('#cartType').val();
66 } else if (data.code === 400) { 65 } else if (data.code === 400) {
67 tip.show('网络异常'); 66 tip.show('网络异常');
68 } 67 }
@@ -186,7 +185,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { @@ -186,7 +185,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
186 185
187 //全选按钮点击事件 186 //全选按钮点击事件
188 $selectAllBtn.on('touchend', function() { 187 $selectAllBtn.on('touchend', function() {
189 - bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), cartType, didUpdateAllGoodsCheckStatus); 188 + bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), $('#cartType').val(), didUpdateAllGoodsCheckStatus);
190 }); 189 });
191 190
192 $('.down').on('touchend', function() { 191 $('.down').on('touchend', function() {