fix bug YH-145 没有加载剩余 的商品
Showing
1 changed file
with
12 additions
and
10 deletions
@@ -350,11 +350,20 @@ function search(opt) { | @@ -350,11 +350,20 @@ function search(opt) { | ||
350 | return; | 350 | return; |
351 | } | 351 | } |
352 | 352 | ||
353 | + //导航类别 | ||
354 | + if ($pre.hasClass('new')) { | ||
355 | + navType = 'newest'; | ||
356 | + } else if ($pre.hasClass('price')) { | ||
357 | + navType = 'price'; | ||
358 | + } else if ($pre.hasClass('discount')) { | ||
359 | + navType = 'discount'; | ||
360 | + } | ||
361 | + | ||
353 | if (opt) { | 362 | if (opt) { |
354 | 363 | ||
355 | //筛选项变更则重置reload为true | 364 | //筛选项变更则重置reload为true |
356 | for (att in navInfo) { | 365 | for (att in navInfo) { |
357 | - if (navInfo.hasOwnProperty(att)) { | 366 | + if (navInfo.hasOwnProperty(att) && navType !== att) { |
358 | navInfo[att].reload = true; | 367 | navInfo[att].reload = true; |
359 | } | 368 | } |
360 | } | 369 | } |
@@ -405,14 +414,6 @@ function search(opt) { | @@ -405,14 +414,6 @@ function search(opt) { | ||
405 | $.extend(defaultOpt, ext); //扩展筛选项 | 414 | $.extend(defaultOpt, ext); //扩展筛选项 |
406 | } | 415 | } |
407 | 416 | ||
408 | - //导航类别 | ||
409 | - if ($pre.hasClass('new')) { | ||
410 | - navType = 'newest'; | ||
411 | - } else if ($pre.hasClass('price')) { | ||
412 | - navType = 'price'; | ||
413 | - } else if ($pre.hasClass('discount')) { | ||
414 | - navType = 'discount'; | ||
415 | - } | ||
416 | 417 | ||
417 | nav = navInfo[navType]; | 418 | nav = navInfo[navType]; |
418 | 419 | ||
@@ -634,6 +635,8 @@ $subNav.on('touchend touchcancel', function(e) { | @@ -634,6 +635,8 @@ $subNav.on('touchend touchcancel', function(e) { | ||
634 | 635 | ||
635 | function scrollHandler() { | 636 | function scrollHandler() { |
636 | 637 | ||
638 | + sTop = -myScroll.y; | ||
639 | + | ||
637 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 | 640 | //当scroll到1/4$goodsContainer高度后继续请求下一页数据 |
638 | myScroll && myScroll.refresh(); | 641 | myScroll && myScroll.refresh(); |
639 | if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) { | 642 | if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50) { |
@@ -770,7 +773,6 @@ function cancelShop() { | @@ -770,7 +773,6 @@ function cancelShop() { | ||
770 | 773 | ||
771 | $('#collect').on('touchstart', function(e) { | 774 | $('#collect').on('touchstart', function(e) { |
772 | if ($('#collect').hasClass('alreadyCollect')) { | 775 | if ($('#collect').hasClass('alreadyCollect')) { |
773 | - console.log(1) | ||
774 | cancelShop(); | 776 | cancelShop(); |
775 | } else { | 777 | } else { |
776 | collectShop(); | 778 | collectShop(); |
-
Please register or login to post a comment