...
|
...
|
@@ -31,6 +31,7 @@ class IconMall extends Page { |
|
|
this.loading = false;
|
|
|
this.end = false;
|
|
|
this.fixTop = this.selector.$tabFixed.offset().top;
|
|
|
this.beforeScroll = $(window).scrollTop();
|
|
|
|
|
|
this.init();
|
|
|
}
|
...
|
...
|
@@ -49,7 +50,7 @@ class IconMall extends Page { |
|
|
}
|
|
|
|
|
|
scrollHandler() {
|
|
|
if (($(window).scrollTop() + $(window).height() >= $(document).height() * 0.8)) {
|
|
|
if (($(window).scrollTop() + $(window).height() >= $(document).height() * 0.3)) {
|
|
|
this.doMore();
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -81,13 +82,15 @@ class IconMall extends Page { |
|
|
}
|
|
|
this.loading = false;
|
|
|
|
|
|
this.selector.$goBtn = $('.go-btn');
|
|
|
this.selector.$goBtn.on('click', this.goConversion.bind(this));
|
|
|
|
|
|
lazyLoad($result.find('img.lazy'));
|
|
|
} else {
|
|
|
if (this.type === 'now') {
|
|
|
this.selector.$yohonowTab.append('<p class="no-more">没有更多了...</p>');
|
|
|
}
|
|
|
if (this.type === 'mars') {
|
|
|
this.selector.$marsTab.append('<p class="no-more">没有更多了...</p>');
|
|
|
}
|
|
|
this.end = true;
|
|
|
tip.show('没有更多数据了~~~');
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
console.error(error);
|
...
|
...
|
@@ -96,17 +99,16 @@ class IconMall extends Page { |
|
|
|
|
|
scroll() {
|
|
|
$(window).scroll(() => {
|
|
|
// let $scrollTop = $(window).scrollTop();
|
|
|
|
|
|
// if ($scrollTop >= this.fixTop) {
|
|
|
// this.selector.$tabFixed.find('.tab').addClass('fixed');
|
|
|
// } else {
|
|
|
// this.selector.$tabFixed.find('.tab').removeClass('fixed');
|
|
|
// }
|
|
|
|
|
|
$(window).scroll(() => {
|
|
|
window.requestAnimationFrame(this.scrollHandler.bind(this));
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
let afterScroll = $(window).scrollTop();
|
|
|
|
|
|
if (afterScroll - this.beforeScroll > 0) {
|
|
|
window.requestAnimationFrame(this.scrollHandler.bind(this));
|
|
|
this.beforeScroll = afterScroll;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
}, 5);
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -115,6 +117,7 @@ class IconMall extends Page { |
|
|
this.selector.$acquiringHelp.on('click', this.openHelp.bind(this));
|
|
|
this.selector.$detail.on('click', this.openDetail.bind(this));
|
|
|
$(window).on('scroll touchmove touchstart touchend', this.move.bind(this));
|
|
|
$(document).on('click', '.go-btn', this.goConversion.bind(this));
|
|
|
}
|
|
|
|
|
|
move() {
|
...
|
...
|
|