群聊设置页面新增权限控制

This commit is contained in:
wangyifeng 2025-01-17 17:01:17 +08:00
parent 5c6f254114
commit 03c30c2945
2 changed files with 35 additions and 5 deletions

View File

@ -9,7 +9,13 @@
{{ props?.item?.value }} {{ props?.item?.value }}
</span> </span>
<img <img
v-if="props?.item?.hasPointer" v-if="
props?.item?.hasPointer &&
((props?.isManager &&
props?.item?.label === $t('chat.settings.groupName')) ||
(!props?.isManager &&
props?.item?.label !== $t('chat.settings.groupName')))
"
src="/src/static/image/chatSettings/pointer.png" src="/src/static/image/chatSettings/pointer.png"
/> />
<tm-switch <tm-switch
@ -48,6 +54,10 @@ const props = defineProps({
return {} return {}
}, },
}, },
isManager: {
type: Boolean,
default: false,
},
}) })
const emits = defineEmits(['toManagePage', 'changeSwitch']) const emits = defineEmits(['toManagePage', 'changeSwitch'])
const toManagePage = (item) => { const toManagePage = (item) => {

View File

@ -43,7 +43,11 @@
</span> </span>
</div> </div>
</div> </div>
<div class="base-info-edit" @click="toEditGroupInfoPage"> <div
class="base-info-edit"
@click="toEditGroupInfoPage"
v-if="groupParams?.groupInfo?.is_manager"
>
<img src="/src/static/image/chatSettings/edit-btn.png" /> <img src="/src/static/image/chatSettings/edit-btn.png" />
</div> </div>
</div> </div>
@ -72,6 +76,7 @@
<settingFormItem <settingFormItem
:item="item" :item="item"
@toManagePage="toManagePage" @toManagePage="toManagePage"
:isManager="groupParams?.groupInfo?.is_manager"
></settingFormItem> ></settingFormItem>
</div> </div>
</div> </div>
@ -103,7 +108,10 @@
></settingFormItem> ></settingFormItem>
</div> </div>
</div> </div>
<div class="chat-group-infos chat-settings-card"> <div
class="chat-group-infos chat-settings-card"
v-if="groupParams?.groupInfo?.is_manager"
>
<div <div
class="chat-group-infos-each" class="chat-group-infos-each"
v-for="(item, index) in state.chatManagement" v-for="(item, index) in state.chatManagement"
@ -121,12 +129,18 @@
{{ $t('chat.settings.clearChatRecord') }} {{ $t('chat.settings.clearChatRecord') }}
</span> </span>
</div> </div>
<div class="clear-chat-record-btn-each"> <div
class="clear-chat-record-btn-each"
v-if="groupParams?.groupInfo?.is_manager"
>
<span class="text-[32rpx] font-regular"> <span class="text-[32rpx] font-regular">
{{ $t('group.disband.btn') }} {{ $t('group.disband.btn') }}
</span> </span>
</div> </div>
<div class="clear-chat-record-btn-each"> <div
class="clear-chat-record-btn-each"
v-if="groupParams?.groupInfo?.is_manager"
>
<span class="text-[32rpx] font-regular"> <span class="text-[32rpx] font-regular">
{{ $t('group.quit.btn') }} {{ $t('group.quit.btn') }}
</span> </span>
@ -376,6 +390,9 @@ const toEditGroupInfoPage = () => {
// //
const toEditAvatarPage = () => { const toEditAvatarPage = () => {
if (!groupParams?.groupInfo?.is_manager) {
return
}
uni.navigateTo({ uni.navigateTo({
url: url:
'/pages/chatSettings/groupManage/editAvatar?groupAvatar=' + '/pages/chatSettings/groupManage/editAvatar?groupAvatar=' +
@ -388,6 +405,9 @@ const toManagePage = (label) => {
console.log(label) console.log(label)
if (label) { if (label) {
if (label === t('chat.settings.groupName')) { if (label === t('chat.settings.groupName')) {
if (!groupParams?.groupInfo?.is_manager) {
return
}
uni.navigateTo({ uni.navigateTo({
url: url:
'/pages/chatSettings/groupManage/editGroupName?groupAvatar=' + '/pages/chatSettings/groupManage/editGroupName?groupAvatar=' +