|
@@ -26,26 +26,38 @@ exports.init = function() { |
|
@@ -26,26 +26,38 @@ exports.init = function() { |
26
|
skip_invisible : false
|
26
|
skip_invisible : false
|
27
|
});
|
27
|
});
|
28
|
|
28
|
|
29
|
- //切换“最新”,“销量”,“价格”,“筛选”
|
|
|
30
|
- $('#goods-nav').delegate('.nav-item', 'touchstart', function() {
|
|
|
31
|
- var $cur = $(this);
|
|
|
32
|
-
|
|
|
33
|
- if ($cur.hasClass('focus')) {
|
|
|
34
|
- return;
|
|
|
35
|
- }
|
|
|
36
|
-
|
|
|
37
|
- $navItem.removeClass('focus');
|
|
|
38
|
- $cur.addClass('focus');
|
|
|
39
|
-
|
|
|
40
|
- $goodList.addClass('hide');
|
|
|
41
|
- if ($cur.hasClass('new-patterns-nav')) {
|
|
|
42
|
- $npc.removeClass('hide');
|
|
|
43
|
- } else if ($cur.hasClass('sales-volume-nav')) {
|
|
|
44
|
- $svc.removeClass('hide');
|
|
|
45
|
- } else if ($cur.hasClass('price-nav')) {
|
|
|
46
|
- $pc.removeClass('hide');
|
29
|
+ /**
|
|
|
30
|
+ * 导航 touch/click处理句柄
|
|
|
31
|
+ */
|
|
|
32
|
+ function touchEvt(e) {
|
|
|
33
|
+ var $cur = $(e.currentTarget);
|
|
|
34
|
+ if ($cur.hasClass('screen-nav')) {
|
|
|
35
|
+ //筛选
|
47
|
} else {
|
36
|
} else {
|
|
|
37
|
+ if ($cur.hasClass('focus')) {
|
|
|
38
|
+ return;
|
|
|
39
|
+ }
|
|
|
40
|
+
|
|
|
41
|
+ $navItem.removeClass('focus');
|
|
|
42
|
+ $cur.addClass('focus');
|
|
|
43
|
+
|
|
|
44
|
+ $goodList.addClass('hide');
|
|
|
45
|
+ if ($cur.hasClass('new-patterns-nav')) {
|
|
|
46
|
+ $npc.removeClass('hide');
|
|
|
47
|
+ } else if ($cur.hasClass('sales-volume-nav')) {
|
|
|
48
|
+ $svc.removeClass('hide');
|
|
|
49
|
+ } else if ($cur.hasClass('price-nav')) {
|
|
|
50
|
+ $pc.removeClass('hide');
|
|
|
51
|
+ }
|
48
|
}
|
52
|
}
|
|
|
53
|
+ }
|
|
|
54
|
+
|
|
|
55
|
+ //切换“最新”,“销量”,“价格”以及“筛选”功能
|
|
|
56
|
+ $('#goods-nav').delegate('.nav-item', 'touchstart', function(e) {
|
|
|
57
|
+ e.preventDefault();
|
|
|
58
|
+ touchEvt(e);
|
|
|
59
|
+ }).delegate('.nav-item', 'click', function(e) {
|
|
|
60
|
+ touchEvt(e);
|
49
|
});
|
61
|
});
|
50
|
});
|
62
|
});
|
51
|
}; |
63
|
}; |