Authored by runner

Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuywap-node into release/4.6

@@ -19,6 +19,8 @@ var $goodsContainer = $('#goods-container'), @@ -19,6 +19,8 @@ var $goodsContainer = $('#goods-container'),
19 $shoesgc = $($goodsChildren.get(2)), 19 $shoesgc = $($goodsChildren.get(2)),
20 $othergc = $($goodsChildren.get(3)); 20 $othergc = $($goodsChildren.get(3));
21 21
  22 +var $filterMask;
  23 +
22 var winH = $(window).height(), 24 var winH = $(window).height(),
23 noResult = '<p class="no-result">未找到相关搜索结果</p>'; 25 noResult = '<p class="no-result">未找到相关搜索结果</p>';
24 26
@@ -310,15 +312,25 @@ function search(opt) { @@ -310,15 +312,25 @@ function search(opt) {
310 312
311 } 313 }
312 314
313 -$.ajax({ 315 +
  316 +// 筛选初始化
  317 +function filterInit() {
  318 + $.ajax({
314 type: 'GET', 319 type: 'GET',
315 url: '/product/sale/filter', 320 url: '/product/sale/filter',
316 data: $.extend(defaultOpt, { 321 data: $.extend(defaultOpt, {
317 saleType: '1' 322 saleType: '1'
318 }), 323 }),
319 success: function(data) { 324 success: function(data) {
  325 +
  326 + if ($filterMask) {
  327 + $filterMask.remove();
  328 + }
  329 +
320 $goodsContainer.append(data); 330 $goodsContainer.append(data);
321 331
  332 + $filterMask = $('.filter-mask');
  333 +
322 // 初始化filter&注册filter回调 334 // 初始化filter&注册filter回调
323 filter.initFilter({ 335 filter.initFilter({
324 fCbFn: search, 336 fCbFn: search,
@@ -333,7 +345,11 @@ $.ajax({ @@ -333,7 +345,11 @@ $.ajax({
333 missStatus: true 345 missStatus: true
334 }); 346 });
335 } 347 }
336 -}); 348 + });
  349 +}
  350 +
  351 +filterInit();
  352 +
337 lazyLoad($('.lazy')); 353 lazyLoad($('.lazy'));
338 354
339 $listNav.bind('contextmenu', function() { 355 $listNav.bind('contextmenu', function() {
@@ -376,6 +392,9 @@ $listNav.on('touchend touchcancel', function(e) { @@ -376,6 +392,9 @@ $listNav.on('touchend touchcancel', function(e) {
376 if ($this.attr('class') !== $pre.attr('class')) { 392 if ($this.attr('class') !== $pre.attr('class')) {
377 // 重置筛选项 393 // 重置筛选项
378 filter.resetFilter(); 394 filter.resetFilter();
  395 + $('.classify .shower').removeClass('default');
  396 + filterInit();
  397 + defaultOpt = $.extend({}, storeOpt);
379 } 398 }
380 399
381 $pre = $this; // $pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项 400 $pre = $this; // $pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
@@ -407,10 +426,6 @@ $listNav.on('touchend touchcancel', function(e) { @@ -407,10 +426,6 @@ $listNav.on('touchend touchcancel', function(e) {
407 default: 426 default:
408 break; 427 break;
409 } 428 }
410 -  
411 - // 重置筛选项  
412 - filter.resetFilter();  
413 - defaultOpt = $.extend({}, storeOpt);  
414 } 429 }
415 430
416 $active.removeClass('active'); 431 $active.removeClass('active');