Authored by 毕凯

Merge branch 'hotfix/searchloading' into 'release/5.3'

Hotfix/searchloading



See merge request !50
... ... @@ -139,6 +139,7 @@
{{> common/goods}}
{{/@root.firstPageGoodsList}}
</div>
<div class="search-divide">正在加载...</div>
<div class="default-goods container clearfix"></div>
<div class="new-goods container clearfix"></div>
<div class="sale-goods container clearfix"></div>
... ...
... ... @@ -578,6 +578,7 @@ function search(opt) {
if (nav.reload) {
if (data.total === 0) {
$('.search-divide').remove();
$container.html(noResult);
}
... ... @@ -596,9 +597,9 @@ function search(opt) {
}, 200);
}
} else {
if (nav.reload) {
$container.html(data);
$('.search-divide').remove();
lazyLoad($container.find('.lazy'));
RES_QTY = $container.find('.total').data('id');
... ... @@ -628,7 +629,9 @@ function search(opt) {
}, 200);
} else {
num = $container.find('.good-info').length;
$('.search-divide').remove();
$container.append(data);
$container.append('<div class="search-divide">正在加载...</div>');
if ($container.find('.total')[1]) {
$container.find('.total')[1].remove();
... ... @@ -709,6 +712,17 @@ function search(opt) {
}
},
error: function() {
var $divide = $('.search-divide');
$divide.html('加载失败,点击重试');
$divide.one('click', function() {
$divide.html('正在加载...');
nav.reload = false;
searching = false;
search();
});
}
});
... ...
... ... @@ -315,4 +315,14 @@
.suspend-home {
bottom: 258px;
}
/*搜索分割*/
.search-divide {
float: left;
height: 50px;
width: 100%;
padding: 10px 0;
color: #ccc;
text-align: center;
}
}
... ...