From 18aa26dcae7e4a514627c7a697e699190c07135e Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 18 Nov 2024 16:54:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E5=AE=A2=E6=9C=8D?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/components/messageList.vue | 7 ++-- pages/chat/components/messageListItem.vue | 45 ++++++++--------------- 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/pages/chat/components/messageList.vue b/pages/chat/components/messageList.vue index e014a068..4ce77fc7 100644 --- a/pages/chat/components/messageList.vue +++ b/pages/chat/components/messageList.vue @@ -83,9 +83,10 @@ refreshMessage.value = false; // 更新好后重置状态 return; } - - // 设置最后一次历史查询的最后一条消息的 createTime - queryParams.createTime = formatDate(data.at(-1).createTime); + if (data.slice(-1).length > 0) { + // 设置最后一次历史查询的最后一条消息的 createTime + queryParams.createTime = formatDate(data.slice(-1)[0].createTime); + } pagingRef.value.completeByNoMore(data, false); }; /** 刷新消息列表 */ diff --git a/pages/chat/components/messageListItem.vue b/pages/chat/components/messageListItem.vue index a0120902..a1c66463 100644 --- a/pages/chat/components/messageListItem.vue +++ b/pages/chat/components/messageListItem.vue @@ -68,10 +68,12 @@