diff --git a/pages/im/group/info.vue b/pages/im/group/info.vue index 2ca4871..9da3ed2 100644 --- a/pages/im/group/info.vue +++ b/pages/im/group/info.vue @@ -2,8 +2,10 @@ - - + + + {{ item.name }} @@ -57,6 +59,10 @@ + + + @@ -90,7 +96,24 @@ qrContent: 'JOINGROUP|', joinType: '', joinTypeMap: [], - showActions: false + showActions: false, + showUserAction: false, + userActionMap: [{ + key: 0, + name: '移除成员', + disabled: false + }, { + key: 1, + name: '设置管理', + disabled: true + }, + { + key: 2, + name: '转移群主', + disabled: true + } + ], + currentUser: {} } }, onLoad(e) { @@ -132,6 +155,7 @@ return item.key == res.join_type })[0].name }).catch(err => { + console.log('getGroupInfo ERR', err); uni.showToast({ icon: 'none', title: '群不存在' @@ -268,7 +292,7 @@ item.disabled = false } return item - }) + }) this.initData() this.joinType = e.name this.showActions = false @@ -332,6 +356,30 @@ } } }) + }, + showUserActionSheet(item) { + this.currentUser = item + // 只有管理员以上才会弹窗 + if (this.group.is_admin) { + if (this.group.is_owner) { + this.userActionMap.map((item) => { + item.disabled = false + return item + }) + } + this.showUserAction = true + } + }, + hideUserAction() { + this.currentUser = {} + this.showUserAction = false + }, + handleUserAction(e) { + uni.showToast({ + icon: 'none', + title: e.name + }) + console.log(e); } } }