群组信息的页面间联动

This commit is contained in:
2022-02-14 10:38:44 +08:00
parent 5f159a05b7
commit ed9fe0ff9c
8 changed files with 185 additions and 64 deletions

View File

@@ -38,11 +38,15 @@
this.isAdmin = res.group.is_admin
})
this.initData()
uni.$on('groupAnnouncementCreated', this.initData)
},
onUnload() {
uni.$off('groupAnnouncementCreated')
},
onNavigationBarButtonTap() {
if (this.isAdmin) {
uni.navigateTo({
url: '/pages/im/group/announceCreate?targetId=' + this.targetId
url: '/pages/im/group/announceCreate?targetId=' + this.targetId
})
} else {
uni.showToast({
@@ -55,7 +59,6 @@
initData() {
getGroupAnnouncements(this.targetId).then(res => {
this.announcements = res
console.log(res);
this.loading = false
})
},