Authored by 梁志锋

购物车没有tab时 不能结算

@@ -19,8 +19,9 @@ require('./good'); @@ -19,8 +19,9 @@ require('./good');
19 19
20 lazyLoad($('img.lazy')); 20 lazyLoad($('img.lazy'));
21 21
22 -navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);  
23 -navHammer.on('tap', function(e) { 22 +if ($('.cart-nav').length > 0) {
  23 + navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);
  24 + navHammer.on('tap', function(e) {
24 var $this = $(e.target).closest('li'); 25 var $this = $(e.target).closest('li');
25 26
26 if ($this.hasClass('active')) { 27 if ($this.hasClass('active')) {
@@ -41,7 +42,8 @@ navHammer.on('tap', function(e) { @@ -41,7 +42,8 @@ navHammer.on('tap', function(e) {
41 42
42 //trigger lazyload 43 //trigger lazyload
43 $(window).trigger('scroll'); 44 $(window).trigger('scroll');
44 -}); 45 + });
  46 +}
45 47
46 $('.btn-balance').on('touchend', function() { 48 $('.btn-balance').on('touchend', function() {
47 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; 49 window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;