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
8760c44c
Commit
8760c44c
authored
9 months ago
by
zhangyajun
Browse files
Options
Download
Email Patches
Plain Diff
feat: 弹框聊天
parent
cc7f29d9
master
feat_apiReplace
0.0.30
0.0.29
0.0.28
0.0.27
0.0.26
0.0.25
0.0.24
0.0.23
0.0.22
0.0.21
0.0.20
0.0.19
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/qmp-im.js
+2315
-2281
lib/qmp-im.js
lib/qmp-im.umd.cjs
+20
-20
lib/qmp-im.umd.cjs
src/views/chat-views/chat-room.vue
+36
-4
src/views/chat-views/chat-room.vue
with
2371 additions
and
2305 deletions
+2371
-2305
lib/qmp-im.js
+
2315
-
2281
View file @
8760c44c
This diff is collapsed.
Click to expand it.
lib/qmp-im.umd.cjs
+
20
-
20
View file @
8760c44c
This diff is collapsed.
Click to expand it.
src/views/chat-views/chat-room.vue
+
36
-
4
View file @
8760c44c
...
...
@@ -16,11 +16,14 @@ import EventBus from '@/utils/mitt';
import
{
ACTIVE_CHAT
}
from
'
@/components/chat-module/events
'
;
import
{
useInit
}
from
'
@/views/chat-views/hooks/useInit
'
;
import
{
API_getUserInfo
,
API_createRoom
}
from
'
@/api/im/index
'
;
import
{
socket_sendMessage
}
from
'
@/components/chat-module/msgUtils/socketAction
'
;
import
{
v4
as
uuidv4
}
from
'
uuid
'
;
const
props
=
defineProps
({
userInfo
:
Object
,
token
:
String
,
env
:
String
,
to_uniq_id
:
String
,
to_message
:
String
,
});
useInit
(
props
);
const
imStore
=
useUserImStore
();
...
...
@@ -50,6 +53,9 @@ const createRoomFn = (id: string) => {
chatLoading
.
value
=
true
;
Promise
.
all
([
getUserInfo
(
id
),
createRoom
(
id
)])
.
then
(
res
=>
{
if
(
id
!==
props
.
to_uniq_id
)
{
return
;
}
const
createUser
=
Object
.
assign
(
res
[
0
],
{
total
:
0
,
room_type
:
0
,
...
...
@@ -68,11 +74,37 @@ const createRoomFn = (id: string) => {
});
allRoomList
.
value
=
[
createUser
];
roomList
.
value
=
[
createUser
];
nextTick
(()
=>
{
EventBus
.
emit
(
ACTIVE_CHAT
,
{
room_id
:
res
[
1
],
debugger
;
if
(
props
.
to_message
)
{
socket_sendMessage
({
cmd
:
'
send
'
,
body
:
{
uniq_id
:
imStore
.
user_im_id
,
room_id
:
res
[
1
],
msg
:
JSON
.
stringify
({
msg
:
`<p>
${
props
.
to_message
}
</p>`
,
msg_text
:
props
.
to_message
,
msg_delta
:
{
ops
:
[
{
insert
:
props
.
to_message
,
},
],
},
}),
msg_type
:
'
html_new
'
,
custom_id
:
uuidv4
(),
},
});
});
}
setTimeout
(
()
=>
{
EventBus
.
emit
(
ACTIVE_CHAT
,
{
room_id
:
res
[
1
],
});
},
props
.
to_message
?
20
:
0
,
);
})
.
finally
(()
=>
{
chatLoading
.
value
=
false
;
...
...
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