From 8a6e52e6b8b146d79e7e6735bbbbceb882f57416 Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 9 Jun 2023 09:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppConversation/conversationDetail.vue | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/project/pidu/AppConversation/conversationDetail.vue b/src/project/pidu/AppConversation/conversationDetail.vue index d41f92a4..5259b87f 100644 --- a/src/project/pidu/AppConversation/conversationDetail.vue +++ b/src/project/pidu/AppConversation/conversationDetail.vue @@ -63,6 +63,7 @@ import {mapState, mapActions} from "vuex"; export default { name: "conversationDetail", + enablePullDownRefresh: true, data() { return { tabList: [ @@ -111,6 +112,18 @@ export default { onShow() { document.title = '会话详情' }, + onPullDownRefresh() { + if(this.current > this.pages) { + uni.stopPullDownRefresh() + return this.$u.toast('已加载完成,没有更多数据') + }else { + this.current ++ + this.getList() + setTimeout(() => { + uni.stopPullDownRefresh() + }, 1000) + } + }, methods: { toGroup() { if(this.type == 1) { @@ -140,7 +153,6 @@ export default { this.getList() }, getList() { - if(this.current > this.pages) return this.$http.post(`/app/appsessionarchiveinfo/listByUser`, null, { params: { current: this.current, @@ -166,7 +178,7 @@ export default { // item.amr = amr; //将初始化好的amr赋值到当前消息对象data中 // } // }) - this.list = this.current > 1 ? [...this.list, ...res.data.records]: res.data.records + this.list = this.current > 1 ? [ ...res.data.records, ...this.list]: res.data.records this.pages = res.data.pages } }) @@ -186,8 +198,8 @@ export default { }, }, onReachBottom() { - this.current ++ - this.getList() + // this.current ++ + // this.getList() } };