Authored by 郝肖肖

店铺翻页 判断是否返回为空

... ... @@ -239,7 +239,7 @@ function search(opt) {
SORT_TYPE: setting.dayLimit
};
if (data === ' ' || data === '' || data.list) {
if (data === '' || (data.list && data.list.length <= 0)) {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
... ...
... ... @@ -279,7 +279,7 @@ function search(opt, params, isScroll) {
$container.removeClass('hide');
}
if (data === '') {
if (data === '' || (data.list && data.list.length <= 0)) {
nav.end = true;
if (nav.reload) {
... ...
... ... @@ -18,8 +18,7 @@ var bannerSwiper,
scH,
$nav1 = $('#pos-nav'),
$nav2 = $('#pos-list'),
sTop,
toTop = false;
sTop;
var tip = require('../plugin/tip'),
filter = require('../plugin/filter'),
... ... @@ -240,8 +239,7 @@ function getPageGoods(info) {
nav = navInfo[navType];
// 不需要重新加载并且数据请求结束
if (nav.end && toTop) {
toTop = false;
if (nav.end) {
return;
}
... ... @@ -255,7 +253,9 @@ function getPageGoods(info) {
url: info.url,
data: info.data,
success: function(data) {
if (data === '' || (data.list && data.list.length <= 0)) {
nav.end = true;
}
info.callBack(data);
},
error: function() {
... ... @@ -364,11 +364,9 @@ function tabChange(dom, index) {
$(main).hide();
$('#' + activeTab).fadeIn();
if (activeTab === 'new-arrival') {
toTop = true;
newData(isPos ? scrollToNav1 : function() {});
viewType = 2;
} else if (activeTab === 'popularity') {
toTop = true;
hotData(isPos ? scrollToNav1 : function() {});
viewType = 3;
} else if (activeTab === 'home-page') {
... ...
... ... @@ -199,7 +199,6 @@ function getPageGoods(info) {
// 不需要重新加载并且数据请求结束
if (nav.end) {
return;
}
... ...