Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
3 changed files
with
25 additions
and
4 deletions
@@ -22,14 +22,34 @@ var navHammer, | @@ -22,14 +22,34 @@ var navHammer, | ||
22 | freebieHammer, | 22 | freebieHammer, |
23 | switchChose = false; | 23 | switchChose = false; |
24 | 24 | ||
25 | -require('./good'); | 25 | +//require('./good'); |
26 | 26 | ||
27 | -if ($('.cart-zero').length > 0) { | 27 | +function isCookiesEnabled() { |
28 | + var cookieEnabled = (navigator.cookieEnabled) ? true : false; | ||
29 | + | ||
30 | + if (typeof navigator.cookieEnabled === 'undefined' && !cookieEnabled) { | ||
31 | + document.cookie = 'testcookie'; | ||
32 | + cookieEnabled = (document.cookie.indexOf('testcookie') !== -1) ? true : false; | ||
33 | + } | ||
34 | + | ||
35 | + return (cookieEnabled); | ||
36 | +} | ||
37 | + | ||
38 | + | ||
39 | +function needLoadRecommandForYou() { | ||
40 | + return isCookiesEnabled() ? | ||
41 | + $('.shopping-cart-good').length <= 0 && window.cookie('yoho-cart-refreshByDelete') !== 'true' : | ||
42 | + $('.shopping-cart-good').length <= 0; | ||
43 | +} | ||
44 | + | ||
45 | +if (needLoadRecommandForYou()) { | ||
28 | require('../product/recommend-for-you'); | 46 | require('../product/recommend-for-you'); |
29 | } else { | 47 | } else { |
30 | require('./good'); | 48 | require('./good'); |
31 | } | 49 | } |
32 | 50 | ||
51 | +window.setCookie('yoho-cart-refreshByDelete', false); | ||
52 | + | ||
33 | ellipsis.init(); | 53 | ellipsis.init(); |
34 | 54 | ||
35 | function cartContentShow() { | 55 | function cartContentShow() { |
@@ -108,6 +108,7 @@ $('.icon-del').on('touchstart', function(e) { | @@ -108,6 +108,7 @@ $('.icon-del').on('touchstart', function(e) { | ||
108 | }); | 108 | }); |
109 | orderInfo('couponCode', null); | 109 | orderInfo('couponCode', null); |
110 | orderInfo('couponName', null); | 110 | orderInfo('couponName', null); |
111 | + window.setCookie('yoho-cart-refreshByDelete', true); | ||
111 | window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); | 112 | window.location.href = '/cart/index/index?cartType=' + $('#cartType').val(); |
112 | } else { | 113 | } else { |
113 | tip.show(data.message); | 114 | tip.show(data.message); |
@@ -123,10 +123,10 @@ | @@ -123,10 +123,10 @@ | ||
123 | } | 123 | } |
124 | 124 | ||
125 | .count { | 125 | .count { |
126 | - font-size: 28rem / $pxConvertRem; | 126 | + font-size: 20rem / $pxConvertRem; |
127 | color: #999; | 127 | color: #999; |
128 | display: inline-block; | 128 | display: inline-block; |
129 | - width: 19%; | 129 | + width: 22%; |
130 | position: absolute; | 130 | position: absolute; |
131 | text-align: center; | 131 | text-align: center; |
132 | } | 132 | } |
-
Please register or login to post a comment