...
|
...
|
@@ -19,6 +19,8 @@ var $goodsContainer = $('#goods-container'), |
|
|
$shoesgc = $($goodsChildren.get(2)),
|
|
|
$othergc = $($goodsChildren.get(3));
|
|
|
|
|
|
var $filterMask;
|
|
|
|
|
|
var winH = $(window).height(),
|
|
|
noResult = '<p class="no-result">未找到相关搜索结果</p>';
|
|
|
|
...
|
...
|
@@ -310,15 +312,25 @@ function search(opt) { |
|
|
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
// 筛选初始化
|
|
|
function filterInit() {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/sale/filter',
|
|
|
data: $.extend(defaultOpt, {
|
|
|
saleType: '1'
|
|
|
}),
|
|
|
success: function(data) {
|
|
|
|
|
|
if ($filterMask) {
|
|
|
$filterMask.remove();
|
|
|
}
|
|
|
|
|
|
$goodsContainer.append(data);
|
|
|
|
|
|
$filterMask = $('.filter-mask');
|
|
|
|
|
|
// 初始化filter&注册filter回调
|
|
|
filter.initFilter({
|
|
|
fCbFn: search,
|
...
|
...
|
@@ -333,7 +345,11 @@ $.ajax({ |
|
|
missStatus: true
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
filterInit();
|
|
|
|
|
|
lazyLoad($('.lazy'));
|
|
|
|
|
|
$listNav.bind('contextmenu', function() {
|
...
|
...
|
@@ -376,6 +392,9 @@ $listNav.on('touchend touchcancel', function(e) { |
|
|
if ($this.attr('class') !== $pre.attr('class')) {
|
|
|
// 重置筛选项
|
|
|
filter.resetFilter();
|
|
|
$('.classify .shower').removeClass('default');
|
|
|
filterInit();
|
|
|
defaultOpt = $.extend({}, storeOpt);
|
|
|
}
|
|
|
|
|
|
$pre = $this; // $pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
|
...
|
...
|
@@ -407,10 +426,6 @@ $listNav.on('touchend touchcancel', function(e) { |
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
// 重置筛选项
|
|
|
filter.resetFilter();
|
|
|
defaultOpt = $.extend({}, storeOpt);
|
|
|
}
|
|
|
|
|
|
$active.removeClass('active');
|
...
|
...
|
|