Authored by 陈峰

经典店铺首页点击价格和折扣不会导致页面滚动

... ... @@ -833,24 +833,8 @@ $subNav.on('touchend touchcancel', function(e) {
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
// 最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
$this = $subNav.find(cname);
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
nav.reload = true; // 重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; // 切换排序
var reloadCb = function() {
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
... ... @@ -869,6 +853,21 @@ $subNav.on('touchend touchcancel', function(e) {
default:
break;
}
}
if ($this.hasClass('active')) {
// 最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
$this = $subNav.find(cname);
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
nav.reload = true; // 重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; // 切换排序
}
} else {
... ... @@ -881,26 +880,7 @@ $subNav.on('touchend touchcancel', function(e) {
} else {
// 切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
case 'default':
$defaultgc.removeClass('hide');
break;
default:
break;
}
reloadCb();
}
$subNav.children().removeClass('active');
... ... @@ -915,8 +895,7 @@ $subNav.on('touchend touchcancel', function(e) {
appVersion: appVersion,
url: '/product/search/search',
nextPage: false
}, function() {
});
}, reloadCb);
}
}
e.stopPropagation();
... ...