Authored by 梁志锋

update

@@ -35,17 +35,17 @@ var $listNav = $('#list-nav'), @@ -35,17 +35,17 @@ var $listNav = $('#list-nav'),
35 35
36 //导航数据信息 36 //导航数据信息
37 navInfo = { 37 navInfo = {
38 - today: { 38 + discount13: {
39 reload: true, 39 reload: true,
40 page: 0, 40 page: 0,
41 end: false 41 end: false
42 }, 42 },
43 - week: { 43 + discount46: {
44 reload: true, 44 reload: true,
45 page: 0, 45 page: 0,
46 end: false 46 end: false
47 }, 47 },
48 - sale: { 48 + discount79: {
49 reload: true, 49 reload: true,
50 page: 0, 50 page: 0,
51 end: false 51 end: false
@@ -149,12 +149,12 @@ function search(opt) { @@ -149,12 +149,12 @@ function search(opt) {
149 } 149 }
150 150
151 //导航类别 151 //导航类别
152 - if ($pre === undefined || $pre.hasClass('today')) {  
153 - navType = 'today';  
154 - } else if ($pre.hasClass('week')) {  
155 - navType = 'week';  
156 - } else if ($pre.hasClass('sale')) {  
157 - navType = 'sale'; 152 + if ($pre === undefined || $pre.hasClass('discount13')) {
  153 + navType = 'discount13';
  154 + } else if ($pre.hasClass('discount46')) {
  155 + navType = 'discount46';
  156 + } else if ($pre.hasClass('discount79')) {
  157 + navType = 'discount79';
158 } else if ($pre.hasClass('all')) { 158 } else if ($pre.hasClass('all')) {
159 navType = 'all'; 159 navType = 'all';
160 } 160 }
@@ -185,13 +185,13 @@ function search(opt) { @@ -185,13 +185,13 @@ function search(opt) {
185 $container; 185 $container;
186 186
187 switch (navType) { 187 switch (navType) {
188 - case 'today': 188 + case 'discount13':
189 $container = $ngc; 189 $container = $ngc;
190 break; 190 break;
191 - case 'week': 191 + case 'discount46':
192 $container = $pgc; 192 $container = $pgc;
193 break; 193 break;
194 - case 'sale': 194 + case 'discount79':
195 $container = $dgc; 195 $container = $dgc;
196 break; 196 break;
197 case 'all': 197 case 'all':
@@ -259,31 +259,26 @@ $listNav.delegate('li', 'touchstart', function() { @@ -259,31 +259,26 @@ $listNav.delegate('li', 'touchstart', function() {
259 } 259 }
260 } else { 260 } else {
261 261
262 - if ($this.hasClass('new')) {  
263 - navType = 'newest';  
264 - } else if ($this.hasClass('price')) {  
265 - navType = 'price';  
266 - } else if ($this.hasClass('discount')) {  
267 - navType = 'discount'; 262 + if ($this.hasClass('discount13')) {
  263 + navType = 'discount13';
  264 + } else if ($this.hasClass('discount46')) {
  265 + navType = 'discount46';
  266 + } else if ($this.hasClass('discount79')) {
  267 + navType = 'discount79';
  268 + } else if ($this.hasClass('all')) {
  269 + navType = 'all';
268 } 270 }
269 271
270 nav = navInfo[navType]; 272 nav = navInfo[navType];
271 273
272 if ($this.hasClass('active')) { 274 if ($this.hasClass('active')) {
273 275
274 - //最新无排序切换  
275 - if ($this.hasClass('new')) {  
276 - return;  
277 - }  
278 -  
279 - if ($this.hasClass('price') || $this.hasClass('discount')) {  
280 -  
281 - // 价格/折扣切换排序状态  
282 - $this.find('.icon > .iconfont').toggleClass('cur');  
283 - $pre = $this; //更新pre为当前项  
284 - nav.reload = true; //重置reload,HTML会被替换为逆序的HTML  
285 - nav.order = nav.order === 0 ? 1 : 0; //切换排序  
286 - } 276 + // 价格/折扣切换排序状态
  277 + $this.find('.icon > .iconfont').toggleClass('cur');
  278 + $pre = $this; //更新pre为当前项
  279 + nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
  280 + nav.order = nav.order === 0 ? 1 : 0; //切换排序
  281 +
287 } else { 282 } else {
288 $active = $this.siblings('.active'); 283 $active = $this.siblings('.active');
289 284
@@ -299,15 +294,15 @@ $listNav.delegate('li', 'touchstart', function() { @@ -299,15 +294,15 @@ $listNav.delegate('li', 'touchstart', function() {
299 $goodsContainer.children('.container:not(.hide)').addClass('hide'); 294 $goodsContainer.children('.container:not(.hide)').addClass('hide');
300 295
301 switch (navType) { 296 switch (navType) {
302 - case 'newest': 297 + case 'discount13':
303 $ngc.removeClass('hide'); 298 $ngc.removeClass('hide');
304 break; 299 break;
305 300
306 - case 'price': 301 + case 'discount46':
307 $pgc.removeClass('hide'); 302 $pgc.removeClass('hide');
308 break; 303 break;
309 304
310 - case 'discount': 305 + case 'discount79':
311 $dgc.removeClass('hide'); 306 $dgc.removeClass('hide');
312 break; 307 break;
313 308
1 {{> layout/header}} 1 {{> layout/header}}
2 -<div class="good-list-page yoho-page"> 2 +<div class="discount-page yoho-page">
3 {{# headerBanner}} 3 {{# headerBanner}}
4 {{> product/banner_swipe_and_single}} 4 {{> product/banner_swipe_and_single}}
5 {{/ headerBanner}} 5 {{/ headerBanner}}
6 6
7 <ul id="list-nav" class="list-nav clearfix"> 7 <ul id="list-nav" class="list-nav clearfix">
8 - <li class="today active"> 8 + <li class="discount13 active">
9 <a href="javascript:void(0);"> 9 <a href="javascript:void(0);">
10 1-3 10 1-3
11 <span class="iconfont cur">&#xe616;</span> 11 <span class="iconfont cur">&#xe616;</span>
12 </a> 12 </a>
13 </li> 13 </li>
14 - <li class="week"> 14 + <li class="discount46">
15 <a href="javascript:void(0);"> 15 <a href="javascript:void(0);">
16 4-6 16 4-6
17 <span class="icon"> 17 <span class="icon">
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 </span> 20 </span>
21 </a> 21 </a>
22 </li> 22 </li>
23 - <li class="sale"> 23 + <li class="discount79">
24 <a href="javascript:void(0);"> 24 <a href="javascript:void(0);">
25 7-9 25 7-9
26 <span class="icon"> 26 <span class="icon">