From f1032ddef135176865a54db03e962d628fc580e4 Mon Sep 17 00:00:00 2001 From: XiuYun CHEN Date: Fri, 15 Aug 2025 17:35:06 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatkit_ui/src/main/ets/pages/ChatP2PPage.ets | 9 +++++++-- chatkit_ui/src/main/ets/view/ChatInputView.ets | 4 ++-- .../netease/src/main/ets/components/ItemCompPublic.ets | 2 +- .../src/main/ets/view/ConversationViewItem.ets | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets b/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets index 081da9c..988117c 100644 --- a/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets +++ b/chatkit_ui/src/main/ets/pages/ChatP2PPage.ets @@ -118,6 +118,11 @@ export struct ChatP2PPage { navBarHeight: number = 80; // 底部输入框以及固定按钮操作栏高度 @Local bottomHeight: number = 65; + @Monitor("bottomHeight") + onbottomHeightChange(monitor: IMonitor) { + // console.info(`name change from ${monitor.value()?.before} to ${monitor.value()?.now}`); + this.computeScrollHeight() + } @Local bottomMargin: number = 100; // bottomMargin: number = 10; bottomWithReplyHeight: number = 135; @@ -932,8 +937,8 @@ export struct ChatP2PPage { this.clearInput(true) }, onChangeInputHeight:(height:number)=> { - this.bottomHeight = height+10 - this.computeScrollHeight() + this.bottomHeight = height+25 + // this.computeScrollHeight() }, inputStyle: this.inputStyle }).alignRules({ diff --git a/chatkit_ui/src/main/ets/view/ChatInputView.ets b/chatkit_ui/src/main/ets/view/ChatInputView.ets index e58e11d..bf01420 100644 --- a/chatkit_ui/src/main/ets/view/ChatInputView.ets +++ b/chatkit_ui/src/main/ets/view/ChatInputView.ets @@ -104,8 +104,8 @@ export struct NEChatInputView { if (this.inputContentLength === 0) { return baseHeight; } - // 根据内容长度估算行数,假设每行约20个字符 - const estimatedLines = Math.ceil(this.inputContentLength / 20); + // 根据内容长度估算行数,假设每行约4420个字符 + const estimatedLines = Math.ceil(this.inputContentLength / 26); const calculatedHeight = baseHeight + (estimatedLines - 1) * lineHeight; // 限制在最小和最大高度之间 return Math.max(baseHeight, Math.min(calculatedHeight, maxHeight)); diff --git a/features/netease/src/main/ets/components/ItemCompPublic.ets b/features/netease/src/main/ets/components/ItemCompPublic.ets index 7443fd4..9285d9e 100644 --- a/features/netease/src/main/ets/components/ItemCompPublic.ets +++ b/features/netease/src/main/ets/components/ItemCompPublic.ets @@ -26,7 +26,7 @@ export struct ItemCompPublic { .fontColor($r('app.color.top_title')) .layoutWeight(1) Text(this.item.createDate ? - this.item.createDate.length > 16 ? this.item.createDate.substring(1, 16) : this.item.createDate : '') + this.item.createDate.length > 16 ? this.item.createDate.substring(0, 16) : this.item.createDate : '') .fontSize(15).fontColor($r('app.color.top_title')).padding({ left: 5 }) Text(this.unreadCount>100?'...':this.unreadCount+'') .width(18) diff --git a/localconversationkit_ui/src/main/ets/view/ConversationViewItem.ets b/localconversationkit_ui/src/main/ets/view/ConversationViewItem.ets index d40840b..9017a89 100644 --- a/localconversationkit_ui/src/main/ets/view/ConversationViewItem.ets +++ b/localconversationkit_ui/src/main/ets/view/ConversationViewItem.ets @@ -61,6 +61,7 @@ export struct ConversationViewItem { .borderRadius(20) .height(18) .width(18 + (this.getUnreadCountStr(this.conversationInfo.unreadCount).length - 1) * 4) + .margin({top:-7,right:-7}) } }