...
|
...
|
@@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param'); |
|
|
channel: defaultOpt.channel
|
|
|
},
|
|
|
success: function(data) {
|
|
|
$goodsContainer.append(data);
|
|
|
$('.shop-index').after(data);
|
|
|
|
|
|
// 初始化filter&注册filter回调
|
|
|
filter.initFilter({
|
...
|
...
|
@@ -344,10 +344,13 @@ function tabChange(dom, index) { |
|
|
// 首页导航
|
|
|
(function(nav, posNav, main) {
|
|
|
var scrollToNav1 = function() {
|
|
|
setTimeout(function(){
|
|
|
window.scrollTo(0, $('#nav').offset().top + 5);
|
|
|
}, 100)
|
|
|
};
|
|
|
|
|
|
$(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() {
|
|
|
var isPos = $(this).parent().attr('id') === 'pos-nav';
|
|
|
var index = $(this).index(),
|
|
|
activeTab = $(this).attr('tab');
|
|
|
|
...
|
...
|
@@ -362,17 +365,17 @@ function tabChange(dom, index) { |
|
|
$('#' + activeTab).fadeIn();
|
|
|
if (activeTab === 'new-arrival') {
|
|
|
toTop = true;
|
|
|
newData(scrollToNav1);
|
|
|
newData(isPos ? scrollToNav1 : function() {});
|
|
|
viewType = 2;
|
|
|
} else if (activeTab === 'popularity') {
|
|
|
toTop = true;
|
|
|
hotData(scrollToNav1);
|
|
|
hotData(isPos ? scrollToNav1 : function() {});
|
|
|
viewType = 3;
|
|
|
} else if (activeTab === 'home-page') {
|
|
|
$nav1.removeClass('fixed-top absolute');
|
|
|
$nav2.removeClass('fixed-top absolute');
|
|
|
viewType = 1;
|
|
|
scrollToNav1();
|
|
|
isPos && scrollToNav1();
|
|
|
}
|
|
|
scH = $('#scroller').outerHeight();
|
|
|
});
|
...
|
...
|
@@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
}, function() {
|
|
|
});
|
|
|
}
|
|
|
e.stopPropagation();
|
|
|
|
|
|
});
|
|
|
|
...
|
...
|
@@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) { |
|
|
}
|
|
|
});
|
|
|
function subNavScrollTo() {
|
|
|
setTimeout(function() {
|
|
|
window.scrollTo(0, $('#list-nav').offset().top + 5);
|
|
|
}, 100)
|
|
|
}
|
|
|
$subNav.on('touchend touchcancel', function(e) {
|
|
|
var $this = $(e.target).closest('li'),
|
...
|
...
|
@@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
url: '/product/search/search',
|
|
|
nextPage: false
|
|
|
}, function() {
|
|
|
subNavScrollTo();
|
|
|
});
|
|
|
}
|
|
|
}
|
...
|
...
|
|