Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-im
比较版本
02fec39b2fb2cc68540ee1f8f757f8b1bb405325...c76149cc37c7b6052b425c0d43995a3b512b2dd8
U
uni-im
项目概览
DCloud
/
uni-im
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-im
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
源分支
c76149cc37c7b6052b425c0d43995a3b512b2dd8
选择Git版本
...
目标分支
02fec39b2fb2cc68540ee1f8f757f8b1bb405325
选择Git版本
比较
Commits (18)
https://gitcode.net/dcloud/uni-im/-/commit/f620de3948e28c88dbf4a20c8dbc2795dcdc88b6
Update index.scss
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/b6b5fef5978a8bcbd6f6c02e2b462bd3c58d658e
优化样式
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/6142e4283ed8fc8b7a8a78e2660fcf9302e7dceb
修复 会话列表的 note 存在 的问题
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/fb10e2eb90825eb27efdb79c8c2a56c88660c921
新增 支持用户设置自己的会话为已读/未读
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/2fe5e71111fd685479d4ba338489f7efa403a2e5
修复 web-pc 端群成员显示不全的问题
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/76497dafa8a94ce6dcf3a7b3825c675e6ca29eb6
Update index.scss
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/454d67adb0259ab25513ceb16abf4567d084746f
修复 部分情况下,APP 端所登录的账号于其他端同时进行登录后发送消息时,也会在 APP端创建通知栏消息的问题
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/43d10d6c35ffd70581e0070365370ddafb5f4586
新增 unipush 的channel相关配置,防止应用被避免被限量推送、静默推送(静音且需下拉系统通知栏才可见通知内容)
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/d4d069ab5aba2efbe82ff008cad5b4b86c4f86a7
修复 由于将“user_id”错误地改为“uid”而导致在群聊场景下“@用户”的功能中,消息内容里的已读未读图标无法显示的问题。
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/7fd2ae430204ca08a3651faeb040df45b233e4ba
Update chat.vue
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/aa46a0d438b3c49ca24996054e3bb08dd620e261
优化样式
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/a77ab62ebc4c5141031560789287743ad19030bc
Update index.scss
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/881fc5aae1348e769840cbf056b28dfe8f5bac3a
修复 微信小程序端仅插入表情包的情况下,消息发送按钮不可用的问题
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/ce325279b07f318293350d209873a44809653e3b
更新 删除过期的代码
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/e131ae99dce88e437857d42071f6c2ad7cbb8dce
Update index.scss
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/12e89108214b3985e3055e58bedd4a69a56fe66d
更新 修复部分情况下,消息操作菜单的选择更多功能的样式错误的问题
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/f9ae434be21f84ce576ed305e2a4dd87e2709dc7
新增 索引
2024-06-21T21:21:25+08:00
DCloud_JSON
linju@dcloud.io
https://gitcode.net/dcloud/uni-im/-/commit/c76149cc37c7b6052b425c0d43995a3b512b2dd8
3.1.5
2024-06-21T21:56:07+08:00
DCloud_JSON
linju@dcloud.io
隐藏空白更改
内联
并排
Showing
19 changed file
with
406 addition
and
149 deletion
+406
-149
changelog.md
changelog.md
+8
-0
common/config.js
common/config.js
+11
-0
components/uni-im-chat-input/uni-im-chat-input.vue
components/uni-im-chat-input/uni-im-chat-input.vue
+6
-3
components/uni-im-conversation-list/uni-im-conversation-list.vue
...nts/uni-im-conversation-list/uni-im-conversation-list.vue
+7
-4
components/uni-im-editor/uni-im-editor.vue
components/uni-im-editor/uni-im-editor.vue
+12
-3
components/uni-im-msg-list/uni-im-msg-list.vue
components/uni-im-msg-list/uni-im-msg-list.vue
+8
-3
components/uni-im-msg/types/rich-text.vue
components/uni-im-msg/types/rich-text.vue
+0
-1
package.json
package.json
+1
-1
pages/chat/chat.vue
pages/chat/chat.vue
+44
-84
pages/group/info.vue
pages/group/info.vue
+2
-9
pages/group/members.vue
pages/group/members.vue
+2
-1
pages/index/index.scss
pages/index/index.scss
+41
-25
pages/index/index.vue
pages/index/index.vue
+10
-7
sdk/init/index.js
sdk/init/index.js
+4
-2
sdk/init/msgEvent.js
sdk/init/msgEvent.js
+8
-3
sdk/methods/conversation/Conversation.class.js
sdk/methods/conversation/Conversation.class.js
+22
-3
uniCloud/database/uni-im-conversation.index.json
uniCloud/database/uni-im-conversation.index.json
+114
-0
uniCloud/database/uni-im-group.index.json
uniCloud/database/uni-im-group.index.json
+33
-0
uniCloud/database/uni-im-msg.index.json
uniCloud/database/uni-im-msg.index.json
+73
-0
未找到文件。
changelog.md
浏览文件 @
c76149cc
## 3.1.5(2024-06-21)
-
新增 数据库索引文件
-
新增 支持用户设置自己的会话为已读/未读
-
新增 unipush 的channel相关配置,防止应用被避免被限量推送、静默推送(静音且需下拉系统通知栏才可见通知内容)
-
修复 由于将“user_id”错误地改为“uid”而导致在群聊场景下“@用户”的功能中,消息内容里的已读未读图标无法显示的问题。
-
修复 部分情况下,APP 端所登录的账号于其他端同时进行登录后发送消息时,也会在 APP端创建通知栏消息的问题
-
修复 会话列表的 note 存在
的问题
-
优化样式
## 3.1.4(2024-06-19)
-
优化 web-pc 端样式
-
修复 web-pc 的消息菜单扩展点,传入的会话数据找不到的问题
...
...
common/config.js
0 → 100644
浏览文件 @
c76149cc
export
default
{
uniPush
:
{
// 消息渠道设置,避免被限量推送、静默推送(静音且需下拉系统通知栏才可见通知内容)详情文档:https://doc.dcloud.net.cn/uniCloud/uni-cloud-push/api.html#channel
channel
:{
// 渠道id
id
:
"
114240
"
,
// 消息渠道描述,会显示在手机系统关于当前应用的通知设置中
desc
:
"
客服消息
"
}
}
}
\ No newline at end of file
components/uni-im-chat-input/uni-im-chat-input.vue
浏览文件 @
c76149cc
...
...
@@ -26,7 +26,7 @@
<view
class=
"editor-box-parent"
>
<view
class=
"editor-box"
>
<uni-im-sound
v-show=
"soundIsShow"
@
sendSoundMsg=
"sendSoundMsg"
class=
"uni-im-sound"
></uni-im-sound>
<uni-im-editor
v-show=
"!soundIsShow"
@
input=
"oninput"
@
confirm=
"confirm"
class=
"editor"
ref=
"editor"
></uni-im-editor>
<uni-im-editor
v-show=
"!soundIsShow"
@
input=
"oninput"
@
confirm=
"confirm"
@
change=
"updateModelValue"
class=
"editor"
ref=
"editor"
></uni-im-editor>
</view>
<slot
name=
"about-msg"
></slot>
</view>
...
...
@@ -199,11 +199,14 @@
this
.
$emit
(
'
update:modelValue
'
,
e
.
value
)
this
.
$emit
(
'
input
'
,
e
)
},
updateModelValue
({
value
})
{
this
.
$emit
(
'
update:modelValue
'
,
value
)
},
focus
()
{
// console.log('focus');
this
.
$refs
.
editor
.
callRmd
(
'
$focus
'
)
},
async
addCallUser
({
uid
,
nickname
},
needDeleteLeftART
=
true
,
DL
=
0
)
{
async
addCallUser
({
u
ser_
id
,
nickname
},
needDeleteLeftART
=
true
,
DL
=
0
)
{
// 隐藏发送语音消息模式
this
.
soundIsShow
=
false
;
...
...
@@ -222,7 +225,7 @@
await
uniIm
.
utils
.
sleep
(
10
)
// 提醒末尾的此空格在margin-right: -3px;内,用于解决办法浏览器非文本节点后的光标定位不正确的问题
const
html
=
`<span class="nickname" contenteditable="false" u
id="
${
u
id
}
">@
${
nickname
}
</span> `
const
html
=
`<span class="nickname" contenteditable="false" u
ser_id="
${
user_
id
}
">@
${
nickname
}
</span> `
this
.
addHtmlToCursor
(
html
)
// setTimeout(()=>this.$refs.editor.callRmd('$restoreCursor'),500)
},
...
...
components/uni-im-conversation-list/uni-im-conversation-list.vue
浏览文件 @
c76149cc
...
...
@@ -170,7 +170,7 @@ export default {
"
left
"
:
clientX
}
let
menuList
=
[{
"
title
"
:
"
置顶
"
,
"
title
"
:
conversation
.
pinned
?
"
取消置顶
"
:
"
置顶
"
,
"
action
"
:
()
=>
{
conversation
.
pinned
=
!
conversation
.
pinned
db
.
collection
(
'
uni-im-conversation
'
)
...
...
@@ -190,6 +190,12 @@ export default {
})
}
},
{
"
title
"
:
"
标为
"
+
(
conversation
.
unread_count
?
"
已读
"
:
"
未读
"
),
"
action
"
:
()
=>
{
conversation
.
setUnreadCount
(
conversation
.
unread_count
?
0
:
1
)
}
},
{
"
title
"
:
conversation
.
mute
?
"
允许消息通知
"
:
"
消息免打扰
"
,
"
action
"
:
()
=>
{
...
...
@@ -211,9 +217,6 @@ export default {
"
action
"
:
()
=>
conversation
.
hide
()
}
]
if
(
conversation
.
pinned
)
{
menuList
[
0
].
title
=
"
取消置顶
"
}
myContextmenu
.
show
(
position
,
menuList
)
myContextmenu
.
onClose
(()
=>
{
conversation
.
focus
=
false
...
...
components/uni-im-editor/uni-im-editor.vue
浏览文件 @
c76149cc
...
...
@@ -19,7 +19,7 @@
<
script
>
import
uniIm
from
'
@/uni_modules/uni-im/sdk/index.js
'
;
export
default
{
emits
:
[
"
input
"
,
"
confirm
"
],
emits
:
[
"
input
"
,
"
confirm
"
,
"
change
"
],
data
()
{
return
{
callRmdParam
:
[],
...
...
@@ -42,7 +42,16 @@
type
:
Number
,
default
:
140
}
},
},
// #ifdef MP
watch
:
{
textareaValue
(
val
){
this
.
$emit
(
"
change
"
,{
value
:
val
})
}
},
// #endif
mounted
()
{
// 与rmd通讯专用
this
.
callRmd
=
async
(
funcName
,
...
params
)
=>
{
...
...
@@ -360,7 +369,7 @@
// "rich-text": //uniIm.utils.parseHtml( 执行比较消耗内存,改为chat页面 confirm时执行,
"
html
"
:
val
,
"
text
"
:
uniImEditor
.
innerText
,
"
aboutUserIds
"
:
Array
.
from
(
uniImEditor
.
querySelectorAll
(
'
.nickname
'
)).
map
(
i
=>
i
.
getAttribute
(
'
uid
'
))
"
aboutUserIds
"
:
Array
.
from
(
uniImEditor
.
querySelectorAll
(
'
.nickname
'
)).
map
(
i
=>
i
.
getAttribute
(
'
u
ser_
id
'
))
}
}
else
{
param
=
this
.
$inputText
()
...
...
components/uni-im-msg-list/uni-im-msg-list.vue
浏览文件 @
c76149cc
...
...
@@ -11,7 +11,7 @@
:contentText=
'
{"contentrefresh": "正在加载历史消息","contentnomore": "没有更多历史消息"}'>
</uni-im-load-state>
</view>
<view
:class=
"['item',msg.type]"
:id=
"'item-'+index"
@
click=
"clickItem"
>
<
label
class=
"msg-box"
:class=
"
{'active-msg':msg._id === activeMsgId || msg.unique_id === activeMsgId
}" @click="checkMsg(msg)">
<
view
class=
"msg-box"
:class=
"
{'active-msg':msg._id === activeMsgId || msg.unique_id === activeMsgId,'pointer':chooseMore
}" @click="checkMsg(msg)">
<template
v-if=
"chooseMore"
>
<checkbox
:checked=
"checkedMsgList.find(i=>i._id == msg._id) != undefined"
class=
"checkbox"
/>
<view
class=
"mask"
></view>
...
...
@@ -24,7 +24,7 @@
@
viewMsg=
"viewMsg"
:ref=
"'uni-im-msg'"
class=
"uni-im-msg"
>
</uni-im-msg>
</
label
>
</
view
>
</view>
</view>
</template>
...
...
@@ -82,7 +82,7 @@
components
:
{
uniImList
},
emits
:[
'
checkedMsgList
'
,
'
longpressMsgAvatar
'
,
'
showControl
'
,
'
clickItem
'
,
'
retriesSendMsg
'
,
'
putChatInputContent
'
],
emits
:[
'
checkedMsgList
'
,
'
update:checkedMsgList
'
,
'
longpressMsgAvatar
'
,
'
showControl
'
,
'
clickItem
'
,
'
retriesSendMsg
'
,
'
putChatInputContent
'
],
computed
:
{
...
uniIm
.
mapState
([
'
systemInfo
'
,
'
isWidescreen
'
]),
loadState
()
{
...
...
@@ -693,5 +693,10 @@
cursor
:
pointer
;
/* #endif */
}
/* #ifdef H5 */
.pointer
{
cursor
:
pointer
;
}
/* #endif */
}
</
style
>
\ No newline at end of file
components/uni-im-msg/types/rich-text.vue
浏览文件 @
c76149cc
...
...
@@ -189,7 +189,6 @@
/* #endif */
.text
{
display
:
inline-flex
;
word-break
:
break-all
;
cursor
:
text
;
/* #ifdef H5 */
...
...
package.json
浏览文件 @
c76149cc
{
"id"
:
"uni-im"
,
"displayName"
:
"uni-im"
,
"version"
:
"3.1.
4
"
,
"version"
:
"3.1.
5
"
,
"description"
:
"uni-im是云端一体的、全平台的、免费的、开源即时通讯系统"
,
"keywords"
:
[
"im,即时通讯,客服,聊天"
...
...
pages/chat/chat.vue
浏览文件 @
c76149cc
...
...
@@ -39,6 +39,40 @@
</view>
</
template
>
</uni-im-chat-input>
<view
v-if=
"chooseMoreMsg"
class=
"toolbar"
>
<view
class=
"item"
@
click=
"shareMsg(checkedMsgList)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"redo"
></uni-icons>
</view>
<text
class=
"title"
>
逐条转发
</text>
</view>
<view
class=
"item"
@
click=
"shareMsg(checkedMsgList,true)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"paperplane"
></uni-icons>
</view>
<text
class=
"title"
>
合并转发
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"folder-add"
></uni-icons>
</view>
<text
class=
"title"
>
收藏
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"download"
></uni-icons>
</view>
<text
class=
"title"
>
保存至电脑
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"trash"
></uni-icons>
</view>
<text
class=
"title"
>
删除
</text>
</view>
<uni-icons
@
click=
"chooseMoreMsg = false"
color=
"#999"
size=
"35"
type=
"closeempty"
></uni-icons>
</view>
</view>
<msg-popup-control
ref=
"msg-popup-control"
@
answer=
"setAnswerMsg"
@
share=
"shareMsg"
@
chooseMore=
"chooseMoreMsg = true;checkedMsgList = $event"
></msg-popup-control>
...
...
@@ -81,40 +115,6 @@
chooseMoreMsg:{{chooseMoreMsg}}
checkedMsgList:{{checkedMsgList}} -->
</view>
<view
v-if=
"chooseMoreMsg"
class=
"toolbar"
@
click=
"chooseMoreMsg = false"
>
<view
class=
"item"
@
click=
"shareMsg(checkedMsgList)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"redo"
></uni-icons>
</view>
<text
class=
"title"
>
逐条转发
</text>
</view>
<view
class=
"item"
@
click=
"shareMsg(checkedMsgList,true)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"paperplane"
></uni-icons>
</view>
<text
class=
"title"
>
合并转发
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"folder-add"
></uni-icons>
</view>
<text
class=
"title"
>
收藏
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"download"
></uni-icons>
</view>
<text
class=
"title"
>
保存至电脑
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"35"
type=
"trash"
></uni-icons>
</view>
<text
class=
"title"
>
删除
</text>
</view>
<uni-icons
@
click=
"chooseMoreMsg = false"
color=
"#999"
size=
"35"
type=
"closeempty"
></uni-icons>
</view>
</view>
</template>
...
...
@@ -151,8 +151,6 @@
leave
:
false
,
title
:
''
},
//聊天输入框高度
textareaHeight
:
26
,
navTitle
:
""
,
//导航栏标题
keyboardHeight
:
0
,
keyboardMaxHeight
:
0
,
...
...
@@ -752,7 +750,7 @@
cloudPath
:
Date
.
now
()
+
uniCloud
.
getCurrentUserInfo
().
uid
+
'
.
'
+
name
.
split
(
'
.
'
).
pop
(),
}).
then
(
res
=>
{
item
.
attrs
.
src
=
res
.
fileID
console
.
log
(
'
上传成功
'
,
res
);
//
console.log('上传成功',res);
resolve
()
}).
catch
(
e
=>
{
reject
()
...
...
@@ -849,7 +847,6 @@
},
resetChatInput
()
{
this
.
chatInputContent
=
''
this
.
textareaHeight
=
26
// 关闭引用的消息
this
.
answerMsg
=
false
},
...
...
@@ -943,10 +940,10 @@
msgListRef
.
showLast
(
duration
)
}
},
onLongpressMsgAvatar
(
uid
){
onLongpressMsgAvatar
(
u
ser_
id
){
// 当前输入框已经@了的用户id 要过滤掉
let
callUidList
=
this
.
getCallUid
()
if
(
callUidList
.
includes
(
uid
)){
if
(
callUidList
.
includes
(
u
ser_
id
)){
console
.
log
(
'
此用户id已经@过
'
);
uni
.
showToast
({
title
:
'
此用户已经@过
'
,
...
...
@@ -955,30 +952,17 @@
}
else
{
this
.
$refs
[
'
chat-input
'
].
raiseEditor
=
true
this
.
$nextTick
(()
=>
{
this
.
setCallAboutUid
(
uid
,
false
)
this
.
setCallAboutUid
(
u
ser_
id
,
false
)
})
}
},
setCallAboutUid
(
uid
,
needDeleteLeftART
=
true
)
{
setCallAboutUid
(
u
ser_
id
,
needDeleteLeftART
=
true
)
{
this
.
aboutMenberIsShow
=
false
this
.
$refs
[
'
chat-input
'
].
addCallUser
({
uid
,
nickname
:
this
.
group_member
[
uid
].
users
.
nickname
u
ser_
id
,
nickname
:
this
.
group_member
[
u
ser_
id
].
users
.
nickname
},
needDeleteLeftART
,
this
.
aboutUserKeyword
.
length
)
},
linechange
(
e
)
{
//console.log(e.detail);
let
{
height
,
lineCount
}
=
e
.
detail
;
// console.log(height,lineCount);
if
(
lineCount
===
1
)
{
this
.
textareaHeight
=
26
;
}
else
if
(
height
<=
100
)
{
this
.
textareaHeight
=
height
-
2
;
}
},
async
showControl
({
msgId
,
msgContentDomInfo
...
...
@@ -1032,6 +1016,7 @@
},
shareMsg
(
msgList
,
merge
=
false
)
{
this
.
$refs
[
'
share-msg
'
].
open
(
msgList
,
merge
)
this
.
chooseMoreMsg
=
false
},
toolBarNext
(){
uni
.
showToast
({
...
...
@@ -1041,34 +1026,9 @@
});
this
.
chooseMoreMsg
=
false
},
clickMenu
(
index
,
e
)
{
// console.log('clickMenu-',index);
if
(
index
<
2
)
{
this
.
chooseFileSendMsg
(
index
===
0
?
'
image
'
:
'
video
'
)
}
if
(
index
===
2
)
{
// #ifdef APP-PLUS
return
uni
.
showToast
({
title
:
'
暂不支持,发送文件
'
,
icon
:
'
none
'
});
// #endif
this
.
chooseFileSendMsg
(
'
all
'
)
}
e
.
stopPropagation
()
},
clickEmojiItem
(
emojiUniCode
,
e
)
{
this
.
chatInputContent
+=
emojiUniCode
e
.
stopPropagation
()
},
tapUnreadCount
()
{
//点击未读消息文字按钮事件
if
(
this
.
isWidescreen
)
{
// this.$emit('tapUnreadCount') //点击后会话列表自动滚动 置顶 待读项
// console.log('tapUnreadCount');
}
else
{
uni
.
navigateBack
();
}
uni
.
navigateBack
();
},
updateNavTitle
(){
this
.
navTitle
=
this
.
conversation
.
title
...
...
@@ -1305,7 +1265,7 @@ page {
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
260px
;
height
:
100%
;
background-color
:
#ededed
;
border-top
:
solid
1px
#ededed
;
flex-direction
:
row
;
...
...
pages/group/info.vue
浏览文件 @
c76149cc
...
...
@@ -424,16 +424,9 @@
@import
"@/uni_modules/uni-im/common/baseStyle.scss"
;
page
,
.group-info-box
{
width
:
750rpx
;
flex
:
1
;
width
:
100%
;
height
:
100%
;
background-color
:
#f5f5f5
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
)
{
height
:
calc
(
95vh
-
70px
);
overflow-y
:
auto
;
flex
:
none
;
}
/* #endif */
.logo
{
width
:
50px
;
height
:
50px
;
...
...
pages/group/members.vue
浏览文件 @
c76149cc
...
...
@@ -81,7 +81,8 @@
})
// laterRenderIndex
.
filter
((
item
,
index
)
=>
{
return
index
<
this
.
laterRenderIndex
*
50
// web-pc端有显示更多按钮,不需要延迟渲染
return
this
.
showMoreBtn
?
true
:
index
<
this
.
laterRenderIndex
*
50
})
const
memberCount
=
memberList
.
length
...
...
pages/index/index.scss
浏览文件 @
c76149cc
...
...
@@ -2,11 +2,13 @@
// flex: 1;
// }
page
{
width
:
100%
;
height
:
100vh
;
background-color
:
#2e2e3e
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
){
padding
:
20px
;
padding-bottom
:
60px
;
.pointer
{
cursor
:
pointer
;
}
...
...
@@ -61,8 +63,17 @@ page {
}
}
#conversation-list-box
{
height
:
100%
;
height
:
0
;
flex
:
1
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
){
::v-deep
{
.conversation-list-item
{
margin
:
5px
;
}
}
}
/* #endif */
}
#uni-im-contacts-box
{
position
:
absolute
;
...
...
@@ -119,26 +130,29 @@ page {
}
}
}
}
.chatInfoBox
{
z-index
:
9
;
position
:
absolute
;
right
:
0
;
top
:
70px
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.2
);
height
:
calc
(
95vh
-
70px
);
align-items
:
flex-end
;
width
:
100%
;
.group-info-text
{
max-width
:
250px
!
important
;
text-align
:
left
;
word-break
:
break-all
;
.chatInfoBox
{
z-index
:
9
;
position
:
absolute
;
right
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.2
);
height
:
100%
;
width
:
100%
;
align-items
:
flex-end
;
.group-info-parent
{
height
:
100%
;
overflow-y
:
auto
;
background-color
:
#f5f5f5
;
}
.group-info-text
{
max-width
:
250px
!
important
;
text-align
:
left
;
word-break
:
break-all
;
}
}
}
}
#ccid-is-null-tip
{
height
:
95vh
;
flex
:
1
;
padding-top
:
30vh
;
align-items
:
center
;
background-color
:
#efefef
;
...
...
@@ -176,19 +190,21 @@ page {
}
}
#foot
{
display
:
none
;
position
:
fixed
;
width
:
100%
;
height
:
50px
;
bottom
:
0
;
flex-direction
:
row
;
color
:
#FFFFFF
;
.uni-link
:hover
{
color
:
#00aa55
!
important
;
}
.item
{
flex-direction
:
row
;
justify-content
:
center
;
color
:
#FFFFFF
;
.uni-link
:hover
{
color
:
#00aa55
!
important
;
}
.item
{
flex-direction
:
row
;
margin
:
0
50px
;
align-items
:
center
;
.icon
{
.icon
{
width
:
20px
;
height
:
20px
;
margin-right
:
5px
;
...
...
pages/index/index.vue
浏览文件 @
c76149cc
...
...
@@ -74,14 +74,17 @@
<view
class=
"header"
>
<uni-icons
@
click=
"showChatInfo"
class=
"more"
type=
"more-filled"
size=
"20"
></uni-icons>
</view>
<chat-view
class=
"content"
ref=
"chat-view"
></chat-view>
</
template
>
<view
v-if=
"chatInfoIsShow"
class=
"chatInfoBox"
@
click.stop=
"chatInfoIsShow = false"
>
<view
@
click.native.stop
>
<uni-im-group-info
v-if=
"currentConversation.group_id"
ref=
"group-info"
></uni-im-group-info>
<uni-im-chat-info
v-else
ref=
"chat-info"
></uni-im-chat-info>
<view
class=
"content"
>
<chat-view
ref=
"chat-view"
></chat-view>
<view
v-if=
"chatInfoIsShow"
class=
"chatInfoBox"
@
click.stop=
"chatInfoIsShow = false"
>
<view
@
click.stop
class=
"group-info-parent"
>
<uni-im-group-info
v-if=
"currentConversation.group_id"
ref=
"group-info"
></uni-im-group-info>
<uni-im-chat-info
v-else
ref=
"chat-info"
></uni-im-chat-info>
</view>
</view>
</view>
</view>
</
template
>
</template>
<view
v-else
id=
"ccid-is-null-tip"
>
...
...
sdk/init/index.js
浏览文件 @
c76149cc
import
config
from
'
@/uni_modules/uni-im/common/config.js
'
;
import
$state
from
'
@/uni_modules/uni-im/sdk/state/index.js
'
;
import
$methods
from
'
@/uni_modules/uni-im/sdk/methods/index.js
'
;
import
{
init
as
initIndexDB
}
from
'
@/uni_modules/uni-im/sdk/ext/indexDB.js
'
;
...
...
@@ -15,6 +16,7 @@ import onSocketStateChange from './onSocketStateChange'
import
imData
from
'
./imData
'
import
onlyOneWebTab
from
'
./onlyOneWebTab
'
// #ifdef APP
// import sqlite from './sqlite.js'
// #endif
...
...
@@ -165,8 +167,8 @@ export default async function (initParam) {
plugin
.
setCustomPushChannel
(
{
// soundName: "pushsound",
channelId
:
"
114240
"
,
channelDesc
:
"
客服消息
"
,
channelId
:
config
.
uniPush
.
channel
.
id
,
channelDesc
:
config
.
uniPush
.
channel
.
desc
,
enableLights
:
true
,
enableVibration
:
true
,
importance
:
4
,
...
...
sdk/init/msgEvent.js
浏览文件 @
c76149cc
import
config
from
'
@/uni_modules/uni-im/common/config.js
'
;
import
$utils
from
'
@/uni_modules/uni-im/sdk/utils/index.js
'
;
import
$extensions
from
'
@/uni_modules/uni-im/sdk/methods/extensions.js
'
;
import
$state
from
'
../state/index.js
'
;
...
...
@@ -174,7 +175,7 @@ msgEvent.onMsg(async res=>{
'
uni_modules/uni-im/pages/userList/userList
'
,
'
uni_modules/uni-im/pages/contacts/contacts
'
]
if
(
canCreateNotification
&&
!
$state
.
ext
.
appIsActive
||
!
pathList
.
includes
(
topViewRoute
)
)
{
if
(
canCreateNotification
&&
(
!
$state
.
ext
.
appIsActive
||
!
pathList
.
includes
(
topViewRoute
))
)
{
// console.log('payload',payload);
let
{
content
,
...
...
@@ -193,9 +194,13 @@ msgEvent.onMsg(async res=>{
icon
=
downloadFileRes
[
1
]?.
tempFilePath
}
}
plus
.
push
.
createMessage
(
content
,
payload
,
{
uni
.
createPushMessage
(
{
title
,
icon
content
,
payload
,
icon
,
channelId
:
config
.
uniPush
.
channel
.
id
,
category
:
'
IM
'
,
})
}
else
if
(
conversation_id
!=
$state
.
currentConversationId
)
{
// uni.showToast({
...
...
sdk/methods/conversation/Conversation.class.js
浏览文件 @
c76149cc
...
...
@@ -308,9 +308,9 @@ class Conversation {
// console.error('last_visible_msg',_last_visible_msg)
note
=
$utils
.
getMsgNote
(
_last_visible_msg
)
}
//
去掉\\n \\r \n \r 换行符
note
=
note
.
replace
(
/
\\
n|
\\
r|
\n
|
\r
/g
,
'
'
)
return
note
//
替换\\n \\r \n \r < > & 为 空格
note
=
note
.
replace
(
/
\\
n|
\\
r|
\n
|
\r
| |<|>|&
/g
,
'
'
)
return
note
.
trim
()
},
// 刷新会话的更新时间
update_time
:{
...
...
@@ -389,6 +389,25 @@ class Conversation {
console
.
log
(
'
updated hidden
'
,
res
)
return
res
}
// 设置未读消息数
async
setUnreadCount
(
count
)
{
// console.log('setUnreadCount', count);
const
oldCount
=
this
.
unread_count
this
.
unread_count
=
count
let
res
=
await
db
.
collection
(
'
uni-im-conversation
'
)
.
doc
(
this
.
_id
)
.
update
({
"
unread_count
"
:
count
})
.
catch
(
err
=>
{
console
.
error
(
'
setUnreadCount err
'
,
err
);
this
.
unread_count
=
oldCount
})
.
then
(
e
=>
{
// console.log('setUnreadCount updated', e.result.updated);
})
return
res
}
}
export
default
Conversation
uniCloud/database/uni-im-conversation.index.json
0 → 100644
浏览文件 @
c76149cc
[
{
"IndexName"
:
"user_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"user_id"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"friend_uid_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"friend_uid"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"group_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"group_id"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"update_time_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"update_time"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"id_1_user_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"user_id"
,
"Direction"
:
"-1"
},
{
"Name"
:
"id"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"id"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"leave_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"leave"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"unread_count_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"unread_count"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"leave_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"leave"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
}
]
\ No newline at end of file
uniCloud/database/uni-im-group.index.json
0 → 100644
浏览文件 @
c76149cc
[
{
"IndexName"
:
"user_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"user_id"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"type_muteAllMembers_createTime"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"type"
,
"Direction"
:
"1"
},{
"Name"
:
"mute_all_members"
,
"Direction"
:
"1"
},
{
"Name"
:
"create_time"
,
"Direction"
:
"-1"
}
],
"MgoIsUnique"
:
false
}
}
]
\ No newline at end of file
uniCloud/database/uni-im-msg.index.json
0 → 100644
浏览文件 @
c76149cc
[
{
"IndexName"
:
"group_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"group_id"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"conversation_id_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"conversation_id"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"conversation_id_1_update_time_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"conversation_id"
,
"Direction"
:
"1"
},{
"Name"
:
"update_time"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"type_1"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"type"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
},
{
"IndexName"
:
"groupId_type_createTime"
,
"MgoKeySchema"
:
{
"MgoIndexKeys"
:
[
{
"Name"
:
"group_id"
,
"Direction"
:
"1"
},
{
"Name"
:
"type"
,
"Direction"
:
"1"
},
{
"Name"
:
"create_time"
,
"Direction"
:
"1"
}
],
"MgoIsUnique"
:
false
}
}
]
\ No newline at end of file