feat: 添加结束活动和直播记录详情功能,优化直播页面跳转

This commit is contained in:
2026-03-07 15:19:23 +07:00
parent 67495ea864
commit 047ea3a77a
7 changed files with 68 additions and 22 deletions

View File

@@ -32,7 +32,8 @@
import { useAuthUser } from '../../../composables/useAuthUser'
import {
getLiveActivityDetail,
getLiveActivityRecord
getLiveActivityRecord,
getLIveRecordDetailByRoomId
} from '../../../api/tui-kit'
import { LIVE_BUSINESS } from '@/constants/live-keys'
@@ -71,6 +72,7 @@
/** 是否显示活动按钮 */
const isShowActivity = ref(false)
const shareDialog = ref(false)
const topNUmber = ref('')
const audienceListTitle = computed(
() => `在线人数 (${audienceList.value.length})`
@@ -137,6 +139,10 @@
currentLive.value?.liveOwner.userId
liveOwnerAvatar.value = currentLive.value?.liveOwner.avatarUrl
}
getLIveRecordDetailByRoomId(e.liveId).then(res => {
console.log('初始化虚拟人数===========', res.data.virtualViewers)
topNUmber.value = res.data.virtualViewers
})
const res = await getLiveActivityDetail(liveId)
// status: 0-未开始 1-进行中 2-已结束 3-已取消
console.log('活动数据============= ', currentLive.value)
@@ -249,7 +255,10 @@
:src="item.avatarUrl"
:size="24"
/>
<div class="audience-count">
<div v-if="topNUmber" class="audience-count">
{{ Number(topNUmber) > 100 ? '99+' : topNUmber }}
</div>
<div v-else class="audience-count">
<span>{{ audienceList.length }}</span>
</div>
</div>

View File

@@ -20,12 +20,13 @@
const onGo = item => {
// #ifdef APP-PLUS
uni.$liveID = item.roomId
navigateTo('/pages/audience/index', { liveID: item.roomId })
navigateTo('/pages/audience/index', { liveID: item.roomId,id: item.id })
// #endif
// #ifdef H5
navigateTo('/pages/discover/livelist/h5-live-player', {
liveId: item.roomId
liveId: item.roomId,
id: item.id
})
// #endif
}