fix(MessageEnter): 修正表情选择后直接发送的问题,改为插入输入框
将表情选择后的处理逻辑从直接发送改为插入到输入框末尾,让用户可以继续编辑消息
This commit is contained in:
@@ -97,16 +97,8 @@ const MessageEnter: React.FC<MessageEnterProps> = ({ contract }) => {
|
||||
// 处理表情选择
|
||||
const handleEmojiSelect = (emoji: EmojiInfo) => {
|
||||
console.log("选择表情:", emoji.name);
|
||||
// 发送表情消息
|
||||
const params = {
|
||||
wechatAccountId: contract.wechatAccountId,
|
||||
wechatChatroomId: contract?.chatroomId ? contract.id : 0,
|
||||
wechatFriendId: contract?.chatroomId ? 0 : contract.id,
|
||||
msgSubType: 0,
|
||||
msgType: 1, // 文本消息类型
|
||||
content: `[${emoji.name}]`, // 表情以文本形式发送
|
||||
};
|
||||
sendCommand("CmdSendMessage", params);
|
||||
// 将表情插入到输入框文字的最后
|
||||
setInputValue(prevValue => prevValue + `[${emoji.name}]`);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user