From 6dc2b3a4d2f8c37fd7aa2e3a2c758d4cb8b9d5de Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Thu, 31 Jul 2025 18:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/components/chat-item/chat-item.vue | 3 +++ im-uniapp/components/long-press-menu/long-press-menu.vue | 2 +- im-uniapp/pages/chat/chat-box.vue | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/im-uniapp/components/chat-item/chat-item.vue b/im-uniapp/components/chat-item/chat-item.vue index d697e87..2b7fc18 100644 --- a/im-uniapp/components/chat-item/chat-item.vue +++ b/im-uniapp/components/chat-item/chat-item.vue @@ -79,6 +79,9 @@ export default { return ""; }, isTextMessage() { + if (this.chat.messages.length == 0) { + return false; + } let idx = this.chat.messages.length - 1; let messageType = this.chat.messages[idx].type; return messageType == this.$enums.MESSAGE_TYPE.TEXT; diff --git a/im-uniapp/components/long-press-menu/long-press-menu.vue b/im-uniapp/components/long-press-menu/long-press-menu.vue index 8760ecd..22b7c8a 100644 --- a/im-uniapp/components/long-press-menu/long-press-menu.vue +++ b/im-uniapp/components/long-press-menu/long-press-menu.vue @@ -57,7 +57,7 @@ export default { } }) }, - onTouchMove() { + onTouchMove(e) { this.isTouchMove = true; let touches = e.touches[0]; // 屏幕拖动大于50px时,取消菜单 diff --git a/im-uniapp/pages/chat/chat-box.vue b/im-uniapp/pages/chat/chat-box.vue index be729e1..6f05b40 100644 --- a/im-uniapp/pages/chat/chat-box.vue +++ b/im-uniapp/pages/chat/chat-box.vue @@ -646,7 +646,9 @@ export default { // #endif // #ifdef H5 // 防止滚动条定格在顶部,不能一直往上滚,h5采用scroll-top定位 - this.holdingScrollBar(this.scrollViewHeight); + if (uni.getSystemInfoSync().platform == 'ios') { + this.holdingScrollBar(this.scrollViewHeight); + } // #endif // 多展示20条信息 this.showMinIdx = this.showMinIdx > 20 ? this.showMinIdx - 20 : 0;