Authored by 张孝茹

分页

... ... @@ -656,7 +656,7 @@ class familyModel extends global.yoho.BaseModel {
uid: params.uid,
type: params.type,
page: params.page || 1,
limit: params.limit || 10,
limit: params.limit || 20,
city_id: params.cityId
}, {
code: 200
... ...
... ... @@ -11,8 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const domains = {
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
imSocket: 'ws://socket.yohobuy.com:10240',
... ...
... ... @@ -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() {
... ...
... ... @@ -231,6 +231,20 @@ html {
}
}
}
.convert-tip {
position: absolute;
top: 0;
height: 100%;
width: 100%;
}
.no-more {
text-align: center;
margin-bottom: 20px;
line-height: 50px;
height: 50px;
}
}
#mars {
... ...