Showing
1 changed file
with
15 additions
and
14 deletions
@@ -12,12 +12,13 @@ var chosePanel = require('./chose-panel'), | @@ -12,12 +12,13 @@ var chosePanel = require('./chose-panel'), | ||
12 | dialog = require('../me/dialog'), | 12 | dialog = require('../me/dialog'), |
13 | tip = require('../plugin/tip'); | 13 | tip = require('../plugin/tip'); |
14 | 14 | ||
15 | -var $cartContent = $('.cart-content'); | 15 | +var $cartContent = $('.cart-content'), |
16 | + cartType = $('#cartType').val(), | ||
17 | + hasShowCartPresellTip = false; | ||
16 | 18 | ||
17 | var navHammer, | 19 | var navHammer, |
18 | advanceBuyHammer, | 20 | advanceBuyHammer, |
19 | - freebieHammer, | ||
20 | - cartType = $('#cartType').val(); | 21 | + freebieHammer; |
21 | 22 | ||
22 | var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品 | 23 | var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品 |
23 | 24 | ||
@@ -67,6 +68,11 @@ require('./good'); | @@ -67,6 +68,11 @@ require('./good'); | ||
67 | 68 | ||
68 | lazyLoad($('img.lazy')); | 69 | lazyLoad($('img.lazy')); |
69 | 70 | ||
71 | +if (typeof window.cookie === 'function' && 'y' === window.cookie('_hasShowCartPresellTip')) { | ||
72 | + $('#presell-tip').addClass('hide'); | ||
73 | + hasShowCartPresellTip = true; | ||
74 | +} | ||
75 | + | ||
70 | if ('advance' === cartType) { | 76 | if ('advance' === cartType) { |
71 | $cartContent.toggleClass('hide'); | 77 | $cartContent.toggleClass('hide'); |
72 | $('presell-cart-nav').addClass('active'); | 78 | $('presell-cart-nav').addClass('active'); |
@@ -102,9 +108,12 @@ if ($('.cart-nav').length > 0) { | @@ -102,9 +108,12 @@ if ($('.cart-nav').length > 0) { | ||
102 | $(window).trigger('scroll'); | 108 | $(window).trigger('scroll'); |
103 | }); | 109 | }); |
104 | 110 | ||
105 | - setTimeout(function() { | ||
106 | - $('#presell-tip').addClass('hide'); | ||
107 | - }, 3000); | 111 | + if(!hasShowCartPresellTip) { |
112 | + setTimeout(function() { | ||
113 | + $('#presell-tip').addClass('hide'); | ||
114 | + window.setCookie('_hasShowCartPresellTip', 'y'); | ||
115 | + }, 3000); | ||
116 | + } | ||
108 | } | 117 | } |
109 | 118 | ||
110 | if ($('.advance-buy').length > 0) { | 119 | if ($('.advance-buy').length > 0) { |
@@ -121,14 +130,6 @@ if ($('.freebie').length > 0) { | @@ -121,14 +130,6 @@ if ($('.freebie').length > 0) { | ||
121 | }); | 130 | }); |
122 | } | 131 | } |
123 | 132 | ||
124 | -//$('.advance-buy').on('touchend', function() { | ||
125 | -// window.location.href = '/cart/index/advanceBuy?cartType=' + cartType; | ||
126 | -//}); | ||
127 | -// | ||
128 | -//$('.freebie').on('touchend', function() { | ||
129 | -// window.location.href = '/cart/index/gift?cartType=' + cartType; | ||
130 | -//}); | ||
131 | - | ||
132 | $('.btn-balance').on('touchend', function() { | 133 | $('.btn-balance').on('touchend', function() { |
133 | if (shouldSelectGift()) { | 134 | if (shouldSelectGift()) { |
134 | showChooseGifDialog(); | 135 | showChooseGifDialog(); |
-
Please register or login to post a comment