bug优化

This commit is contained in:
XiuYun CHEN 2025-08-15 17:35:06 +08:00
parent 7035dbcdfb
commit f1032ddef1
4 changed files with 11 additions and 5 deletions

View File

@ -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({

View File

@ -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));

View File

@ -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)

View File

@ -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})
}
}