Commit cc7f29d9 authored by zhangyajun's avatar zhangyajun
Browse files

feat: 发消息

parent b91b563d
Showing with 177 additions and 170 deletions
+177 -170
This diff is collapsed.
This diff is collapsed.
{
"name": "create-qmp-vite",
"name": "qmp-im",
"private": true,
"version": "0.0.0",
"type": "module",
......
......@@ -18,13 +18,14 @@ import ChatPageAside from './components/ChatPageAside.vue';
import { useUserImStore } from '@/store/userIm';
import FindPeople from './FindPeople.vue';
import UserChat from './user-chat/index.vue';
import { API_createRoom } from '@/api/im/index';
import EventBus from '@/utils/mitt';
import { TO_CHAT } from '@/components/chat-module/events';
import usePayDialog from '@/components/pay-dialog/usePayDialog';
import PayDialog from '@/components/pay-dialog/index.vue';
import { notify } from '@/utils/notify';
import { useInit } from '@/views/chat-views/hooks/useInit';
import { v4 as uuidv4 } from 'uuid';
import { API_createRoom } from '@/api/im/index';
import { socket_sendMessage } from '@/components/chat-module/msgUtils/socketAction';
const props = defineProps({
userInfo: Object,
......@@ -108,21 +109,24 @@ const jumpToDetail = async params => {
let room_id = await createRoom(params.user_id);
// 发送im消息
socket_sendMessage({
uniq_id: params.user_id,
room_id,
msg: JSON.stringify({
msg: `<p>${params.message}</p>`,
msg_text: params.message,
msg_delta: {
ops: [
{
insert: params.message,
},
],
},
}),
msg_type: 'html_new',
custom_id: 0,
cmd: 'send',
body: {
uniq_id: imStore.user_im_id,
room_id,
msg: JSON.stringify({
msg: `<p>${params.message}</p>`,
msg_text: params.message,
msg_delta: {
ops: [
{
insert: params.message,
},
],
},
}),
msg_type: 'html_new',
custom_id: uuidv4(),
},
});
}
setTimeout(() => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment