...
|
...
|
@@ -151,7 +151,7 @@ var $listNav = $('#list-nav'), |
|
|
default: {
|
|
|
order: 0,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
},
|
|
|
hot: {
|
...
|
...
|
@@ -187,11 +187,6 @@ var viewType = 1, // 1-首页,2-上新,3-人气 |
|
|
listModValue = 4 - listCount % 4,
|
|
|
listIndex;
|
|
|
|
|
|
|
|
|
// $('.main-wrap').css({
|
|
|
// position: 'static'
|
|
|
// });
|
|
|
|
|
|
// 焦点效果
|
|
|
if ($('.banner-swiper').find('li').size() > 1) {
|
|
|
bannerSwiper = new Swiper('.banner-swiper', {
|
...
|
...
|
@@ -445,22 +440,6 @@ function scrollHandler(e) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
document.addEventListener('touchmove', function(e) {
|
|
|
// sub classify不阻止默认事件
|
|
|
if ($(e.target).closest('.sub-classify').length === 0) {
|
|
|
// e.preventDefault();
|
|
|
}
|
|
|
if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) {
|
|
|
// e.preventDefault();
|
|
|
// e.stopPropagation();
|
|
|
}
|
|
|
}, false);
|
|
|
|
|
|
/* if (!isIphone) {
|
|
|
return;
|
|
|
}*/
|
|
|
|
|
|
|
|
|
// window ready 后重新refresh iscroll
|
|
|
$(window).ready(function() {
|
|
|
// myScroll && myScroll.refresh();
|
...
|
...
|
@@ -683,20 +662,9 @@ function search(opt, callback) { |
|
|
$listNav.bind('contextmenu', function(e) {
|
|
|
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 = $subNav.find('li.first-li-more'),
|
|
|
cls = '';
|
|
|
|
|
|
e.preventDefault();
|
...
|
...
|
@@ -711,14 +679,7 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
cls = 'sale';
|
|
|
}
|
|
|
|
|
|
$newList.addClass('hide');
|
|
|
$('#pos-list').addClass('hide');
|
|
|
$firstLiDom.find('.nav-txt').text($(this).text());
|
|
|
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
|
|
|
$subNav.find('.first-li-more').removeClass('new default sale').addClass(cls);
|
|
|
|
|
|
$(document).trigger('shouldSendBpData', [bpIdData]);
|
|
|
newListHide();
|
|
|
|
|
|
// 切换container显示
|
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
...
|
...
|
@@ -746,7 +707,7 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
$pre = $('.first-li-more');
|
|
|
|
|
|
var nav = navInfo[navType];
|
|
|
|
|
|
if (nav.reload) {
|
...
|
...
|
@@ -765,13 +726,6 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
|
|
|
});
|
|
|
|
|
|
$(document).on('touchstart', function(e) {
|
|
|
if (!$newList.hasClass('hide') &&
|
|
|
$(e.target).closest('.new-list, li.first-li-more').length <= 0) {
|
|
|
$newList.addClass('hide');
|
|
|
newListHide();
|
|
|
}
|
|
|
});
|
|
|
function subNavScrollTo() {
|
|
|
setTimeout(function() {
|
|
|
window.scrollTo(0, $('#list-nav').offset().top + 5);
|
...
|
...
|
@@ -791,24 +745,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
if (typeof $this === 'undefined' || $this.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
if ($this.hasClass('first-li-more')) {
|
|
|
filter.hideFilter();
|
|
|
$newList.toggleClass('hide');
|
|
|
if ($('#pos-list').hasClass('hide')) {
|
|
|
$newList.removeClass('classics');
|
|
|
} else {
|
|
|
$newList.addClass('classics');
|
|
|
}
|
|
|
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();
|
|
|
|
|
|
} else {
|
|
|
// 最新li 列表
|
|
|
$newList.addClass('hide');
|
|
|
|
...
|
...
|
@@ -918,19 +855,10 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
}, reloadCb);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($('#list-nav').offset().top > $(document).scrollTop() && $('.filter-mask').hasClass('hide')) {
|
|
|
if ($this.hasClass('first-li-more') && !$('#pos-list').hasClass('hide')) {
|
|
|
if ($('.new-list').hasClass('hide')) {
|
|
|
$('.new-list').removeClass('full-height');
|
|
|
$('#pos-list').addClass('hide');
|
|
|
} else {
|
|
|
$('.new-list').addClass('full-height');
|
|
|
}
|
|
|
} else {
|
|
|
$('#pos-list').addClass('hide');
|
|
|
}
|
|
|
} else {
|
|
|
$('.new-list').removeClass('full-height');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -942,7 +870,6 @@ $listNav.on('touchstart', 'li', function(e) { |
|
|
$(this).addClass('bytouch');
|
|
|
}).on('touchend touchcancel', function() {
|
|
|
$listNav.find('li').removeClass('bytouch');
|
|
|
|
|
|
});
|
|
|
|
|
|
$nav2.on('touchstart', 'li', function(e) {
|
...
|
...
|
|