zhangbo1_wd

首页分页加载改为预加载,去除分页动画

... ... @@ -84,10 +84,10 @@ export struct PageComponent {
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
})
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
} else if (!this.pageModel.contentNeedScroll) {
PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
}
... ...
... ... @@ -35,7 +35,7 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel,
touchUpPullRefresh(pageModel, pageAdvModel);
} else {
// Fingers up, handle loading more.
touchUpLoadMore(pageModel);
// touchUpLoadMore(pageModel);
}
break;
default:
... ...
... ... @@ -4,13 +4,18 @@ import PageHelper from '../viewmodel/PageHelper';
export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
// list size +1
if (model.endIndex === model.compList.totalCount() || model.endIndex === model.compList.totalCount() + 1) {
model.offsetY = event.touches[0].y - model.downY;
if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
model.isCanLoadMore = true;
model.isVisiblePullUpLoad = true;
model.offsetY = -vp2px(model.pullUpLoadHeight) + model.offsetY * Const.Y_OFF_SET_COEFFICIENT;
}
if (model.endIndex >= model.compList.totalCount()-3 && model.endIndex <= model.compList.totalCount()) {
// model.offsetY = event.touches[0].y - model.downY;
// if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
// model.isCanLoadMore = true;
// model.isVisiblePullUpLoad = true;
// model.offsetY = -vp2px(model.pullUpLoadHeight) + model.offsetY * Const.Y_OFF_SET_COEFFICIENT;
// }
// 不用分页动画,直接预加载
model.isCanLoadMore = true;
model.isVisiblePullUpLoad = true;
touchUpLoadMore(model);
}
}
... ...