群设置优化

This commit is contained in:
2022-02-14 17:20:15 +08:00
parent 7c89265fbe
commit a35c96ea0a

View File

@@ -6,7 +6,7 @@
<u-avatar size="44" shape="square" :src="item.portraitUrl"></u-avatar> <u-avatar size="44" shape="square" :src="item.portraitUrl"></u-avatar>
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
</view> </view>
<view class="user"> <view class="user" v-if="group.can_invite">
<u-avatar @click="inviteUser" size="44" shape="square" icon="plus" bg-color="#eeeeee" <u-avatar @click="inviteUser" size="44" shape="square" icon="plus" bg-color="#eeeeee"
color="#999999"></u-avatar> color="#999999"></u-avatar>
<view class="name">邀请好友</view> <view class="name">邀请好友</view>
@@ -80,6 +80,7 @@
conversationType: 3, conversationType: 3,
announcement: '', announcement: '',
users: [], users: [],
members: 0,
status: false, status: false,
isTop: false, isTop: false,
loaded: false, loaded: false,
@@ -120,16 +121,16 @@
this.group = res.group this.group = res.group
this.groupName = res.group.name this.groupName = res.group.name
this.announcement = res.announcement this.announcement = res.announcement
this.users = res.users this.users = res.users
this.members = res.members this.members = res.members
this.loaded = true this.loaded = true
this.joinTypeMap = res.join_type_map.map(item => { this.joinTypeMap = res.join_type_map.map(item => {
if (item.key == res.join_type) { item.disabled = item.key == res.join_type
item.disabled = true
}
return item return item
}) })
this.joinType = res.join_type_map.filter(item => item.key == res.join_type)[0].name this.joinType = res.join_type_map.filter(item => {
return item.key == res.join_type
})[0].name
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@@ -154,16 +155,16 @@
}) })
}) })
}, },
toUser(item) { toUser(item) {
if (item.targetId == this.$store.getters.sender.userId) { if (item.targetId == this.$store.getters.sender.userId) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/im/friends/mine?targetId=' + item.targetId url: '/pages/im/friends/mine?targetId=' + item.targetId
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/im/friends/info?targetId=' + item.targetId url: '/pages/im/friends/info?targetId=' + item.targetId
}) })
} }
}, },
inviteUser() { inviteUser() {
@@ -183,7 +184,6 @@
}, },
onGroupName() { onGroupName() {
this.modalShow = true this.modalShow = true
console.log(this.$refs.groupNameRef);
}, },
onChangeGroupName() { onChangeGroupName() {
if (this.groupName != this.group.name) { if (this.groupName != this.group.name) {
@@ -208,7 +208,7 @@
this.groupName = this.group.name this.groupName = this.group.name
}, },
// 修改群头像 // 修改群头像
onGroupAvatar() { onGroupAvatar() {
console.log('onGroupAvatar'); console.log('onGroupAvatar');
uni.chooseImage({ uni.chooseImage({
count: 1, count: 1,
@@ -268,7 +268,8 @@
item.disabled = false item.disabled = false
} }
return item return item
}) })
this.initData()
this.joinType = e.name this.joinType = e.name
this.showActions = false this.showActions = false
}).catch(err => { }).catch(err => {