Authored by 梁志锋

update

... ... @@ -35,17 +35,17 @@ var $listNav = $('#list-nav'),
//导航数据信息
navInfo = {
today: {
discount13: {
reload: true,
page: 0,
end: false
},
week: {
discount46: {
reload: true,
page: 0,
end: false
},
sale: {
discount79: {
reload: true,
page: 0,
end: false
... ... @@ -149,12 +149,12 @@ function search(opt) {
}
//导航类别
if ($pre === undefined || $pre.hasClass('today')) {
navType = 'today';
} else if ($pre.hasClass('week')) {
navType = 'week';
} else if ($pre.hasClass('sale')) {
navType = 'sale';
if ($pre === undefined || $pre.hasClass('discount13')) {
navType = 'discount13';
} else if ($pre.hasClass('discount46')) {
navType = 'discount46';
} else if ($pre.hasClass('discount79')) {
navType = 'discount79';
} else if ($pre.hasClass('all')) {
navType = 'all';
}
... ... @@ -185,13 +185,13 @@ function search(opt) {
$container;
switch (navType) {
case 'today':
case 'discount13':
$container = $ngc;
break;
case 'week':
case 'discount46':
$container = $pgc;
break;
case 'sale':
case 'discount79':
$container = $dgc;
break;
case 'all':
... ... @@ -259,31 +259,26 @@ $listNav.delegate('li', 'touchstart', function() {
}
} else {
if ($this.hasClass('new')) {
navType = 'newest';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
if ($this.hasClass('discount13')) {
navType = 'discount13';
} else if ($this.hasClass('discount46')) {
navType = 'discount46';
} else if ($this.hasClass('discount79')) {
navType = 'discount79';
} else if ($this.hasClass('all')) {
navType = 'all';
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
}
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
} else {
$active = $this.siblings('.active');
... ... @@ -299,15 +294,15 @@ $listNav.delegate('li', 'touchstart', function() {
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
case 'discount13':
$ngc.removeClass('hide');
break;
case 'price':
case 'discount46':
$pgc.removeClass('hide');
break;
case 'discount':
case 'discount79':
$dgc.removeClass('hide');
break;
... ...
{{> layout/header}}
<div class="good-list-page yoho-page">
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
<li class="today active">
<li class="discount13 active">
<a href="javascript:void(0);">
1-3
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="week">
<li class="discount46">
<a href="javascript:void(0);">
4-6
<span class="icon">
... ... @@ -20,7 +20,7 @@
</span>
</a>
</li>
<li class="sale">
<li class="discount79">
<a href="javascript:void(0);">
7-9
<span class="icon">
... ...