...
|
...
|
@@ -34,6 +34,7 @@ var $subNav = $('.home-sub-nav'), |
|
|
shopId = $('input[name="shop_id"]').val(),
|
|
|
appVersion = $('input[name="app_version"]').val(),
|
|
|
brand = $('input[name="brand"]').val(),
|
|
|
coverChannel = $('input[name="coverChannel"]').val(),
|
|
|
favId = $('input[name="favId"]').val();
|
|
|
|
|
|
var winH = $(window).height(),
|
...
|
...
|
@@ -149,6 +150,10 @@ function getPageGoods(info) { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (info.data && coverChannel) {
|
|
|
info.data.coverChannel = coverChannel;
|
|
|
}
|
|
|
|
|
|
searching = true;
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
...
|
...
|
@@ -219,7 +224,7 @@ function hotData(callback) { |
|
|
req.callBack = function(data) {
|
|
|
$('#popularity').append(data);
|
|
|
navInfo.hot.page++;
|
|
|
myScroll.refresh();
|
|
|
// myScroll.refresh();
|
|
|
lazyLoad($('#popularity .lazy'));
|
|
|
scH = $('#scroller').outerHeight();
|
|
|
searching = false;
|
...
|
...
|
@@ -265,7 +270,7 @@ function tabChange(dom, index) { |
|
|
$nav1.removeClass('fixed-top absolute');
|
|
|
$nav2.removeClass('fixed-top absolute');
|
|
|
}
|
|
|
myScroll && myScroll.refresh();
|
|
|
// myScroll && myScroll.refresh();
|
|
|
scH = $('#scroller').outerHeight();
|
|
|
if (!$nav1.hasClass('hide')) {
|
|
|
myScroll && myScroll.scrollTo(0, 0 - imgH);
|
...
|
...
|
@@ -443,7 +448,7 @@ document.addEventListener('touchmove', function(e) { |
|
|
|
|
|
// window ready 后重新refresh iscroll
|
|
|
$(window).ready(function() {
|
|
|
myScroll && myScroll.refresh();
|
|
|
// myScroll && myScroll.refresh();
|
|
|
imgH = $('#nav-top').outerHeight();
|
|
|
nav1H = $('#nav').outerHeight();
|
|
|
main1H = $('#nav-main').height();
|
...
|
...
|
@@ -460,7 +465,7 @@ $(window).ready(function() { |
|
|
|
|
|
setTimeout(function() {
|
|
|
scH = $('#scroller').outerHeight();
|
|
|
}, 1000);
|
|
|
}, 500);
|
|
|
|
|
|
|
|
|
myScroll.on('scroll', scrollHandler);
|
...
|
...
|
@@ -505,6 +510,8 @@ function search(opt) { |
|
|
opt.url = location.protocol + '//m.yohobuy.com/index/search/search';
|
|
|
}
|
|
|
|
|
|
$pre = $listNav.find('.active').eq(0);
|
|
|
|
|
|
if (!opt.nextPage) {
|
|
|
|
|
|
// 筛选项变更则重置reload为true
|
...
|
...
|
@@ -527,6 +534,8 @@ function search(opt) { |
|
|
ext = {
|
|
|
gender: opt.id
|
|
|
};
|
|
|
|
|
|
ext.coverChannel = opt.id;
|
|
|
break;
|
|
|
case 'brand':
|
|
|
ext = {
|
...
|
...
|
@@ -588,6 +597,12 @@ function search(opt) { |
|
|
// 不需要重新加载并且数据请求结束
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//封面图,defaultOpt对象也有可能包含coverChannel,但defaultOpt优先级高
|
|
|
if (coverChannel) {
|
|
|
setting.coverChannel = coverChannel;
|
|
|
}
|
|
|
|
|
|
$.extend(setting, defaultOpt, {
|
|
|
type: navType,
|
|
|
order: nav.order,
|
...
|
...
|
@@ -653,7 +668,7 @@ function search(opt) { |
|
|
|
|
|
window.rePosFooter();
|
|
|
|
|
|
myScroll.refresh();
|
|
|
myScroll && myScroll.refresh();
|
|
|
reNav1Pos();
|
|
|
|
|
|
bindGoodThumbClick();
|
...
|
...
|
@@ -691,18 +706,9 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
// 筛选面板切换状态
|
|
|
if ($this.hasClass('active')) {
|
|
|
filter.hideFilter();
|
|
|
|
|
|
// 点击筛选钱的active项回复active
|
|
|
$pre.addClass('active');
|
|
|
$this.removeClass('active');
|
|
|
|
|
|
myScroll && myScroll.enable();
|
|
|
} else {
|
|
|
$pre = $this.siblings('.active');
|
|
|
|
|
|
$pre.removeClass('active');
|
|
|
$this.addClass('active');
|
|
|
|
|
|
|
|
|
myScroll && myScroll.scrollTo(0, -(imgH + main1oH + nav1H));
|
|
|
|
|
|
theY = imgH + main1oH + nav1H;
|
...
|
...
|
@@ -747,9 +753,8 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
|
|
|
// 价格/折扣切换排序状态
|
|
|
$this.find('.icon > .iconfont').toggleClass('cur');
|
|
|
$pre = $this; // 更新pre为当前项
|
|
|
nav.reload = true; // 重置reload,HTML会被替换为逆序的HTML
|
|
|
nav.order = nav.order === 0 ? 1 : 0; // 切换排序
|
|
|
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
|
|
|
nav.order = nav.order === 0 ? 1 : 0; //切换排序
|
|
|
|
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
|
|
|
...
|
...
|
@@ -773,8 +778,6 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
} else {
|
|
|
$active = $subNav.find('.active');
|
|
|
|
|
|
$pre = $this; // $pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
|
|
|
|
|
|
if ($active.hasClass('filter')) {
|
|
|
|
|
|
// 若之前active项为筛选,则隐藏筛选面板
|
...
|
...
|
@@ -799,6 +802,9 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
theY = imgH + main1oH + nav1H;
|
|
|
reNav1Pos();
|
|
|
}
|
|
|
|
|
|
$subNav.children().removeClass('active');
|
...
|
...
|
@@ -838,14 +844,14 @@ $listNav.on('touchstart', 'li', function(e) { |
|
|
$(this).addClass('bytouch');
|
|
|
}).on('touchend touchcancel', function() {
|
|
|
$listNav.find('li').removeClass('bytouch');
|
|
|
myScroll && myScroll.refresh();
|
|
|
// myScroll && myScroll.refresh();
|
|
|
});
|
|
|
|
|
|
$nav2.on('touchstart', 'li', function(e) {
|
|
|
$(this).addClass('bytouch');
|
|
|
}).on('touchend touchcancel', function() {
|
|
|
$nav2.find('li').removeClass('bytouch');
|
|
|
myScroll && myScroll.refresh();
|
|
|
// myScroll && myScroll.refresh();
|
|
|
});
|
|
|
|
|
|
// 底部导航点击
|
...
|
...
|
@@ -920,9 +926,9 @@ $collect.on('touchstart', function() { |
|
|
}
|
|
|
|
|
|
setTimeout(function() {
|
|
|
myScroll.refresh();
|
|
|
// myScroll.refresh();
|
|
|
scH = $('#scroller').outerHeight();
|
|
|
}, 1000);
|
|
|
}, 500);
|
|
|
searching = false;
|
|
|
},
|
|
|
error: function() {
|
...
|
...
|
|