admin revoke
This commit is contained in:
@@ -156,12 +156,13 @@
|
||||
if (this.storeIsSyncing) {
|
||||
return;
|
||||
}
|
||||
console.log(data);
|
||||
data.forEach(this.handleNewMessage);
|
||||
});
|
||||
|
||||
//好友个人信息(包括备注)改变时会收到此回调。
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnFriendInfoChanged,({data}) => {
|
||||
console.log('friendInfoChangeHandler',data);
|
||||
//console.log('friendInfoChangeHandler',data);
|
||||
uni.$emit(IMSDK.IMEvents.OnFriendInfoChanged, {data});
|
||||
this.updateFriendInfo({friendInfo: data,});
|
||||
});
|
||||
@@ -276,32 +277,46 @@
|
||||
//群组被解散时,该群所有群成员会收到此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnGroupDismissed,({ data })=>{});
|
||||
//群成员增加(如用户被邀请进群),其他群成员会收到此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onGroupMemberAdded,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnGroupMemberAdded,({ data })=>{});
|
||||
//群成员增加(如用户被邀请进群),群成员减少(如群成员退群), 其他群成员会收到此回调。。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onGroupMemberDeleted,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnGroupMemberDeleted,({ data })=>{});
|
||||
const deleteLocalMsg = (clientMsgID)=>{
|
||||
let list = this.storeHistoryMessageList;
|
||||
//console.log(data);
|
||||
list = list.filter((item)=>{
|
||||
return item.clientMsgID != clientMsgID;
|
||||
})
|
||||
this.$store.commit('message/SET_HISTORY_MESSAGE_LIST',list);
|
||||
}
|
||||
//收到的消息被撤回或自己发出的消息被撤回时,会收到此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onNewRecvMessageRevoked,({ data })=>{});
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnNewRecvMessageRevoked,({data})=>{
|
||||
//console.log('onNewRecvMessageRevoked',res);
|
||||
deleteLocalMsg(data.clientMsgID);
|
||||
});
|
||||
//自己发出的单聊消息被对方标记为已读后,消息发送者会收到此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onRecvC2CReadReceipt,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnRecvC2CReadReceipt,({ data })=>{});
|
||||
//自己发出的群聊消息被群成员标记为已读后,消息发送者和标记者均会收到此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onRecvGroupReadReceipt,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnRecvGroupReadReceipt,({ data })=>{});
|
||||
//当应用在后台运行,接收到新消息时,会收到该回调,回调中只会携带一条消息。
|
||||
//设置了批量消息监听setBatchMsgListener时,此回调不会触发。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onRecvOfflineNewMessage,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessage,({ data })=>{});
|
||||
//当应用在后台运行,接收到新消息时,会收到该回调,回调中可能会携带多条消息。
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessages,({data})=>{
|
||||
data.forEach(this.handleOfflineNewMessages);
|
||||
});
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnMsgDeleted,({data})=>{
|
||||
deleteLocalMsg(data.clientMsgID)
|
||||
});
|
||||
//已订阅用户的在线状态发生变化时,会触发此回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onUserStatusChanged,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnUserStatusChanged,({ data })=>{});
|
||||
//建立WebSocket连接失败返回后,触发此回调
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onConnectFailed,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnConnectFailed,({ data })=>{});
|
||||
//建立WebSocket连接成功返回后,触发此回调
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onConnectSuccess,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnConnectSuccess,({ data })=>{});
|
||||
//建立WebSocket连接中,触发此回调
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onConnecting,({ data })=>{});
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.OnConnecting,({ data })=>{});
|
||||
//正在输入状态回调。
|
||||
//IMSDK.subscribe(IMSDK.IMEvents.onInputStatusChanged,({ data })=>{});
|
||||
//IMSDK.subscribe('onInputStatusChanged',({ data })=>{});
|
||||
// conversation
|
||||
const totalUnreadCountChangedHandler = ({data}) => {
|
||||
if (this.storeIsSyncing) {
|
||||
@@ -382,7 +397,7 @@
|
||||
//console.log(status);
|
||||
}while(status == -1001);
|
||||
if (status === 3) {
|
||||
console.log('初始化status === 3失败!');
|
||||
console.log('初始化,已经登录!');
|
||||
_this.initStore();
|
||||
return;
|
||||
}
|
||||
@@ -498,7 +513,7 @@
|
||||
_this.checkUpdate();
|
||||
},
|
||||
fail(e){
|
||||
console.log(e);
|
||||
//console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<u-avatar @longpress="longpress" @click="click" @onError="errorHandle" :src="cachesrc" :text="avatarText"
|
||||
bg-color="#cdcdcd" :defaultUrl="getDdefaultUrl" :shape="shape" :size="size" mode="aspectFill" font-size="14">
|
||||
bg-color="#cdcdcd" :defaultUrl="getDefaultUrl" :shape="shape" :size="size" mode="aspectFill" font-size="14">
|
||||
</u-avatar>
|
||||
</template>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getDdefaultUrl() {
|
||||
getDefaultUrl() {
|
||||
return this.isGroup ? defaultGroupIcon : defaultUserIcon;
|
||||
},
|
||||
},
|
||||
@@ -58,12 +58,10 @@
|
||||
methods: {
|
||||
init(nv){
|
||||
const _this = this;
|
||||
//console.log(nv);
|
||||
if (nv) {
|
||||
util.cacheFile(util.cdn(nv),'avatar').then(res=>{
|
||||
_this.avatarText=""
|
||||
_this.cachesrc = res;
|
||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem(res);
|
||||
//console.log(_this.cachesrc);
|
||||
});
|
||||
return ;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<view v-if="item.roleLevel === 100" class="user_role">群主</view>
|
||||
<view v-else-if="item.roleLevel === 60" class="user_role admin_role">管理员<u-icon v-if="item.muteEndTime>0" size="24" name="volume-off"></u-icon></view>
|
||||
<view v-else class="user_role"><u-icon v-if="item.muteEndTime>0" size="24" name="volume-off"></u-icon></view>
|
||||
<!-- <view class="bottom_line" /> -->
|
||||
<view class="bottom_line" />
|
||||
</view>
|
||||
|
||||
<slot name="action"></slot>
|
||||
@@ -57,6 +57,9 @@
|
||||
}
|
||||
},
|
||||
longtap(){
|
||||
if(this.checkVisible){
|
||||
return ;
|
||||
}
|
||||
this.$emit("longtapEvent", this.item);
|
||||
}
|
||||
},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
"name" : "瞬聊",
|
||||
"appid" : "__UNI__E41111F",
|
||||
"description" : "一款即时聊天软件",
|
||||
"versionName" : "3.3.7",
|
||||
"versionCode" : 337,
|
||||
"versionName" : "3.3.9",
|
||||
"versionCode" : 339,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"bounce" : "none",
|
||||
|
||||
@@ -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:"",
|
||||
|
||||
@@ -56,7 +56,7 @@ const actions = {
|
||||
count: 500,
|
||||
},
|
||||
);
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
commit("SET_CONVERSATION_LIST", [
|
||||
...(isFirstPage ? [] : state.conversationList),
|
||||
...data,
|
||||
|
||||
+3
-3
@@ -21,7 +21,7 @@ export const getCurrentNo = function() {
|
||||
}
|
||||
// 发起ajax请求获取服务端版本号
|
||||
export const getServerNo = function(version,isPrompt = false) {
|
||||
console.log(isPrompt)
|
||||
//console.log(isPrompt)
|
||||
return new Promise((resolve,reject)=>{
|
||||
let httpData = {
|
||||
platform:platform,
|
||||
@@ -795,7 +795,7 @@ function dopdate(res){
|
||||
}
|
||||
}
|
||||
export default function(isPrompt = false) {
|
||||
console.log(isPrompt)
|
||||
//console.log(isPrompt)
|
||||
getCurrentNo().then((version) => {
|
||||
//console.log('getCurrentNo',version);
|
||||
getServerNo(version,isPrompt).then(res=> {
|
||||
@@ -808,7 +808,7 @@ export default function(isPrompt = false) {
|
||||
});
|
||||
}
|
||||
}).catch(e=>{
|
||||
console.log(e);
|
||||
//console.log(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
+3
-2
@@ -180,11 +180,12 @@ export const parseMessageByType = (pmsg) => {
|
||||
case MessageType.GroupMemberMuted:
|
||||
//群成员禁言通知
|
||||
const groupMemberMutedDetail = JSON.parse(pmsg.notificationElem.detail);
|
||||
return `${getName(groupMemberMutedDetail.opUser)}取消了${getName(groupMemberMutedDetail.mutedUser)}的禁言`;
|
||||
return `${getName(groupMemberMutedDetail.opUser)}禁言了${getName(groupMemberMutedDetail.mutedUser)}`;
|
||||
|
||||
case MessageType.GroupMemberCancelMuted:
|
||||
//取消群成员禁言通知
|
||||
const groupMemberCancelMutedDetail = JSON.parse(pmsg.notificationElem.detail);
|
||||
return `${getName(groupMemberCancelMutedDetail.opUser)}禁言了${getName(groupMemberCancelMutedDetail.mutedUser)}`;
|
||||
return `${getName(groupMemberCancelMutedDetail.opUser)}取消了${getName(groupMemberCancelMutedDetail.mutedUser)}的禁言`;
|
||||
case MessageType.GroupMuted:
|
||||
//群禁言通知
|
||||
const groupGroupMutedDetail = JSON.parse(pmsg.notificationElem.detail);
|
||||
|
||||
@@ -246,6 +246,7 @@ const get_absolute_path = (fn)=>{
|
||||
}
|
||||
const pendingDownloads = new Map();
|
||||
const cacheFile = (url, saveDir,progressCallback) => {
|
||||
//console.log(url);
|
||||
// #ifndef APP
|
||||
return new Promise(async (resolve, reject) => {
|
||||
resolve(url);
|
||||
|
||||
Reference in New Issue
Block a user