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: {