Authored by 梁志锋

update

@@ -12,7 +12,7 @@ var filter = require('../../plugin/filter'); @@ -12,7 +12,7 @@ var filter = require('../../plugin/filter');
12 var $goodsContainer = $('#goods-container'), 12 var $goodsContainer = $('#goods-container'),
13 $ngc = $($goodsContainer.children().get(0)), 13 $ngc = $($goodsContainer.children().get(0)),
14 $pgc = $($goodsContainer.children().get(1)), 14 $pgc = $($goodsContainer.children().get(1)),
15 - $dgc = $($goodsContainer.children().get(2)); 15 + $dgc = $($goodsContainer.children().get(2)),
16 $all = $($goodsContainer.children().get(3)); 16 $all = $($goodsContainer.children().get(3));
17 17
18 var winH = $(window).height(); 18 var winH = $(window).height();
@@ -27,7 +27,6 @@ var defaultOpt = { @@ -27,7 +27,6 @@ var defaultOpt = {
27 price: $('#price').val(), 27 price: $('#price').val(),
28 discount: $('#discount').val(), 28 discount: $('#discount').val(),
29 limit: $('#limit').val(), 29 limit: $('#limit').val(),
30 - dayLimit: $('#dayLimit').val(),  
31 channel: $('#channel').val(), 30 channel: $('#channel').val(),
32 p_d: $('#p_d').val() 31 p_d: $('#p_d').val()
33 }; 32 };
@@ -74,7 +73,6 @@ function search(opt) { @@ -74,7 +73,6 @@ function search(opt) {
74 ext, 73 ext,
75 att, 74 att,
76 nav, navType, 75 nav, navType,
77 - dayLimit,  
78 page; 76 page;
79 77
80 if (opt) { 78 if (opt) {
@@ -153,16 +151,12 @@ function search(opt) { @@ -153,16 +151,12 @@ function search(opt) {
153 //导航类别 151 //导航类别
154 if ($pre === undefined || $pre.hasClass('today')) { 152 if ($pre === undefined || $pre.hasClass('today')) {
155 navType = 'today'; 153 navType = 'today';
156 - dayLimit = 1;  
157 } else if ($pre.hasClass('week')) { 154 } else if ($pre.hasClass('week')) {
158 navType = 'week'; 155 navType = 'week';
159 - dayLimit = 2;  
160 } else if ($pre.hasClass('sale')) { 156 } else if ($pre.hasClass('sale')) {
161 navType = 'sale'; 157 navType = 'sale';
162 - dayLimit = 3;  
163 - }else if ($pre.hasClass('all')) { 158 + } else if ($pre.hasClass('all')) {
164 navType = 'all'; 159 navType = 'all';
165 - dayLimit = 4;  
166 } 160 }
167 161
168 nav = navInfo[navType]; 162 nav = navInfo[navType];
@@ -177,7 +171,6 @@ function search(opt) { @@ -177,7 +171,6 @@ function search(opt) {
177 } 171 }
178 172
179 $.extend(setting, defaultOpt, { 173 $.extend(setting, defaultOpt, {
180 - dayLimit: dayLimit,  
181 page: page 174 page: page
182 }); 175 });
183 176
@@ -263,9 +263,7 @@ $listNav.delegate('li', 'touchstart', function() { @@ -263,9 +263,7 @@ $listNav.delegate('li', 'touchstart', function() {
263 263
264 nav = navInfo[navType]; 264 nav = navInfo[navType];
265 265
266 - if ($this.hasClass('active')) {  
267 -  
268 - } else { 266 + if ($this.hasClass('hide')) {
269 $active = $this.siblings('.active'); 267 $active = $this.siblings('.active');
270 268
271 $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项 269 $pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
@@ -309,8 +307,6 @@ $(window).scroll(function() { @@ -309,8 +307,6 @@ $(window).scroll(function() {
309 //当scroll到1/4$goodsContainer高度后继续请求下一页数据 307 //当scroll到1/4$goodsContainer高度后继续请求下一页数据
310 if ($(window).scrollTop() + winH > 308 if ($(window).scrollTop() + winH >
311 $(document).height() - 0.25 * $goodsContainer.height()) { 309 $(document).height() - 0.25 * $goodsContainer.height()) {
312 - if($pre){  
313 - search();  
314 - } 310 + +search();
315 } 311 }
316 }); 312 });
@@ -42,9 +42,84 @@ @@ -42,9 +42,84 @@
42 color: #000; 42 color: #000;
43 } 43 }
44 } 44 }
  45 +
  46 + .list-nav {
  47 + > li {
  48 + float: left;
  49 + width: 20%;
  50 + height: 33px;
  51 + line-height: 33px;
  52 + text-align: center;
  53 + font-size: 14px;
  54 + }
  55 +
  56 + a {
  57 + display: block;
  58 + box-sizing: border-box;
  59 + width: 100%;
  60 + height: 100%;
  61 + color: #999;
  62 + }
  63 +
  64 + .active > a {
  65 + border-bottom: 2px solid #000;
  66 + color: #000;
45 67
46 - .goods-list.hide {  
47 - display: none; 68 + .iconfont {
  69 + color: #999;
  70 +
  71 + &.cur {
  72 + color: #000;
  73 + }
  74 + }
  75 + }
  76 +
  77 + .new .iconfont {
  78 + @include scale(0.8);
  79 + font-weight: bold;
  80 + }
  81 +
  82 + .filter .iconfont {
  83 + font-size: 12px;
  84 + @include transition(transform 0.1 ease-in);
  85 + }
  86 +
  87 + .filter.active .iconfont {
  88 + @include rotate(-180deg);
  89 + }
  90 +
  91 + .icon {
  92 + position: relative;
  93 +
  94 + i {
  95 + position: absolute;
  96 + @include scale(0.8);
  97 + font-weight: bold;
  98 + }
  99 +
  100 + .up {
  101 + top: -11px;
  102 + }
  103 +
  104 + .down {
  105 + top: -4px;
  106 + }
  107 + }
48 } 108 }
49 - 109 +
  110 + .no-result {
  111 + text-align: center;
  112 + vertical-align: middle;
  113 + color: #ccc;
  114 + font-size: 1.2em;
  115 + margin-top: 220px;
  116 + }
  117 +
  118 + .goods-container {
  119 + position: relative;
  120 + min-height: 440px;
  121 + }
  122 +
50 } 123 }
  124 +
  125 +
@@ -50,13 +50,5 @@ @@ -50,13 +50,5 @@
50 color: #000; 50 color: #000;
51 } 51 }
52 } 52 }
53 -  
54 - .newarrival-nav-item:nth-child(4n) {  
55 - border-right: none;  
56 - }  
57 -  
58 - .goods-list.hide {  
59 - display: none;  
60 - }  
61 53
62 } 54 }