feat(im): 优化 IM 登录和消息发送逻辑

- 添加 IM 在线状态枚举和相关监听接口
- 实现 IM 登录状态的管理和持久化
-优化消息发送流程,添加发送状态监听
- 调整 UI 以显示 IM 连接状态和消息发送状态
- 修正部分注释和命名,提高代码可读性
这个提交包含在:
xuqm 2025-03-26 16:15:09 +08:00
父节点 1b7d0b0bba
当前提交 2d357c90db

查看文件

@ -113,7 +113,8 @@ export struct RefreshView {
// 使用父组件@Builder装饰的方法初始化子组件@BuilderParam // 使用父组件@Builder装饰的方法初始化子组件@BuilderParam
@BuilderParam customBuilderParam: (item: ESObject, index: number) => void @BuilderParam customBuilderParam: (item: ESObject, index: number) => void
@BuilderParam headBuilderParam: () => void = this.doNothingBuilder; @BuilderParam headerBuilderParam: () => void = this.doNothingBuilder;
@BuilderParam footerBuilderParam: () => void = this.doNothingBuilder;
build() { build() {
@ -123,7 +124,7 @@ export struct RefreshView {
scroller: this._scroller, scroller: this._scroller,
}) { }) {
ListItem() { ListItem() {
this.headBuilderParam() this.headerBuilderParam()
} }
ForEach(this.data ?? [], (item: ESObject, index: number) => { ForEach(this.data ?? [], (item: ESObject, index: number) => {
@ -131,6 +132,10 @@ export struct RefreshView {
this.customBuilderParam(item, index) this.customBuilderParam(item, index)
} }
}, (item: ESObject, index: number) => this.keyGenerator!(item, index)) }, (item: ESObject, index: number) => this.keyGenerator!(item, index))
ListItem() {
this.footerBuilderParam()
}
} }
.onTouch((event: TouchEvent) => { .onTouch((event: TouchEvent) => {
const e1 = event.touches[0] const e1 = event.touches[0]