Authored by 陈峰

Merge branch 'hotfix/act-cache' of http://git.yoho.cn/fe/yohobuywap-node into hotfix/act-cache

... ... @@ -19,7 +19,7 @@ var singleDay = {
opt = {
$productList: $('.product-list'),
$swiper: $('.swiper-tab'),
getFlag: false,
getFlag: [],
previousScrollTop: 0,
winH: $(window).height(),
noResult: '<p class="no-result">未找到相关商品</p>',
... ... @@ -113,6 +113,7 @@ var singleDay = {
for (i; i < data[1].length; i++) {
self.$productList.append('<ul class="product-tab" data-page="0"></ul>');
self.getFlag[i] = false;
}
self.$productTab = $('.product-tab');
... ... @@ -130,6 +131,9 @@ var singleDay = {
if (self.$productTab.eq(index).find('li').length > 0) {
self.$productTab.hide().eq(index).fadeIn();
$('img.lazy').lazyload({
effect: 'fadeIn'
});
} else {
self.getProductData({
index: index,
... ... @@ -154,12 +158,12 @@ var singleDay = {
var page;
var curProductTab = self.$productTab.eq(params.index);
if (self.getFlag) {
if (self.getFlag[params.index]) {
return false;
}
page = +curProductTab.attr('data-page') + 1;
self.getFlag = true;
self.getFlag[params.index] = true;
loading.showLoadingMask();
$.ajax({
... ... @@ -175,15 +179,15 @@ var singleDay = {
curProductTab.find('.no-result').hide();
curProductTab.append(product(data));
curProductTab.attr('data-page', page);
self.getFlag = false;
self.getFlag[params.index] = false;
} else {
if (page === 1) {
if (curProductTab.find('.no-result').length === 0) {
curProductTab.append(self.noResult);
}
self.getFlag = false;
self.getFlag[params.index] = false;
} else {
self.getFlag = true;
self.getFlag[params.index] = true;
}
}
... ... @@ -199,7 +203,7 @@ var singleDay = {
error: function() {
tip.show('网络断开连接了~');
loading.hideLoadingMask();
self.getFlag = false;
self.getFlag[params.index] = false;
}
});
}
... ...