admin revoke

This commit is contained in:
commie
2026-01-12 18:07:21 +08:00
parent e39c06526d
commit dd16348558
13 changed files with 123 additions and 60 deletions
@@ -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,
+13 -14
View File
@@ -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: