Authored by 梁志锋

购物车功能开发

@@ -29,6 +29,20 @@ if ($names.length > 0) { @@ -29,6 +29,20 @@ if ($names.length > 0) {
29 $names[0].mlellipsis(2); 29 $names[0].mlellipsis(2);
30 } 30 }
31 31
  32 +//获取当前购物车类型
  33 +function getCartType() {
  34 + var $navItem = $('.cart-nav ').find('li'),
  35 + type = 'ordinary';
  36 +
  37 + if ($navItem.eq(0).hasClass('active')) {
  38 + type = 'ordinary';
  39 + } else {
  40 + type = 'advance';
  41 + }
  42 +
  43 + return type;
  44 +}
  45 +
32 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods 46 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
33 $('.cart-goods').on('touchstart', '.checkbox', function() { 47 $('.cart-goods').on('touchstart', '.checkbox', function() {
34 var $this = $(this), 48 var $this = $(this),
@@ -235,19 +249,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { @@ -235,19 +249,7 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
235 requestUpdateAllGoodsCheckStatus(goodsList, handlerAfterTouch); 249 requestUpdateAllGoodsCheckStatus(goodsList, handlerAfterTouch);
236 } 250 }
237 251
238 -//获取当前购物车类型  
239 -function getCartType() {  
240 - var $navItem = $('.cart-nav ').find('li'),  
241 - type = 'ordinary';  
242 252
243 - if ($navItem.eq(0).hasClass('active')) {  
244 - type = 'ordinary';  
245 - } else {  
246 - type = 'advance';  
247 - }  
248 -  
249 - return type;  
250 -}  
251 253
252 //是否要全选 254 //是否要全选
253 function willBeSelected() { 255 function willBeSelected() {