资料修改的事件通知

This commit is contained in:
2022-02-23 16:06:41 +08:00
parent c840e9ee6b
commit a5bd5a898c
4 changed files with 55 additions and 17 deletions

View File

@@ -1,6 +1,13 @@
// 监听群解散的消息,直接跳转到会话列表页面
const onGroupDismiss = {
data() {
return {
currentTargetId: ''
}
},
onLoad(e) {
this.currentTargetId = e.targetId
uni.$once('onGroupDismiss_' + e.targetId, () => {
uni.showToast({
icon: 'none',
@@ -10,6 +17,19 @@ const onGroupDismiss = {
url: '/pages/im/index'
})
})
uni.$once('onGroupRemoveYou_' + e.targetId, () => {
uni.showToast({
icon: 'none',
title: '您已被移出群聊'
})
uni.switchTab({
url: '/pages/im/index'
})
})
},
onUnload() {
uni.$off('onGroupDismiss_' + this.currentTargetId)
uni.$off('onGroupRemoveYou_' + this.currentTargetId)
}
}