admin revoke
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<view v-if="storeCurrentMemberInGroup.muteEndTime===0">
|
||||
<view v-if="isMute">
|
||||
<view class="forbidden_footer">
|
||||
<view class="mute_tip" v-if="storeCurrentGroup.status === 3">全群禁言中</view>
|
||||
<view class="mute_tip" v-else>您被禁言至{{date(storeCurrentMemberInGroup.muteEndTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="chat_footer">
|
||||
<!-- 语音信息 -->
|
||||
<image class="action_btn" v-show="inputType == 'keyboard'" @click.prevent="swtichInputType('record')" mode="heightFix" src="@/static/images/chating_footer_audio.png" alt="" srcset="" />
|
||||
@@ -43,11 +49,7 @@
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="forbidden_footer">
|
||||
<view class="mute_tip">您被禁言至{{date(storeCurrentMemberInGroup.muteEndTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -112,6 +114,18 @@
|
||||
hasContent() {
|
||||
return html2Text(this.inputHtml) !== "";
|
||||
},
|
||||
isAdminOrOwner(){
|
||||
return this.storeCurrentMemberInGroup && this.storeCurrentMemberInGroup?.roleLevel>20;
|
||||
},
|
||||
isMute(){
|
||||
if(this.storeCurrentGroup && this.storeCurrentGroup.status === 3 && !this.isAdminOrOwner){
|
||||
return true;
|
||||
}
|
||||
if (this.storeCurrentMemberInGroup && this.storeCurrentMemberInGroup?.muteEndTime>0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
footerOutsideFlag(newVal) {
|
||||
@@ -137,7 +151,7 @@
|
||||
IMSDK.uuid(),
|
||||
text
|
||||
);
|
||||
console.log(message);
|
||||
//console.log(message);
|
||||
return message;
|
||||
},
|
||||
async sendTextMessage() {
|
||||
@@ -158,7 +172,7 @@
|
||||
offlinePushInfo,
|
||||
})
|
||||
.then(({data}) => {
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
this.updateOneMessage({
|
||||
message: data,
|
||||
isSuccess: true,
|
||||
|
||||
@@ -104,17 +104,17 @@
|
||||
if (options?.back2Tab) {
|
||||
this.back2Tab = JSON.parse(options.back2Tab);
|
||||
}
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnMsgDeleted,({data})=>{
|
||||
let list = this.storeHistoryMessageList;
|
||||
//console.log(data);
|
||||
list = list.filter((item)=>{
|
||||
return item.serverMsgID != data.serverMsgID;
|
||||
})
|
||||
this.$store.commit('message/SET_HISTORY_MESSAGE_LIST',list);
|
||||
});
|
||||
// IMSDK.subscribe(IMSDK.IMEvents.OnMsgDeleted,({data})=>{
|
||||
// let list = this.storeHistoryMessageList;
|
||||
// //console.log(data);
|
||||
// list = list.filter((item)=>{
|
||||
// return item.serverMsgID != data.serverMsgID;
|
||||
// })
|
||||
// this.$store.commit('message/SET_HISTORY_MESSAGE_LIST',list);
|
||||
// });
|
||||
},
|
||||
onUnload() {
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnMsgDeleted);
|
||||
//IMSDK.unsubscribe(IMSDK.IMEvents.OnMsgDeleted);
|
||||
//console.log("unload");
|
||||
this.disposePageListener();
|
||||
markConversationAsRead({...this.$store.getters.storeCurrentConversation,},true);
|
||||
@@ -250,7 +250,7 @@
|
||||
if(e.type == 'deleteServerMsg'){
|
||||
method = IMSDK.IMMethods.RevokeMessage
|
||||
}
|
||||
console.log(method);
|
||||
//console.log(method);
|
||||
let deleteMsgs = [];
|
||||
if (!data) {
|
||||
deleteMsgs = [...this.selectItems];
|
||||
@@ -263,10 +263,9 @@
|
||||
conversationID: _this.storeCurrentConversation.conversationID,
|
||||
clientMsgID: element.clientMsgID
|
||||
});
|
||||
console.log(a);
|
||||
//console.log(a);
|
||||
}
|
||||
this.selectItems = [];
|
||||
this.$refs.chatingListRef.loadMessageList();
|
||||
return;
|
||||
}
|
||||
if (e.type == 'forward') {
|
||||
@@ -348,7 +347,7 @@
|
||||
menu.push('撤回')
|
||||
}
|
||||
if(_this.isAdmin | _this.isOwner){
|
||||
menu.push('删除(管理员功能)')
|
||||
menu.push('撤回(管理员功能)')
|
||||
}
|
||||
uni.showActionSheet({
|
||||
itemList: menu,
|
||||
@@ -389,7 +388,7 @@
|
||||
case "删除":
|
||||
_this.onUserMessageEvent({type: 'deleteMsg'}, data);
|
||||
break;
|
||||
case "删除(管理员功能)":
|
||||
case "撤回(管理员功能)":
|
||||
_this.onUserMessageEvent({type: 'deleteServerMsg'}, data);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
},
|
||||
methods: {
|
||||
clickConversationItem() {
|
||||
//console.log(this.source);
|
||||
console.log(this.source);
|
||||
prepareConversationState(this.source);
|
||||
},
|
||||
longtapConversationItem() {
|
||||
|
||||
@@ -196,7 +196,6 @@
|
||||
.conversation_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.conversation_search {
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
/>
|
||||
|
||||
<view class="search_bar_wrap">
|
||||
<u-search disabled class="search_bar" shape="square" placeholder="搜索" :showAction="false"
|
||||
<u-search class="search_bar" shape="square" placeholder="搜索" :showAction="false"
|
||||
v-model="keyword" />
|
||||
</view>
|
||||
|
||||
<u-list class="member_list" @scrolltolower="loadMore" lowerThreshold="100" height="1">
|
||||
<u-list-item v-for="member in groupMemberList" :key="member.userID">
|
||||
<u-list-item v-for="member in filterGroupMemberList" :key="member.userID">
|
||||
<user-item
|
||||
@itemClick="userClick"
|
||||
@updateCheck="updateCheck"
|
||||
@@ -73,6 +73,7 @@
|
||||
showConfirmModal: false,
|
||||
comfirmLoading: false,
|
||||
groupMemberList: [],
|
||||
filterGroupMemberList:[],
|
||||
choosedMemberIDList: [],
|
||||
choosedTransferMember: {},
|
||||
type: GroupMemberListTypes.Preview,
|
||||
@@ -139,6 +140,15 @@
|
||||
groupMemberLength() {
|
||||
return this.$store.getters.storeCurrentGroup?.memberCount ?? 0;
|
||||
},
|
||||
|
||||
},
|
||||
watch:{
|
||||
keyword(v){
|
||||
this.filterGroupMemberList = this.getFilterGroupMemberList();
|
||||
},
|
||||
groupMemberList(v){
|
||||
this.filterGroupMemberList = this.getFilterGroupMemberList();
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
@@ -173,6 +183,27 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
getFilterGroupMemberList(){
|
||||
if(this.keyword){
|
||||
return this.groupMemberList.filter((item)=>{
|
||||
const kw = this.keyword.toLowerCase();
|
||||
if(item.nickname && item.nickname.toLowerCase().includes(kw)){
|
||||
return true;
|
||||
}
|
||||
if(item.showName && item.showName.toLowerCase().includes(kw)){
|
||||
return true;
|
||||
}
|
||||
if(item.remark && item.remark.toLowerCase().includes(kw)){
|
||||
return true;
|
||||
}
|
||||
if(item.groupName && item.groupName.toLowerCase().includes(kw)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return this.groupMemberList;
|
||||
},
|
||||
async pageClick(e) {
|
||||
if (!moreActionArea) {
|
||||
moreActionArea = await this.getEl(".more_container");
|
||||
@@ -290,6 +321,7 @@
|
||||
data
|
||||
}) => {
|
||||
this.groupMemberList = [...this.groupMemberList, ...data];
|
||||
this.filterGroupMemberList = this.getFilterGroupMemberList();
|
||||
this.loadState.hasMore = data.length === 500;
|
||||
})
|
||||
.finally(() => (this.loadState.loading = false));
|
||||
@@ -302,7 +334,7 @@
|
||||
if(!this.isOwner&&!this.isAdmin){
|
||||
return ;
|
||||
}
|
||||
if(this.$store.getters.storeCurrentMemberInGroup.roleLevel == member.roleLevel ){
|
||||
if(this.$store.getters.storeCurrentMemberInGroup.roleLevel <= member.roleLevel ){
|
||||
return ;
|
||||
}
|
||||
let itemList = [];
|
||||
@@ -316,8 +348,9 @@
|
||||
uni.showActionSheet({
|
||||
itemList:itemList,
|
||||
async success({tapIndex}) {
|
||||
if(tapIndex == 0){
|
||||
let roleId = itemList[tapIndex]=='设为管理员' ? GroupMemberRole.Admin : GroupMemberRole.Normal;
|
||||
const label = itemList[tapIndex];
|
||||
if(['设为管理员','取消管理员'].includes(label)){
|
||||
let roleId = label=='设为管理员' ? GroupMemberRole.Admin : GroupMemberRole.Normal;
|
||||
|
||||
await IMSDK.asyncApi(IMSDK.IMMethods.SetGroupMemberInfo,IMSDK.uuid(),{
|
||||
roleLevel:roleId,
|
||||
@@ -332,21 +365,21 @@
|
||||
});
|
||||
return ;
|
||||
}
|
||||
if(tapIndex == 1){
|
||||
if(itemList[tapIndex]=='取消禁言'){
|
||||
if(['取消禁言','设置禁言'].includes(label)){
|
||||
if(label == '取消禁言'){
|
||||
_this.setMute(member.userID,0)
|
||||
return ;
|
||||
}
|
||||
uni.showActionSheet({
|
||||
itemList:['2小时','8小时','1天','3天','7天','15天','30天','1年'],
|
||||
async success(res){
|
||||
success(res){
|
||||
const secs = [3600*2,3600*8,3600*24,3600*72,3600*24*7,3600*24*15,3600*24*30,3600*24*365];
|
||||
_this.setMute(member.userID,secs[res.tapIndex])
|
||||
}
|
||||
});
|
||||
return ;
|
||||
}
|
||||
if(tapIndex == 2){
|
||||
if(label=="踢出群聊"){
|
||||
await IMSDK.asyncApi(IMSDK.IMMethods.KickGroupMember,IMSDK.uuid(),{
|
||||
groupID:_this.groupID,
|
||||
reason:"",
|
||||
|
||||
Reference in New Issue
Block a user