前端修改

This commit is contained in:
linfeng 2023-01-15 15:21:53 +08:00
parent 6258beae87
commit 8f7305e835

View File

@ -15,23 +15,23 @@
postList: [], postList: [],
loadStatus: "loading", loadStatus: "loading",
page: 1, page: 1,
type: 1,//1 2 type: 1, //1 2
}; };
}, },
onLoad(options) { onLoad(options) {
this.type=options.type this.type = options.type
if(options.type==1){ if (options.type == 1) {
this.getCollectPostList(); this.getCollectPostList();
}else if(options.type==2){ } else if (options.type == 2) {
this.getMyPostList(); this.getMyPostList();
} }
}, },
onReachBottom() { onReachBottom() {
if(this.type==1){ if (this.type == 1) {
this.page++; this.page++;
this.getCollectPostList(); this.getCollectPostList();
}else if(this.type==2){ } else if (this.type == 2) {
this.page++; this.page++;
this.getMyPostList(); this.getMyPostList();
} }
@ -44,14 +44,14 @@
this.$H.get('post/myCollectPost', { this.$H.get('post/myCollectPost', {
page: this.page page: this.page
}).then(res => { }).then(res => {
if(res.result.data){ if (res.result.data) {
this.postList = this.postList.concat(res.result.data); this.postList = this.postList.concat(res.result.data);
if (res.result.current_page >= res.result.total || res.result.last_page === 0) { if (res.result.current_page >= res.result.total || res.result.last_page === 0) {
this.loadStatus = "nomore"; this.loadStatus = "nomore";
} else { } else {
this.loadStatus = "loadmore" this.loadStatus = "loadmore"
} }
}else{ } else {
this.loadStatus = "nomore"; this.loadStatus = "nomore";
} }
}) })