Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-im
提交
44b14031
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看板
提交
44b14031
编写于
11月 21, 2024
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新 toolbar 从 chat 页面中抽离出来
上级
639ac025
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
143 addition
and
76 deletion
+143
-76
pages/chat/chat.vue
pages/chat/chat.vue
+18
-76
pages/chat/toolbar.vue
pages/chat/toolbar.vue
+125
-0
未找到文件。
pages/chat/chat.vue
浏览文件 @
44b14031
...
...
@@ -46,39 +46,7 @@
</
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>
<toolbar
v-model=
"chooseMoreMsg"
@
shareMsg=
"shareMsg(checkedMsgList,$event)"
></toolbar>
</view>
<msg-popup-control
ref=
"msg-popup-control"
@
answer=
"setAnswerMsg"
@
intoTopic=
"intoTopic"
@
share=
"shareMsg"
@
chooseMore=
"chooseMoreMsg = true;checkedMsgList = $event"
></msg-popup-control>
...
...
@@ -86,10 +54,7 @@
<uni-im-member-list
ref=
"member-list"
:conversationId=
"conversation.id"
></uni-im-member-list>
<!-- #ifdef H5 -->
<uni-im-share-msg
id=
"uni-im-share-msg"
ref=
"share-msg"
></uni-im-share-msg>
<!-- #endif -->
<uni-im-share-msg
v-if=
"isWidescreen"
id=
"uni-im-share-msg"
ref=
"share-msg"
></uni-im-share-msg>
<view
style=
"position: fixed;top: 200px;left: 0;background-color: #FFFFFF;z-index: 9999;"
>
<!-- keyboardMaxHeight:{{keyboardMaxHeight}}
...
...
@@ -106,7 +71,10 @@
<
script
>
import
uniIm
from
'
@/uni_modules/uni-im/sdk/index.js
'
;
import
msgPopupControl
from
'
@/uni_modules/uni-im/components/uni-im-msg/popup-control.vue
'
;
import
uniImShareMsg
from
'
@/uni_modules/uni-im/pages/share-msg/share-msg.vue
'
;
import
toolbar
from
'
./toolbar.vue
'
;
import
{
markRaw
}
from
"
vue
"
;
/**
* chat 组件,渲染一个完整的会话,包括头部、消息列表、输入区。
...
...
@@ -118,6 +86,8 @@
export
default
{
components
:
{
msgPopupControl
,
uniImShareMsg
,
toolbar
},
data
()
{
return
{
...
...
@@ -858,15 +828,17 @@
this.$refs['msg-popup-control'].show({isSelf,msg,msgContentDomInfo})
},
shareMsg(msgList,merge = false) {
this.$refs['share-msg'].open(msgList,merge)
this.chooseMoreMsg = false
},
toolBarNext(){
uni.showToast({
title: '暂不支持',
icon: 'none',
duration: 2000
});
console.error('msgList',msgList)
if (this.isWidescreen) {
this.$refs['share-msg'].open(msgList,merge)
} else {
uni.navigateTo({
url: '/uni_modules/uni-im/pages/share-msg/share-msg',
success: res => {
res.eventChannel.emit('shareMsg', [msgList,merge])
}
})
}
this.chooseMoreMsg = false
},
tapUnreadCount() {
...
...
@@ -1006,35 +978,5 @@ page {
margin-top
:
3px
;
}
/* #endif */
.toolbar
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
#ededed
;
border-top
:
solid
1px
#ededed
;
flex-direction
:
row
;
justify-content
:
space-around
;
align-items
:
center
;
z-index
:
9
;
}
.toolbar
.item
{
align-items
:
center
;
}
/* #ifdef H5 */
.
toolbar
:
:
v-deep
.
uni-icons
{
cursor
:
pointer
;
}
/* #endif */
.toolbar
.icons-box
{
background-color
:
#fff
;
justify-content
:
center
;
width
:
60px
;
height
:
60px
;
border-radius
:
100px
;
margin-bottom
:
10px
;
}
}
</
style
>
\ No newline at end of file
pages/chat/toolbar.vue
0 → 100644
浏览文件 @
44b14031
<
template
>
<view
v-if=
"modelValue"
class=
"toolbar"
>
<view
class=
"item"
@
click=
"shareMsg(false)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"20"
type=
"redo"
></uni-icons>
</view>
<text
class=
"title"
>
逐条转发
</text>
</view>
<view
class=
"item"
@
click=
"shareMsg(true)"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"20"
type=
"paperplane"
></uni-icons>
</view>
<text
class=
"title"
>
合并转发
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"20"
type=
"folder-add"
></uni-icons>
</view>
<text
class=
"title"
>
收藏
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"20"
type=
"download"
></uni-icons>
</view>
<text
class=
"title"
>
下载保存
</text>
</view>
<view
class=
"item"
@
click=
"toolBarNext"
>
<view
class=
"icons-box"
>
<uni-icons
size=
"20"
type=
"trash"
></uni-icons>
</view>
<text
class=
"title"
>
删除
</text>
</view>
<uni-icons
class=
"close-icon"
@
click=
"close"
color=
"#999"
size=
"35"
type=
"closeempty"
></uni-icons>
</view>
</
template
>
<
script
>
export
default
{
name
:
'
UniImToolBar
'
,
emits
:
[
'
shareMsg
'
,
'
toolBarNext
'
,
'
update:modelValue
'
],
props
:
{
checkedMsgList
:
{
type
:
Array
,
default
:
()
=>
[]
},
modelValue
:
{
type
:
Boolean
,
default
:
false
,
}
},
data
()
{
return
{
}
},
methods
:
{
shareMsg
(
merge
)
{
this
.
$emit
(
'
shareMsg
'
,
merge
)
},
close
()
{
this
.
$emit
(
'
update:modelValue
'
,
false
)
},
toolBarNext
(){
uni
.
showToast
({
title
:
'
暂不支持
'
,
icon
:
'
none
'
,
duration
:
2000
});
this
.
chooseMoreMsg
=
false
},
}
}
</
script
>
<
style
lang=
"scss"
>
.toolbar
{
background-color
:
#FFF
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
){
background-color
:
#ededed
;
}
/* #endif */
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
border-top
:
solid
1px
#ededed
;
flex-direction
:
row
;
justify-content
:
space-around
;
align-items
:
center
;
z-index
:
9
;
.item
{
align-items
:
center
;
/* #ifdef H5 */
cursor
:
pointer
;
/* #endif */
.icons-box
{
background-color
:
#fff
;
justify-content
:
center
;
align-items
:
center
;
border-radius
:
100px
;
width
:
30px
;
height
:
30px
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
){
width
:
60px
;
height
:
60px
;
margin-bottom
:
10px
;
.uni-icons
{
font-size
:
35px
!
important
;
}
}
/* #endif */
}
.title
{
font-size
:
8px
;
/* #ifdef H5 */
@media
screen
and
(
min-device-width
:
960px
){
font-size
:
14px
;
}
/* #endif */
}
}
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录