Authored by 姜枫

Merge branch 'hotfix/shop-index-style'

@@ -84,7 +84,7 @@ var viewType = 1, // 1-首页,2-上新,3-人气 @@ -84,7 +84,7 @@ var viewType = 1, // 1-首页,2-上新,3-人气
84 listModValue = 4 - listCount % 4, 84 listModValue = 4 - listCount % 4,
85 listIndex; 85 listIndex;
86 86
87 -lazyLoad($('img.lazy')); 87 +
88 88
89 //焦点效果 89 //焦点效果
90 if ($('.banner-swiper').find('li').size() > 1) { 90 if ($('.banner-swiper').find('li').size() > 1) {
@@ -177,7 +177,7 @@ function newData(callback) { @@ -177,7 +177,7 @@ function newData(callback) {
177 177
178 req.url = location.protocol + '//m.yohobuy.com/index/search/search'; 178 req.url = location.protocol + '//m.yohobuy.com/index/search/search';
179 req.data = { 179 req.data = {
180 - type: 'newest', 180 + type: 'new',
181 order: '1', 181 order: '1',
182 page: navInfo.new.page, 182 page: navInfo.new.page,
183 tagNew: '1' 183 tagNew: '1'
@@ -256,13 +256,11 @@ function tabChange(dom, index) { @@ -256,13 +256,11 @@ function tabChange(dom, index) {
256 hotData(); 256 hotData();
257 viewType = 3; 257 viewType = 3;
258 } else if (activeTab === 'home-page') { 258 } else if (activeTab === 'home-page') {
259 -  
260 - myScroll && myScroll.refresh();  
261 - scH = $('#scroller').outerHeight();  
262 $nav1.removeClass('fixed-top absolute'); 259 $nav1.removeClass('fixed-top absolute');
263 $nav2.removeClass('fixed-top absolute'); 260 $nav2.removeClass('fixed-top absolute');
264 } 261 }
265 - 262 + myScroll && myScroll.refresh();
  263 + scH = $('#scroller').outerHeight();
266 if (!$nav1.hasClass('hide')) { 264 if (!$nav1.hasClass('hide')) {
267 myScroll && myScroll.scrollTo(0, 0 - imgH); 265 myScroll && myScroll.scrollTo(0, 0 - imgH);
268 } 266 }
@@ -320,7 +318,6 @@ function scrollHandler() { @@ -320,7 +318,6 @@ function scrollHandler() {
320 318
321 var tra; 319 var tra;
322 320
323 -  
324 theY = sTop; 321 theY = sTop;
325 if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) { 322 if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) {
326 if ($pre !== undefined) { 323 if ($pre !== undefined) {
@@ -439,7 +436,7 @@ document.addEventListener('touchmove', function(e) { @@ -439,7 +436,7 @@ document.addEventListener('touchmove', function(e) {
439 436
440 //window ready 后重新refresh iscroll 437 //window ready 后重新refresh iscroll
441 $(window).ready(function() { 438 $(window).ready(function() {
442 - //myScroll && myScroll.refresh(); 439 + myScroll && myScroll.refresh();
443 imgH = $('#nav-top').outerHeight(); 440 imgH = $('#nav-top').outerHeight();
444 nav1H = $('#nav').outerHeight(); 441 nav1H = $('#nav').outerHeight();
445 main1H = $('#nav-main').height(); 442 main1H = $('#nav-main').height();
@@ -454,14 +451,12 @@ $(window).ready(function() { @@ -454,14 +451,12 @@ $(window).ready(function() {
454 click: true 451 click: true
455 }); 452 });
456 453
457 - //setTimeout(function() { 454 + setTimeout(function() {
458 scH = $('#scroller').outerHeight(); 455 scH = $('#scroller').outerHeight();
459 - //}, 1000); 456 + }, 1000);
460 457
461 458
462 - myScroll.on('scroll', function() {  
463 - window.requestAnimationFrame(scrollHandler);  
464 - }); 459 + myScroll.on('scroll', scrollHandler);
465 460
466 myScroll.on('scrollStart', function() { 461 myScroll.on('scrollStart', function() {
467 462
@@ -479,8 +474,9 @@ $(window).ready(function() { @@ -479,8 +474,9 @@ $(window).ready(function() {
479 multiSwiper && multiSwiper.startAutoplay(); 474 multiSwiper && multiSwiper.startAutoplay();
480 475
481 $('#scroller').trigger('scroll'); 476 $('#scroller').trigger('scroll');
  477 + scrollHandler.bind(this)();
482 }); 478 });
483 - 479 + lazyLoad($('img.lazy'));
484 }); 480 });
485 481
486 function bindGoodThumbClick() { 482 function bindGoodThumbClick() {
@@ -646,10 +642,7 @@ function search(opt) { @@ -646,10 +642,7 @@ function search(opt) {
646 642
647 window.rePosFooter(); 643 window.rePosFooter();
648 644
649 - setTimeout(function() {  
650 - myScroll && myScroll.refresh();  
651 - }, 0);  
652 - 645 + myScroll.refresh();
653 reNav1Pos(); 646 reNav1Pos();
654 647
655 bindGoodThumbClick(); 648 bindGoodThumbClick();
@@ -830,14 +823,14 @@ $listNav.on('touchstart', 'li', function(e) { @@ -830,14 +823,14 @@ $listNav.on('touchstart', 'li', function(e) {
830 $(this).addClass('bytouch'); 823 $(this).addClass('bytouch');
831 }).on('touchend touchcancel', function() { 824 }).on('touchend touchcancel', function() {
832 $listNav.find('li').removeClass('bytouch'); 825 $listNav.find('li').removeClass('bytouch');
833 - //myScroll && myScroll.refresh(); 826 + myScroll && myScroll.refresh();
834 }); 827 });
835 828
836 $nav2.on('touchstart', 'li', function(e) { 829 $nav2.on('touchstart', 'li', function(e) {
837 $(this).addClass('bytouch'); 830 $(this).addClass('bytouch');
838 }).on('touchend touchcancel', function() { 831 }).on('touchend touchcancel', function() {
839 $nav2.find('li').removeClass('bytouch'); 832 $nav2.find('li').removeClass('bytouch');
840 - //myScroll && myScroll.refresh(); 833 + myScroll && myScroll.refresh();
841 }); 834 });
842 835
843 //底部导航点击 836 //底部导航点击
@@ -900,7 +893,7 @@ function postCollect(info) { @@ -900,7 +893,7 @@ function postCollect(info) {
900 } 893 }
901 894
902 setTimeout(function() { 895 setTimeout(function() {
903 - //myScroll.refresh(); 896 + myScroll.refresh();
904 scH = $('#scroller').outerHeight(); 897 scH = $('#scroller').outerHeight();
905 }, 1000); 898 }, 1000);
906 searching = false; 899 searching = false;
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 {{#each hotList}} 103 {{#each hotList}}
104 <li class="buriedpoint" data-bp-id="shop_hotList_{{url}}"> 104 <li class="buriedpoint" data-bp-id="shop_hotList_{{url}}">
105 <a href="{{url}}"> 105 <a href="{{url}}">
106 - <img class="lazy" data-original="{{img}}"> 106 + <img src="{{img}}">
107 </a> 107 </a>
108 <div class="list-price"> 108 <div class="list-price">
109 <p>{{productName}}</p> 109 <p>{{productName}}</p>