|
@@ -9,11 +9,31 @@ var $categoryNavItem = $('.outlet-category-nav a'); |
|
@@ -9,11 +9,31 @@ var $categoryNavItem = $('.outlet-category-nav a'); |
9
|
var search = require('./sale/search');
|
9
|
var search = require('./sale/search');
|
10
|
var iscroll = require('./outlet/nav');
|
10
|
var iscroll = require('./outlet/nav');
|
11
|
|
11
|
|
12
|
-require('./sale/search');
|
|
|
13
|
-
|
|
|
14
|
lazyLoad($('img.lazy'));
|
12
|
lazyLoad($('img.lazy'));
|
15
|
|
13
|
|
16
|
|
14
|
|
|
|
15
|
+// 搜索条件初始化
|
|
|
16
|
+function searchInitParam(dom) {
|
|
|
17
|
+ var href = dom.attr('href'),
|
|
|
18
|
+ querys = href.split('?')[1].split('&');
|
|
|
19
|
+
|
|
|
20
|
+ var query = {};
|
|
|
21
|
+
|
|
|
22
|
+ querys.forEach(function(value) {
|
|
|
23
|
+ var queryPairs = value.split('='),
|
|
|
24
|
+ key = queryPairs[0],
|
|
|
25
|
+ val = queryPairs[1];
|
|
|
26
|
+
|
|
|
27
|
+ if (key === 'actiontype') {
|
|
|
28
|
+ return;
|
|
|
29
|
+ }
|
|
|
30
|
+
|
|
|
31
|
+ query[key] = val;
|
|
|
32
|
+ });
|
|
|
33
|
+
|
|
|
34
|
+ return query;
|
|
|
35
|
+}
|
|
|
36
|
+
|
17
|
if ($el.length > 0) {
|
37
|
if ($el.length > 0) {
|
18
|
$el.each(function() {
|
38
|
$el.each(function() {
|
19
|
new Countdown.Countdown({
|
39
|
new Countdown.Countdown({
|
|
@@ -34,26 +54,14 @@ if ($('.swiper-container .swiper-slide').length > 1) { |
|
@@ -34,26 +54,14 @@ if ($('.swiper-container .swiper-slide').length > 1) { |
34
|
});
|
54
|
});
|
35
|
}
|
55
|
}
|
36
|
|
56
|
|
37
|
-
|
|
|
38
|
$categoryNavItem.on('click', function(e) {
|
57
|
$categoryNavItem.on('click', function(e) {
|
39
|
- var href = $(this).attr('href'),
|
|
|
40
|
- querys = href.split('?')[1].split('&');
|
|
|
41
|
-
|
|
|
42
|
- var query = {};
|
58
|
+ var query = searchInitParam($(this));
|
43
|
|
59
|
|
44
|
$('.category a').removeClass('active');
|
60
|
$('.category a').removeClass('active');
|
45
|
$(this).addClass('active');
|
61
|
$(this).addClass('active');
|
46
|
|
62
|
|
47
|
e.preventDefault();
|
63
|
e.preventDefault();
|
48
|
|
64
|
|
49
|
- querys.forEach(function(value) {
|
|
|
50
|
- var queryPairs = value.split('='),
|
|
|
51
|
- key = queryPairs[0],
|
|
|
52
|
- val = queryPairs[1];
|
|
|
53
|
-
|
|
|
54
|
- query[key] = val;
|
|
|
55
|
- });
|
|
|
56
|
-
|
|
|
57
|
search.start({
|
65
|
search.start({
|
58
|
type: 'category'
|
66
|
type: 'category'
|
59
|
}, query);
|
67
|
}, query);
|
|
@@ -61,7 +69,11 @@ $categoryNavItem.on('click', function(e) { |
|
@@ -61,7 +69,11 @@ $categoryNavItem.on('click', function(e) { |
61
|
|
69
|
|
62
|
// 触发第一个search
|
70
|
// 触发第一个search
|
63
|
if ($categoryNavItem.length > 0) {
|
71
|
if ($categoryNavItem.length > 0) {
|
64
|
- $categoryNavItem.eq(0).trigger('click');
|
72
|
+ // $categoryNavItem.eq(0).trigger('click');
|
|
|
73
|
+
|
|
|
74
|
+ search.start({
|
|
|
75
|
+ type: 'category'
|
|
|
76
|
+ }, searchInitParam($categoryNavItem.eq(0)));
|
65
|
}
|
77
|
}
|
66
|
|
78
|
|
67
|
// 导航滚动
|
79
|
// 导航滚动
|
|
@@ -77,7 +89,7 @@ if ($('.outlet-category-nav').length > 0) { |
|
@@ -77,7 +89,7 @@ if ($('.outlet-category-nav').length > 0) { |
77
|
}).goto(0);
|
89
|
}).goto(0);
|
78
|
}
|
90
|
}
|
79
|
|
91
|
|
80
|
-//更多活动按钮
|
92
|
+// 更多活动按钮
|
81
|
if ($('.back-ground-white').length > 10) {
|
93
|
if ($('.back-ground-white').length > 10) {
|
82
|
$('.more-activity').show();
|
94
|
$('.more-activity').show();
|
83
|
$('.back-ground-white').each(function(index, e) {
|
95
|
$('.back-ground-white').each(function(index, e) {
|