From f21f82ba6ea1a7238569906a92330cb995724e1c Mon Sep 17 00:00:00 2001 From: dengj <209192278@qq.com> Date: Tue, 28 Nov 2023 13:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81:=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/published/published.vue | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/pages/published/published.vue b/pages/published/published.vue index 256e835..6c0b3d0 100644 --- a/pages/published/published.vue +++ b/pages/published/published.vue @@ -50,12 +50,11 @@ } }, onPullDownRefresh() { - console.log('this.listId', this.listId); this.refresh = true if (this.listId !== 4) { - this.getMyPublished(this.listId + 1, this.pageSize, this.pageNum) + this.getMyPublished(this.listId + 1, this.pageSize, 1) } else { - this.getMatch() + this.getMatch(this.matchPageSize, 1) } this.keyword = '' }, @@ -63,21 +62,24 @@ if (this.listId !== 4 && !this.refresh && this.searchListLength !== 0) { this.pageNum++ this.getMyPublished(this.listId + 1, this.pageSize, this.pageNum) - } else if (this.listId == 4 && this.matchListLength !== 0) { + } else if (this.listId == 4 && !this.refresh &&this.matchListLength !== 0) { this.matchPageNum++ - this.getMatch() + this.getMatch(this.matchPageSize, this.matchPageNum) } else if (this.searchListLength == 0) { this.pageNum = 1 + } else if (this.matchListLength == 0) { + this.matchPageNum = 1 } this.keyword = '' }, methods: { getInput(val) { console.log('搜索值', val); - if (this.pageNum !== 1) { - this.pageNum = 1 - } + if (this.listId !== 4) { + if (this.pageNum !== 1) { + this.pageNum = 1 + } this.$api.getMyPublished({ type: this.listId + 1, pageSize: this.pageSize, @@ -98,6 +100,9 @@ } }) } else { + if (this.matchPageNum !== 1) { + this.matchPageNum = 1 + } this.$api.getMyMatch({ pageSize: this.matchPageSize, pageNum: this.matchPageNum, @@ -171,14 +176,24 @@ }) }, - getMatch() { + getMatch(pageSize,pageNum) { this.$api.getMyMatch({ - pageSize: this.matchPageSize, - pageNum: this.matchPageNum + pageSize: pageSize, + pageNum: pageNum }).then(res => { if (res.data.code == 1) { this.matchListLength = res.data.data.length - this.matchList = [...this.matchList, ...res.data.data[0]] + if(this.refresh){ + this.refresh = false + if (res.data.data.length == 0) { + this.showNull = true + } else { + this.showNull = false + } + this.matchList = res.data.data[0] + }else{ + this.matchList = [...this.matchList, ...res.data.data[0]] + } uni.stopPullDownRefresh() } else { uni.$u.toast(res.data.msg) @@ -194,7 +209,7 @@ console.log('发布信息l', res, res.data.data.length); if (res.data.code == 1) { this.searchListLength = res.data.data.length - if (isDelete == 1) { + if (isDelete == 1|| this.refresh) { this.searchInfoList = res.data.data this.refresh = false if (res.data.data.length == 0) { @@ -238,9 +253,8 @@ if (this.titletext == '我的匹配') { this.listId = 4 - this.getMatch() + this.getMatch(this.matchPageSize, this.matchPageNum) } - }, computed: {