Authored by zhangxiaoru

正在加载

@@ -133,6 +133,7 @@ @@ -133,6 +133,7 @@
133 <div class="sale-goods container clearfix"></div> 133 <div class="sale-goods container clearfix"></div>
134 <div class="price-goods container clearfix hide"></div> 134 <div class="price-goods container clearfix hide"></div>
135 <div class="discount-goods container clearfix hide"></div> 135 <div class="discount-goods container clearfix hide"></div>
  136 + <div class="search-divide hide">正在加载...</div>
136 137
137 {{> common/filter}} 138 {{> common/filter}}
138 </div> 139 </div>
@@ -34,7 +34,8 @@ let $input = $('#search-input').find('input[name="query"]'), @@ -34,7 +34,8 @@ let $input = $('#search-input').find('input[name="query"]'),
34 $clear = $('#search-input .clear-input'), 34 $clear = $('#search-input .clear-input'),
35 $buriedpoint = $('.buriedpoint'), 35 $buriedpoint = $('.buriedpoint'),
36 $search = $('#search'), 36 $search = $('#search'),
37 - $dropList = $('.drop-list'); 37 + $dropList = $('.drop-list'),
  38 + $searchDivide = $('.search-divide');
38 39
39 let shopId, sort, brand, outlets, app_type, age_level, msort, misort, coin, app_version, students, couponId, searchFrom; 40 let shopId, sort, brand, outlets, app_type, age_level, msort, misort, coin, app_version, students, couponId, searchFrom;
40 let size, color, style, standard, gender, price, p_d, oldquery, query, limited, specialoffer, specialsale_id, promotion; 41 let size, color, style, standard, gender, price, p_d, oldquery, query, limited, specialoffer, specialsale_id, promotion;
@@ -422,7 +423,6 @@ function search(opt) { @@ -422,7 +423,6 @@ function search(opt) {
422 page = 1; 423 page = 1;
423 } else if (nav.end) { 424 } else if (nav.end) {
424 // 不需要重新加载并且数据请求结束 425 // 不需要重新加载并且数据请求结束
425 - $('.search-divide').remove();  
426 return; 426 return;
427 } 427 }
428 428
@@ -548,7 +548,7 @@ function search(opt) { @@ -548,7 +548,7 @@ function search(opt) {
548 548
549 argument = setting; 549 argument = setting;
550 550
551 - $goodsContainer.append('<div class="search-divide">正在加载...</div>'); 551 + $searchDivide.removeClass('hide');
552 552
553 $.ajax({ 553 $.ajax({
554 type: 'GET', 554 type: 'GET',
@@ -632,7 +632,7 @@ function search(opt) { @@ -632,7 +632,7 @@ function search(opt) {
632 if (nav.reload && !firstScreen) { 632 if (nav.reload && !firstScreen) {
633 $container.html(data); 633 $container.html(data);
634 num = $container.find('.good-info').length; 634 num = $container.find('.good-info').length;
635 - $('.search-divide').remove(); 635 +
636 lazyLoad($container.find('.lazy')); 636 lazyLoad($container.find('.lazy'));
637 637
638 RES_QTY = $container.find('.total').data('id'); 638 RES_QTY = $container.find('.total').data('id');
@@ -662,12 +662,8 @@ function search(opt) { @@ -662,12 +662,8 @@ function search(opt) {
662 }, 200); 662 }, 200);
663 } else { 663 } else {
664 num = $container.find('.good-info').length; 664 num = $container.find('.good-info').length;
665 - $('.search-divide').remove(); 665 +
666 $container.append(data); 666 $container.append(data);
667 - $container.append('<div class="search-divide">正在加载...</div>');  
668 - if (num < 12) {  
669 - $('.search-divide').remove();  
670 - }  
671 667
672 if ($container.find('.total')[1]) { 668 if ($container.find('.total')[1]) {
673 $container.find('.total').eq(1).remove(); 669 $container.find('.total').eq(1).remove();
@@ -704,6 +700,7 @@ function search(opt) { @@ -704,6 +700,7 @@ function search(opt) {
704 } 700 }
705 } 701 }
706 702
  703 + $searchDivide.addClass('hide');
707 nav.reload = false; 704 nav.reload = false;
708 nav.page = page; 705 nav.page = page;
709 706
@@ -750,7 +747,7 @@ function search(opt) { @@ -750,7 +747,7 @@ function search(opt) {
750 } 747 }
751 }, 748 },
752 error: function() { 749 error: function() {
753 - let $divide = $('.search-divide'); 750 + let $divide = $searchDivide;
754 751
755 $divide.html('加载失败,点击重试'); 752 $divide.html('加载失败,点击重试');
756 $divide.one('click', function() { 753 $divide.one('click', function() {
@@ -1249,9 +1246,4 @@ $('.brand-way a').on('click', function() { @@ -1249,9 +1246,4 @@ $('.brand-way a').on('click', function() {
1249 } 1246 }
1250 }); 1247 });
1251 1248
1252 -  
1253 -let fuckNum = $('.good-info').length;  
1254 -  
1255 -fuckNum < 12 && $('.search-divide').remove();  
1256 -  
1257 require('channel/maybe-like')({recpose: 100101, isExecute: true}); 1249 require('channel/maybe-like')({recpose: 100101, isExecute: true});
@@ -504,7 +504,6 @@ @@ -504,7 +504,6 @@
504 } 504 }
505 505
506 .search-divide { 506 .search-divide {
507 - float: left;  
508 height: 50px; 507 height: 50px;
509 width: 100%; 508 width: 100%;
510 padding: 10px 0; 509 padding: 10px 0;