feat(hospital): 添加消息云自定义数据
- 在发送文本消息时添加云自定义数据,包含医生和患者信息 - 更新 HosImManager 类,增加 sendTextMessage 和 addCloudCustomData 方法 - 修改 HosChatView 中发送消息的逻辑,传入患者信息 - 优化 ImManage 中的 IM状态变更日志 - 在 ToolsHelper 中添加 stringToArrayBuffer 方法,用于字符串和 ArrayBuffer 的转换
这个提交包含在:
父节点
2d357c90db
当前提交
e4f8d71b6e
@ -1,6 +1,6 @@
|
|||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { BusinessError, deviceInfo } from '@kit.BasicServicesKit';
|
import { BusinessError, deviceInfo } from '@kit.BasicServicesKit';
|
||||||
import { HashMap, util } from '@kit.ArkTS';
|
import { buffer, HashMap, util } from '@kit.ArkTS';
|
||||||
import { DeviceInfo } from '../bean/DeviceInfo';
|
import { DeviceInfo } from '../bean/DeviceInfo';
|
||||||
import { common } from '@kit.AbilityKit';
|
import { common } from '@kit.AbilityKit';
|
||||||
import { md5_hex } from '../util/md5';
|
import { md5_hex } from '../util/md5';
|
||||||
@ -433,6 +433,11 @@ export class ToolsHelper {
|
|||||||
return decoder.decodeToString(new Uint8Array(arrayBuffer))
|
return decoder.decodeToString(new Uint8Array(arrayBuffer))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static stringToArrayBuffer(str: string): ArrayBuffer {
|
||||||
|
let buf = buffer.from(str, 'utf-8'); // 使用 UTF-8 编码
|
||||||
|
return buf.buffer;
|
||||||
|
}
|
||||||
|
|
||||||
private static setTimeOutMap: Map<string, ThrottleInterface> = new Map()
|
private static setTimeOutMap: Map<string, ThrottleInterface> = new Map()
|
||||||
private static uniqueIdMap = new WeakMap<Function, string>();
|
private static uniqueIdMap = new WeakMap<Function, string>();
|
||||||
|
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户