outlet.page.js
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
lazyLoad = require('yoho-jquery-lazyload'),
Countdown = require('./outlet/countdown');
var el = $('.cd-lite');
var search = require('./sale/search');
var iscroll = require('./outlet/nav');
require('./sale/search');
lazyLoad($('img.lazy'));
// nav({
// navClass: '.outlet-nav'
// })
new Countdown.Countdown({
el: el
});
if ($('.swiper-container .swiper-slide').length > 1) {
new Swiper('.swiper-container', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: true,
paginationClickable: true,
pagination: '.banner-top .pagination-inner'
});
}
$('.outlet-category-nav a').on('click', function(e) {
var href = $(this).attr('href'), // eslint-disable-line
querys = href.split('?')[1].split('&');
var query = {};
e.preventDefault();
querys.forEach(function(value) {
var queryPairs = value.split('='),
key = queryPairs[0],
val = queryPairs[1];
query[key] = val;
});
search.start({
type: 'category'
}, query);
});
// 触发第一个search
$('.outlet-category-nav a').eq(0).trigger('click');
if (('.outlet-page').length > 0) {
$('.more-activity').on('click', function() {
$('.more-activity').addClass('hidden');
$('.back-ground-white').removeClass('hidden');
});
}
if (('.outlet-page').length > 0) {
$('.outlet-nav').find('li').each(function() {
// $(this).on('click', function() {
// });
});
}
// 导航滚动
iscroll({
el: '#index_nav'
}).goto($('#index_nav').find('.active').index());
iscroll({
el: '#list-nav'
}).goto(0);