diff --git a/subpkg/archives/archives.vue b/subpkg/archives/archives.vue index 90a6ddc..6437dd8 100644 --- a/subpkg/archives/archives.vue +++ b/subpkg/archives/archives.vue @@ -32,7 +32,10 @@ :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> --> - + + + @@ -120,7 +123,6 @@ :loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> - @@ -142,6 +144,12 @@ task_id: -1, is_admin: false, list: [], + current: 0, + tabLists: [{ + name: '未更新', + }, { + name: '已更新' + }], loadConfig: { page: 1, limit: 15, @@ -167,7 +175,7 @@ title: '任务:信息更新' }) } - this.loadInformationList(); + this.initLoad(); uni.$on('loadArchives', this.initLoad); }, onShow() { @@ -201,7 +209,7 @@ this.loadConfig.page = 1; this.loadConfig.status = "loadmore"; this.list = []; - this.is_admin ? null : await this.loadInformationList(); + await this.loadInformationList(); uni.stopPullDownRefresh(); }, async loadInformationList() { @@ -209,14 +217,19 @@ if (this.loadConfig.status == "nomore") return; this.loadConfig.status = "loading" let res = {}; - if (this.is_admin) res = await taskInformationgist({ - id: this.task_id - }); - else res = await informationList({ - page: this.loadConfig.page, - limit: this.loadConfig.limit, - user_id: that.user_id - }) + if (this.is_admin) { + res = await taskInformationgist({ + id: this.task_id + }); + } + else { + res = await informationList({ + page: this.loadConfig.page, + limit: this.loadConfig.limit, + user_id: that.user_id, + is_update: this.current + }) + } this.loadConfig.status = "loadmore" if (res.data.length < this.loadConfig.limit) { this.loadConfig.status = "nomore" @@ -224,7 +237,11 @@ this.loadConfig.page++; } this.list = [...this.list, ...res.data]; - } + }, + changeCurrent(e) { + this.current = e.index; + this.initLoad(); + } }, onPullDownRefresh() { this.initLoad();