Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-im
提交
83221940
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看板
提交
83221940
编写于
4月 25, 2024
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新 统一使用 uniIm.toChat打开新会话,并在必要时携带source
上级
5fc2a1ad
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
48 addition
and
94 deletion
+48
-94
components/uni-im-msg/types/rich-text.vue
components/uni-im-msg/types/rich-text.vue
+8
-12
components/uni-im-msg/types/userinfo-card.vue
components/uni-im-msg/types/userinfo-card.vue
+6
-8
components/uni-im-msg/uni-im-msg.vue
components/uni-im-msg/uni-im-msg.vue
+8
-11
pages/contacts/contacts.nvue
pages/contacts/contacts.nvue
+1
-30
pages/contacts/groupList/groupList.nvue
pages/contacts/groupList/groupList.nvue
+1
-18
pages/group/members.nvue
pages/group/members.nvue
+6
-10
sdk/ext/index.js
sdk/ext/index.js
+13
-3
sdk/index.js
sdk/index.js
+5
-2
未找到文件。
components/uni-im-msg/types/rich-text.vue
浏览文件 @
83221940
...
...
@@ -158,18 +158,14 @@
},
privateChat
(
user_id
)
{
if
(
this
.
canPrivateChat
)
{
if
(
uniIm
.
isWidescreen
)
{
uni
.
$emit
(
'
uni-im-toChat
'
,
{
user_id
})
}
else
{
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-im/pages/chat/chat?user_id=
'
+
user_id
,
animationDuration
:
300
uniIm
.
toChat
({
user_id
,
source
:{
group_id
:
this
.
msg
.
group_id
}
})
}
}
},
}
}
</
script
>
...
...
components/uni-im-msg/types/userinfo-card.vue
浏览文件 @
83221940
...
...
@@ -46,14 +46,12 @@ export default {
},
methods
:
{
onClick
()
{
if
(
uniIm
.
isWidescreen
)
{
uni
.
$emit
(
'
uni-im-toChat
'
,
{
user_id
:
this
.
msg
.
body
.
user_id
})
}
else
{
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-im/pages/chat/chat?user_id=
'
+
this
.
msg
.
body
.
user_id
,
animationDuration
:
300
})
uniIm
.
toChat
({
user_id
:
this
.
msg
.
body
.
user_id
,
source
:{
group_id
:
this
.
msg
.
group_id
}
})
},
}
}
...
...
components/uni-im-msg/uni-im-msg.vue
浏览文件 @
83221940
...
...
@@ -7,6 +7,7 @@
{{
friendlyTime
}}
</text>
</view>
msg.revoke_ing:
{{
msg
.
revoke_ing
}}
<view
class=
"msg-box"
>
<view
v-if=
"msg.is_revoke"
class=
"revoke-text-box"
>
<text
class=
"revoke-text"
>
...
...
@@ -337,17 +338,13 @@
},
toChat
()
{
if
(
this
.
canPrivateChat
)
{
if
(
uniIm
.
isWidescreen
)
{
uni
.
$emit
(
'
uni-im-toChat
'
,
{
"
user_id
"
:
this
.
msg
.
from_uid
})
}
else
{
uni
.
navigateTo
({
url
:
'
/uni_modules/uni-im/pages/chat/chat?user_id=
'
+
this
.
msg
.
from_uid
,
animationDuration
:
300
uniIm
.
toChat
({
user_id
:
this
.
msg
.
from_uid
,
source
:
{
group_id
:
this
.
msg
.
group_id
}
})
}
}
else
{}
},
chatInputContentAddcallUser
()
{
if
(
this
.
msg
.
group_id
)
{
...
...
pages/contacts/contacts.nvue
浏览文件 @
83221940
...
...
@@ -187,36 +187,7 @@
return uniIm.notification.unreadCount(param)
},
toChat(item) {
// console.log('this.isWidescreen',this.isWidescreen)
if (this.isWidescreen) {
//若为宽屏,则触发右侧详情页的自定义事件,通知右侧窗体刷新详情
uni.$emit('uni-im-toChat', {
user_id: item._id
})
} else {
// 若为窄屏,则打开新窗体,在新窗体打开详情页面
openPages('/uni_modules/uni-im/pages/chat/chat?user_id=' + item._id);
}
function openPages(url) {
uni.navigateTo({
url,
fail: (err1) => {
console.log({
err1
});
uni.switchTab({
url,
fail: (err2) => {
console.error({
err1,
err2
})
}
});
}
});
}
uniIm.toChat({user_id: item._id})
},
hiddenDeleteBtn() {
this.activeIndex = false
...
...
pages/contacts/groupList/groupList.nvue
浏览文件 @
83221940
...
...
@@ -57,24 +57,7 @@
},
toChat(group_id) {
let conversation_id = 'group_' + group_id
if(this.isWidescreen){
uni.$emit('uni-im-toChat',conversation_id)
}else{
let url = "/uni_modules/uni-im/pages/chat/chat?conversation_id=" + conversation_id
uni.navigateTo({
url,
animationDuration: 300,
fail: (error1) => {
uni.switchTab({
url,
animationDuration: 300,
fail: (error2) => {
console.error(error1,error2);
}
})
}
})
}
uniIm.toChat({conversation_id})
}
}
}
...
...
pages/group/members.nvue
浏览文件 @
83221940
...
...
@@ -662,16 +662,12 @@
},
toChat(user_id) {
if (this.canPrivateChat) {
if (uniIm.isWidescreen) {
uni.$emit('uni-im-toChat', {
user_id
})
} else {
uni.navigateTo({
url: '/uni_modules/uni-im/pages/chat/chat?user_id=' + user_id,
animationDuration: 300
})
uniIm.toChat({
user_id,
source:{
group_id: this.conversation.group_id
}
})
}
},
onClickShowAllMenber() {
...
...
sdk/ext/index.js
浏览文件 @
83221940
// 导入当前目录下的模块再导出
import
{
init
as
indexDB
}
from
'
./indexDB
'
import
MsgManager
from
'
./MsgManager
'
import
$state
from
'
@/uni_modules/uni-im/sdk/state/index.js
'
;
export
default
{
toChat
(
param
)
{
console
.
error
(
'
toChat
'
,
param
,
$state
)
if
(
$state
.
isWidescreen
)
{
uni
.
$emit
(
'
uni-im-toChat
'
,
param
)
}
else
{
let
url
=
'
/uni_modules/uni-im/pages/chat/chat?user_id=
'
+
user_id
if
(
param
.
source
)
{
url
+=
'
&source=
'
+
decodeURIComponent
(
JSON
.
stringify
(
param
.
source
))
}
uni
.
navigateTo
({
url
,
animationDuration
:
300
})
}
},
}
\ No newline at end of file
sdk/index.js
浏览文件 @
83221940
...
...
@@ -2,8 +2,9 @@ import init from './init/index.js';
import
methods
from
'
./methods/index.js
'
;
import
state
from
'
./state/index.js
'
;
import
utils
from
'
./utils/index.js
'
;
import
ext
from
'
./ext/index.js
'
;
export
default
utils
.
deepAssign
(
state
,
methods
,{
init
,
utils
},
{
const
uniIm
=
utils
.
deepAssign
(
state
,
methods
,{
init
,
utils
},
ext
,
{
mapState
(
keys
=
[])
{
let
obj
=
{}
keys
.
forEach
((
key
)
=>
{
...
...
@@ -21,3 +22,5 @@ export default utils.deepAssign(state,methods,{init,utils}, {
return
obj
}
})
export
default
uniIm
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录