...
|
...
|
@@ -9,11 +9,31 @@ var $categoryNavItem = $('.outlet-category-nav a'); |
|
|
var search = require('./sale/search');
|
|
|
var iscroll = require('./outlet/nav');
|
|
|
|
|
|
require('./sale/search');
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
|
|
|
|
|
// 搜索条件初始化
|
|
|
function searchInitParam(dom) {
|
|
|
var href = dom.attr('href'),
|
|
|
querys = href.split('?')[1].split('&');
|
|
|
|
|
|
var query = {};
|
|
|
|
|
|
querys.forEach(function(value) {
|
|
|
var queryPairs = value.split('='),
|
|
|
key = queryPairs[0],
|
|
|
val = queryPairs[1];
|
|
|
|
|
|
if (key === 'actiontype') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
query[key] = val;
|
|
|
});
|
|
|
|
|
|
return query;
|
|
|
}
|
|
|
|
|
|
if ($el.length > 0) {
|
|
|
$el.each(function() {
|
|
|
new Countdown.Countdown({
|
...
|
...
|
@@ -34,26 +54,14 @@ if ($('.swiper-container .swiper-slide').length > 1) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
$categoryNavItem.on('click', function(e) {
|
|
|
var href = $(this).attr('href'),
|
|
|
querys = href.split('?')[1].split('&');
|
|
|
|
|
|
var query = {};
|
|
|
var query = searchInitParam($(this));
|
|
|
|
|
|
$('.category a').removeClass('active');
|
|
|
$(this).addClass('active');
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
querys.forEach(function(value) {
|
|
|
var queryPairs = value.split('='),
|
|
|
key = queryPairs[0],
|
|
|
val = queryPairs[1];
|
|
|
|
|
|
query[key] = val;
|
|
|
});
|
|
|
|
|
|
search.start({
|
|
|
type: 'category'
|
|
|
}, query);
|
...
|
...
|
@@ -61,7 +69,11 @@ $categoryNavItem.on('click', function(e) { |
|
|
|
|
|
// 触发第一个search
|
|
|
if ($categoryNavItem.length > 0) {
|
|
|
$categoryNavItem.eq(0).trigger('click');
|
|
|
// $categoryNavItem.eq(0).trigger('click');
|
|
|
|
|
|
search.start({
|
|
|
type: 'category'
|
|
|
}, searchInitParam($categoryNavItem.eq(0)));
|
|
|
}
|
|
|
|
|
|
// 导航滚动
|
...
|
...
|
@@ -77,7 +89,7 @@ if ($('.outlet-category-nav').length > 0) { |
|
|
}).goto(0);
|
|
|
}
|
|
|
|
|
|
//更多活动按钮
|
|
|
// 更多活动按钮
|
|
|
if ($('.back-ground-white').length > 10) {
|
|
|
$('.more-activity').show();
|
|
|
$('.back-ground-white').each(function(index, e) {
|
...
|
...
|
|