|
@@ -12,13 +12,27 @@ var goodsSwiper, |
|
@@ -12,13 +12,27 @@ var goodsSwiper, |
12
|
$discountFolder = $('.goodsDiscount .discount-folder'),
|
12
|
$discountFolder = $('.goodsDiscount .discount-folder'),
|
13
|
$discountArrow = $('.goodsDiscount .first-item span');
|
13
|
$discountArrow = $('.goodsDiscount .first-item span');
|
14
|
|
14
|
|
15
|
-var goodsDiscountHammer = new Hammer(document.getElementById('goodsDiscount'));
|
15
|
+var goodsDiscountEl = document.getElementById('goodsDiscount'),
|
|
|
16
|
+ goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
|
16
|
|
17
|
|
17
|
require('./desc');
|
18
|
require('./desc');
|
18
|
require('./comments-consults');
|
19
|
require('./comments-consults');
|
19
|
|
20
|
|
20
|
//add extra marign-bottom for footer to show the yoho copyright
|
21
|
//add extra marign-bottom for footer to show the yoho copyright
|
21
|
-window.reMarginFooter('.cart-bar');
|
22
|
+function showFooter() {
|
|
|
23
|
+ var $cartBar = $('.cart-bar');
|
|
|
24
|
+
|
|
|
25
|
+ var timer = setInterval(function() {
|
|
|
26
|
+ if ($cartBar) {
|
|
|
27
|
+ window.reMarginFooter('.cart-bar');
|
|
|
28
|
+ clearInterval(timer);
|
|
|
29
|
+ } else {
|
|
|
30
|
+ $cartBar = $('.cart-bar');
|
|
|
31
|
+ }
|
|
|
32
|
+ }, 200);
|
|
|
33
|
+}
|
|
|
34
|
+
|
|
|
35
|
+showFooter();
|
22
|
|
36
|
|
23
|
lazyLoad($('img.lazy'));
|
37
|
lazyLoad($('img.lazy'));
|
24
|
|
38
|
|
|
@@ -40,15 +54,19 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { |
|
@@ -40,15 +54,19 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { |
40
|
}
|
54
|
}
|
41
|
|
55
|
|
42
|
//goods-discount下拉按钮点击事件
|
56
|
//goods-discount下拉按钮点击事件
|
43
|
-goodsDiscountHammer.on('tap', function(e) {
|
|
|
44
|
- if ($discountFolder.is(':hidden')) {
|
|
|
45
|
- $discountArrow.removeClass('icon-down').addClass('icon-up').html('');
|
|
|
46
|
- $discountFolder.slideDown();
|
|
|
47
|
- } else {
|
|
|
48
|
- $discountArrow.removeClass('icon-up').addClass('icon-down').html('');
|
|
|
49
|
- $discountFolder.slideUp();
|
|
|
50
|
- }
|
|
|
51
|
- return false;
|
|
|
52
|
-});
|
57
|
+if (goodsDiscountHammer) {
|
|
|
58
|
+ goodsDiscountHammer.on('tap', function(e) {
|
|
|
59
|
+ if ($discountFolder.is(':hidden')) {
|
|
|
60
|
+ $discountArrow.removeClass('icon-down').addClass('icon-up').html('');
|
|
|
61
|
+ $discountFolder.slideDown();
|
|
|
62
|
+ } else {
|
|
|
63
|
+ $discountArrow.removeClass('icon-up').addClass('icon-down').html('');
|
|
|
64
|
+ $discountFolder.slideUp();
|
|
|
65
|
+ }
|
|
|
66
|
+ return false;
|
|
|
67
|
+ });
|
|
|
68
|
+}
|
|
|
69
|
+
|
53
|
|
70
|
|
54
|
require('./like');
|
71
|
require('./like');
|
|
|
72
|
+ |