From 2122a0b07933884f08a748c4560a223ca127f477 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 14 Feb 2022 17:59:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E6=88=90=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/im/group/info.vue | 56 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) 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); } } }