This commit is contained in:
bobobobo
2026-02-10 22:58:31 +08:00
parent 89b7566aa1
commit 9245fefc9a
8 changed files with 113 additions and 41 deletions

View File

@@ -277,6 +277,8 @@
const { connected: hostConnected } = useCoHostState(uni?.$liveID)
import ActivityInfo from './components/activity-info.vue'
import { LIVE_BUSINESS } from '@/constants/live-keys'
import { useAuthUser } from '../../composables/useAuthUser'
import { getUserAdminList } from '../../api'
const dom = uni.requireNativePlugin('dom')
const shareDialog = ref(false)
@@ -291,6 +293,8 @@
width: 375,
height: 750
})
/** 当前是否管理员 true: 是管理员false: 不是管理员*/
const isAdmin = ref(false)
const isShowUserInfoPanel = ref(false)
const isShowAudienceList = ref(false)
const isShowCoGuestRequestPanel = ref(false)
@@ -313,6 +317,7 @@
return hostConnected.value.length > 0
})
const { tencentUserSig } = useAuthUser()
const liveID = ref('')
const isFollowed = ref(false)
const inputValue = ref('')
@@ -379,15 +384,28 @@
).data
}
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.SIGN)) {
const list = newMessages.filter(
v => v.businessID === LIVE_BUSINESS.SIGN
)
activityData.value = {
...JSON.parse(
newMessages.find(v => v.businessID === LIVE_BUSINESS.SIGN)
?.data
),
...JSON.parse(list[list.length - 1]?.data),
isParticipated: false
}
isShowActivity.value = true
}
if (newMessages.some(v => v.businessID === LIVE_BUSINESS.ANCHOR)) {
const list = newMessages.filter(
v => v.businessID === LIVE_BUSINESS.ANCHOR
)
const e = list[list.length - 1]
if (e) {
console.log('==管理员状态===', JSON.parse(e.data))
isAdmin.value = JSON.parse(e.data).show
}
}
}
})
@@ -413,6 +431,12 @@
}
})
if (liveID.value) {
getUserAdminList(liveID.value).then(res => {
const adminList = res.data.Response?.Admin_Account || []
isAdmin.value = adminList?.some(
v => v === tencentUserSig.value.userId
)
})
joinLive({
liveID: liveID.value,
success: () => {
@@ -769,7 +793,9 @@
}
const showAudienceList = () => {
isShowAudienceList.value = true
if (isAdmin.value) {
isShowAudienceList.value = true
}
}
// 处理连麦按钮点击事件