Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-im
提交
5decbed4
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看板
提交
5decbed4
编写于
4月 23, 2024
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TODO:把用户列表独立为一个页面。存在冗余未清理待续
上级
1fe0d1a5
变更
2
展开全部
显示空白变更内容
内联
并排
Showing
2 changed file
with
1694 addition
and
927 deletion
+1694
-927
pages/group/info.nvue
pages/group/info.nvue
+824
-927
pages/group/members.nvue
pages/group/members.nvue
+870
-0
未找到文件。
pages/group/info.nvue
浏览文件 @
5decbed4
<template>
<view class="group-info-box">
<uni-search-bar v-model="keyword" class="search-bar" radius="5" placeholder="输入昵称搜索" clearButton="auto"
cancelButton="none"></uni-search-bar>
<view class="user-list" v-if="!leave_group">
<!-- #ifndef APP-NVUE -->
<view class="user-list-container">
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<scroll-view :scroll-y="true" class="user-list-container">
<!-- #endif -->
<view class="invite-box" v-if="isAdmin">
<view class="invite">
<uni-icons @click="invite" color="#989898" size="20px" class="plusempty" type="plusempty">
</uni-icons>
</view>
<text class="nickname">邀请</text>
</view>
<template v-for="(member,index) in memberList" :key="index">
<view class="item" v-if="showAllMember || index < (isAdmin?9:10)" :title="member.users.nickname"
:class="{'pointer': canPrivateChat,'focus':member.focus}" @click="toChat(member.users._id)"
@longpress.prevent="openConversationMenu($event,index)"
@contextmenu.prevent="openConversationMenu($event,index)"
@mousemove="hoverUserId = member.users._id"
>
<image class="avatar"
:src="(member.users.avatar_file && member.users.avatar_file.url) ? member.users.avatar_file.url:'/uni_modules/uni-im/static/avatarUrl.png'"
mode="widthFix"></image>
<text class="nickname">{{member.users.nickname||'匿名用户'}}</text>
<text v-if="member.role.includes('admin')" class="group-admin">管</text>
<text v-if="!mute_all_members && member.mute_type" class="mute-type-1">已被禁言</text>
</view>
</template>
<!-- #ifndef APP-NVUE -->
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
</scroll-view>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<template v-if="memberList.length > 9">
<view class="more-users-bar">
<view v-if="!showAllMember" class="more-users-btn" @click="showAllMember = true">
<text style="cursor:pointer">展开更多</text>
<uni-icons color="#989898" size="20" type="bottom" />
</view>
<view v-else class="more-users-btn" @click="showAllMember = false">
<text style="cursor:pointer">收起</text>
<uni-icons color="#989898" size="20" type="top" />
</view>
<text style="flex:1"></text>
</view>
</template>
<!-- #endif -->
</view>
<uni-im-group-members v-if="conversation_id" :conversation_id="conversation_id"></uni-im-group-members>
<uni-list>
<uni-list-item v-if="!leave_group" title="消息免打扰" @switchChange="changeConversationMute"
:switchChecked="conversation.mute" :showSwitch="true"></uni-list-item>
...
...
@@ -95,14 +46,18 @@
:duration="2000" :before-close="true" :value="editorDefaultValue" @close="closePopupInfo"
@confirm="confirmPopupInfo"></uni-popup-dialog>
</uni-popup>
<
uni-im-contextmenu ref="uni-im-contextmenu"></uni-im-contextmenu>
<
!-- <uni-im-contextmenu ref="uni-im-contextmenu"></uni-im-contextmenu> -->
</view>
</template>
<script>
const db = uniCloud.database()
import uniIm from '@/uni_modules/uni-im/sdk/index.js';
import members from '@/uni_modules/uni-im/pages/group/members.nvue';
export default {
components: {
'uni-im-group-members':members
},
data() {
return {
conversation: {
...
...
@@ -129,6 +84,7 @@
mute_all_members: false,
// #ifdef APP-NVUE
showAllMember: true,
conversationId:'',
// #endif
// #ifndef APP-NVUE
showAllMember: false,
...
...
@@ -244,6 +200,7 @@
if (!e.conversation_id) {
throw new Error("会话id不能为空")
}
this.conversationId = e.conversation_id
this.load(e.conversation_id)
},
mounted() { //pc端以组件模式加载时逻辑
...
...
@@ -254,11 +211,12 @@
onShow() {
// console.log("this.conversation: ", this.conversation.group_member);
},
// 长按头像出现管理菜单
// onNavigationBarButtonTap(e) {
// if (e.index === 0) {}
// },
methods: {
navToMembers(conversationId){
uni.navigateTo({
url:"/uni_modules/uni-im/pages/group/members?conversation_id=" + conversationId
})
},
async load(conversation_id) {
this.conversation = await uniIm.conversation.get(conversation_id)
},
...
...
@@ -706,20 +664,6 @@
})
})
},
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
})
}
}
},
setMuteAllMembers(e) {
for (let user_id in this.conversation.group_member) {
const member = this.conversation.group_member[user_id]
...
...
@@ -841,23 +785,6 @@
height: 50px;
}
.invite-box {
align-items: center;
}
.invite {
width: 100rpx;
height: 100rpx;
margin: 5px 0;
justify-content: center;
border-radius: 10px;
background-color: #f5f5f5;
border: #9d9f9d solid 0.3px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.exitGroup {
margin: 10px 0;
background-color: #FFFFFF;
...
...
@@ -895,34 +822,4 @@
color: #666;
font-size: 14px;
}
.slot-code {
align-items: center;
flex-direction: row;
}
.group-code {
width: 50rpx;
height: 50rpx;
margin-left: 10rpx;
}
.more-users-bar {
margin: 5px 0;
flex: 1;
justify-content: center;
}
.more-users-btn {
flex-direction: row;
font-size: 14px;
justify-content: center;
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
}
.more-users-btn:hover {
color: #666;
}
</style>
\ No newline at end of file
pages/group/members.nvue
0 → 100644
浏览文件 @
5decbed4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录