...
|
...
|
@@ -26,8 +26,7 @@ var $goodsContainer = $('#goods-container'), |
|
|
$ngc = $goodsContainer.children('.new-goods'),
|
|
|
$sgc = $goodsContainer.children('.sale-goods'),
|
|
|
$pgc = $goodsContainer.children('.price-goods'),
|
|
|
$dgc = $goodsContainer.children('.discount-goods'),
|
|
|
$newList = $('.new-list');
|
|
|
$dgc = $goodsContainer.children('.discount-goods');
|
|
|
|
|
|
var winH = $(window).height();
|
|
|
|
...
|
...
|
@@ -66,19 +65,19 @@ var $listNav = $('#list-nav'), |
|
|
default: {
|
|
|
order: 0,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
},
|
|
|
new: {
|
|
|
order: 0,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
},
|
|
|
sale: {
|
|
|
order: 0,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -873,88 +872,6 @@ $listNav.bind('contextmenu', function() { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
function newListHide() {
|
|
|
var $firstLi = $listNav.find('li.first-li-more');
|
|
|
|
|
|
if ($newList.hasClass('hide')) {
|
|
|
$firstLi.find('span.up').addClass('hide');
|
|
|
$firstLi.find('span.down').removeClass('hide');
|
|
|
} else {
|
|
|
$firstLi.find('span.down').addClass('hide');
|
|
|
$firstLi.find('span.up').removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$newList.on('touchstart', 'li', function(e) {
|
|
|
var navType, bpIdData = $(this).attr('data-bp-id') || '',
|
|
|
$firstLiDom = $listNav.find('li.first-li-more');
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
if ($(this).hasClass('new')) {
|
|
|
navType = 'new';
|
|
|
} else if ($(this).hasClass('default')) {
|
|
|
navType = 'default';
|
|
|
} else if ($(this).hasClass('sale')) {
|
|
|
navType = 'sale';
|
|
|
}
|
|
|
|
|
|
$newList.addClass('hide');
|
|
|
$firstLiDom.find('.nav-txt').text($(this).text());
|
|
|
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
|
|
|
$listNav.find('.first-li-more').removeClass('new default sale').addClass(navType);
|
|
|
|
|
|
$(document).trigger('shouldSendBpData', [bpIdData]);
|
|
|
newListHide();
|
|
|
|
|
|
if (navType !== 'default') {
|
|
|
$fsgc.addClass('hide');
|
|
|
}
|
|
|
|
|
|
if ($(this).hasClass('active')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 切换container显示
|
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'new':
|
|
|
$ngc.removeClass('hide');
|
|
|
break;
|
|
|
|
|
|
case 'price':
|
|
|
$pgc.removeClass('hide');
|
|
|
break;
|
|
|
|
|
|
case 'discount':
|
|
|
$dgc.removeClass('hide');
|
|
|
break;
|
|
|
|
|
|
case 'default':
|
|
|
$defaultgc.removeClass('hide');
|
|
|
$fsgc.removeClass('hide');
|
|
|
break;
|
|
|
|
|
|
case 'sale':
|
|
|
$sgc.removeClass('hide');
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
$pre = $firstLiDom;
|
|
|
search({filtering: true});
|
|
|
});
|
|
|
|
|
|
$(document).on('touchstart', function(e) {
|
|
|
if (!$newList.hasClass('hide') &&
|
|
|
$(e.target).closest('.new-list, li.first-li-more').length <= 0) {
|
|
|
$newList.addClass('hide');
|
|
|
newListHide();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$listNav.on('touchend touchcancel', function(e) {
|
|
|
var $this = $(e.target).closest('li'),
|
|
|
nav,
|
...
|
...
|
@@ -962,23 +879,6 @@ $listNav.on('touchend touchcancel', function(e) { |
|
|
$active;
|
|
|
var bpIdData = $(this).find('.buriedpoint').attr('data-bp-id') || '';
|
|
|
|
|
|
if ($this.hasClass('first-li-more')) {
|
|
|
filter.hideFilter();
|
|
|
$newList.toggleClass('hide');
|
|
|
if ($this.hasClass('default')) {
|
|
|
$newList.find('li.default').addClass('active').siblings().removeClass('active');
|
|
|
} else if ($this.hasClass('new')) {
|
|
|
$newList.find('li.new').addClass('active').siblings().removeClass('active');
|
|
|
} else if ($this.hasClass('sale')) {
|
|
|
$newList.find('li.sale').addClass('active').siblings().removeClass('active');
|
|
|
}
|
|
|
newListHide();
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
// 最新li 列表
|
|
|
$newList.addClass('hide');
|
|
|
|
|
|
if ($this.hasClass('filter')) {
|
|
|
|
|
|
// 筛选面板切换状态
|
...
|
...
|
@@ -1014,8 +914,8 @@ $listNav.on('touchend touchcancel', function(e) { |
|
|
|
|
|
if ($this.hasClass('active')) {
|
|
|
|
|
|
// 最新无排序切换
|
|
|
if ($this.hasClass('new')) {
|
|
|
// 默认、最新无排序切换
|
|
|
if ($this.hasClass('default') || $this.hasClass('new')) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
|