feat: 添加直播间跳转功能,优化观众页面数据展示

This commit is contained in:
2026-03-07 20:12:22 +07:00
parent 537d598906
commit fa5849fb6f
4 changed files with 137 additions and 101 deletions

View File

@@ -288,6 +288,7 @@
/** 点击跳转直播间 */
const onLive = () => {
// #ifdef APP-PLUS
uni.$liveID = goodsData.value.id
navigateTo('/pages/audience/index', {
liveID: goodsData.value.id
})

View File

@@ -59,11 +59,11 @@
/>
</view>
<view class="participant-count">
<text v-if="topNUmber" class="count-text">
{{ Number(topNUmber) > 100 ? '99+' : topNUmber }}
<text v-if="Number(topNUmber) > 0" class="count-text">
{{ Number(topNUmber) > 100 ? '99+' : topNUmber }}1
</text>
<text v-else class="count-text">
{{ audienceList.length }}
{{ audienceNumber }}
</text>
</view>
</view>
@@ -268,6 +268,7 @@
addLiveSeatEventListener,
removeLiveSeatEventListener
} = useLiveSeatState(uni?.$liveID)
console.log("uniliveID",uni?.$liveID)
const { audienceList } = useLiveAudienceState(uni?.$liveID)
const { disconnect, connected, cancelApplication } = useCoGuestState(
uni?.$liveID
@@ -346,6 +347,7 @@
const coGuestSheetItems = ref(['取消连麦申请'])
const coGuestSheetTitle = ref('')
const topNUmber = ref('')
const audienceNumber = computed(()=>audienceList.value.length)
// 监听座位变化:当自身不在 seatList 时,将本地连麦状态重置为 IDLE
watch(

View File

@@ -6,6 +6,7 @@
import { formatNumberWithWan } from '../../utils'
import { getUserPayPwd } from '@/api/my-index'
import { useUserStore } from '../../stores/user'
import { ref } from 'vue'
const bottomList = [
{
@@ -51,7 +52,7 @@
}
]
const { getIntegral } = useUserStore()
const { getIntegral, refreshUserInfo } = useUserStore()
const { showDialog } = useUI()
const { userInfo, integralData } = useAuthUser()
@@ -72,6 +73,12 @@
}
}
const paging = ref(null)
const onRefresh = async () => {
await refreshUserInfo()
paging.value.complete()
}
onLoad(() => {
// 获取用户信息
console.log(userInfo.value, '===获取用户信息')
@@ -82,6 +89,12 @@
</script>
<template>
<z-paging
ref="paging"
:paging-style="{ 'background-color': '#f9f9f9' }"
refresher-only
@onRefresh="onRefresh"
>
<view class="my-index">
<view
class="top-info"
@@ -158,6 +171,7 @@
</view>
</view>
</view>
</z-paging>
</template>
<style lang="scss" scoped>

View File

@@ -54,9 +54,21 @@
onShow(() => {
getData()
})
const paging = ref(null)
const onRefresh = async () => {
await getData()
paging.value.complete()
}
</script>
<template>
<z-paging
ref="paging"
:paging-style="{ 'background-color': '#f9f9f9' }"
refresher-only
@onRefresh="onRefresh"
>
<view class="wallet">
<!-- 顶部样式 -->
<view class="top-card">
@@ -66,7 +78,9 @@
</view>
<view class="right-box">
<button
@click="showDialog('提示', '联系客服或者联系上级分享人', false)"
@click="
showDialog('提示', '联系客服或者联系上级分享人', false)
"
>
充值
</button>
@@ -96,6 +110,7 @@
</view>
</view>
</view>
</z-paging>
</template>
<style lang="scss" scoped>
@@ -113,7 +128,9 @@
align-items: center;
justify-content: space-between;
position: relative;
font-family: PingFang SC, PingFang SC;
font-family:
PingFang SC,
PingFang SC;
font-style: normal;
text-transform: none;
&::after {
@@ -152,7 +169,9 @@
height: 64rpx;
line-height: 64rpx;
border-radius: 100rpx 100rpx 100rpx 100rpx;
font-family: PingFang SC, PingFang SC;
font-family:
PingFang SC,
PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #ffffff;