Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FE_COMMON_LIB
qmp-im
Commits
cc7f29d9
Commit
cc7f29d9
authored
9 months ago
by
zhangyajun
Browse files
Options
Download
Email Patches
Plain Diff
feat: 发消息
parent
b91b563d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/qmp-im.js
+146
-143
lib/qmp-im.js
lib/qmp-im.umd.cjs
+10
-10
lib/qmp-im.umd.cjs
package.json
+1
-1
package.json
src/views/chat-views/index.vue
+20
-16
src/views/chat-views/index.vue
with
177 additions
and
170 deletions
+177
-170
lib/qmp-im.js
+
146
-
143
View file @
cc7f29d9
This diff is collapsed.
Click to expand it.
lib/qmp-im.umd.cjs
+
10
-
10
View file @
cc7f29d9
This diff is collapsed.
Click to expand it.
package.json
+
1
-
1
View file @
cc7f29d9
{
"name"
:
"
create-qmp-vite
"
,
"name"
:
"
qmp-im
"
,
"private"
:
true
,
"version"
:
"0.0.0"
,
"type"
:
"module"
,
...
...
This diff is collapsed.
Click to expand it.
src/views/chat-views/index.vue
+
20
-
16
View file @
cc7f29d9
...
...
@@ -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
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help