2025-01-13 07:28:22 +00:00
|
|
|
|
<script setup>
|
2025-01-15 03:45:46 +00:00
|
|
|
|
import {ref, onMounted, onBeforeUnmount} from 'vue'
|
2025-01-13 08:52:59 +00:00
|
|
|
|
import Aliplayer from 'aliyun-aliplayer'
|
|
|
|
|
import 'aliyun-aliplayer/build/skins/default/aliplayer-min.css'
|
2025-01-20 08:17:49 +00:00
|
|
|
|
import sideButton from '~/pages/LiveRoom/components/SideButton/index.vue'
|
|
|
|
|
import broadcast from '~/pages/LiveRoom/components/Broadcast/index.vue'
|
2025-01-15 08:10:28 +00:00
|
|
|
|
import {liveStore} from "~/stores/live/index.js";
|
2025-01-20 08:17:49 +00:00
|
|
|
|
import paymentResults from '~/pages/LiveRoom/components/PaymentResults/index.vue'
|
|
|
|
|
import paymentInput from '~/pages/LiveRoom/components/PaymentInput/index.vue'
|
|
|
|
|
import PressableButton from '~/pages/LiveRoom/components/SideButton/PressableButton.vue'
|
2025-01-16 03:12:52 +00:00
|
|
|
|
|
2025-01-13 08:52:59 +00:00
|
|
|
|
const player = ref(null)
|
2025-01-16 03:12:52 +00:00
|
|
|
|
const {quoteStatus, changeStatus, show, playerId, show1} = liveStore()
|
2025-01-13 08:52:59 +00:00
|
|
|
|
const isPlayerReady = ref(false)
|
2025-01-13 12:59:25 +00:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
fullLive: {
|
|
|
|
|
type: Boolean,
|
2025-01-15 03:45:46 +00:00
|
|
|
|
default: true,
|
2025-01-13 12:59:25 +00:00
|
|
|
|
},
|
|
|
|
|
})
|
2025-01-16 03:07:38 +00:00
|
|
|
|
|
|
|
|
|
definePageMeta({
|
|
|
|
|
title: '主页',
|
|
|
|
|
i18n: 'login.title',
|
|
|
|
|
})
|
|
|
|
|
const config = useRuntimeConfig()
|
2025-01-13 08:52:59 +00:00
|
|
|
|
const playerConfig = {
|
2025-01-16 03:07:38 +00:00
|
|
|
|
id: playerId.value,
|
|
|
|
|
source: config.public.NUXT_PUBLIC_PLAYER_SOURCE,
|
2025-01-13 08:52:59 +00:00
|
|
|
|
isLive: true,
|
|
|
|
|
preload: true,
|
|
|
|
|
autoplayPolicy: {fallbackToMute: true},
|
|
|
|
|
controlBarVisibility: 'never',
|
|
|
|
|
}
|
|
|
|
|
const handlePlayerError = (error) => {
|
|
|
|
|
console.error('播放器错误:', error)
|
|
|
|
|
if (player.value) {
|
|
|
|
|
player.value?.play()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const initializePlayer = () => {
|
|
|
|
|
try {
|
|
|
|
|
if (player.value) {
|
|
|
|
|
player.value?.dispose()
|
|
|
|
|
}
|
|
|
|
|
player.value = new Aliplayer(playerConfig, (playerInstance) => {
|
|
|
|
|
isPlayerReady.value = true
|
|
|
|
|
playerInstance?.play()
|
|
|
|
|
})
|
|
|
|
|
player.value?.on('error', handlePlayerError)
|
2025-01-15 03:45:46 +00:00
|
|
|
|
player.value?.on('rtsTraceId', (event) => {
|
|
|
|
|
})
|
|
|
|
|
player.value?.on('rtsFallback', (event) => {
|
|
|
|
|
})
|
2025-01-13 08:52:59 +00:00
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('播放器初始化失败:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-13 08:30:56 +00:00
|
|
|
|
|
2025-01-13 07:28:22 +00:00
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2025-01-21 03:43:27 +00:00
|
|
|
|
/* initializePlayer()*/
|
2025-01-13 08:52:59 +00:00
|
|
|
|
})
|
2025-01-13 07:28:22 +00:00
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
if (player.value) {
|
2025-01-13 08:52:59 +00:00
|
|
|
|
player.value?.dispose()
|
|
|
|
|
player.value = null
|
2025-01-13 07:28:22 +00:00
|
|
|
|
}
|
2025-01-13 08:52:59 +00:00
|
|
|
|
})
|
2025-01-16 03:12:52 +00:00
|
|
|
|
const goPay = () => {
|
|
|
|
|
show.value = true
|
2025-01-15 08:10:28 +00:00
|
|
|
|
}
|
2025-01-13 07:28:22 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-01-15 03:45:46 +00:00
|
|
|
|
<div class="relative h-full">
|
2025-01-21 03:43:27 +00:00
|
|
|
|
<div class="w-full h-full">
|
|
|
|
|
<video
|
|
|
|
|
class="h-full w-full"
|
|
|
|
|
autoplay
|
|
|
|
|
loop
|
|
|
|
|
muted
|
|
|
|
|
playsinline
|
|
|
|
|
style=" object-fit: cover"
|
|
|
|
|
>
|
|
|
|
|
<source src="@/static/video/example.mp4" type="video/mp4" />
|
|
|
|
|
您的浏览器不支持 HTML5 视频。
|
|
|
|
|
</video>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div :id="playerId" class="w-screen"
|
|
|
|
|
:style="fullLive?'height: calc(100vh - var(--van-nav-bar-height))':'height:100%'"></div>-->
|
2025-01-13 12:59:25 +00:00
|
|
|
|
<template v-if="fullLive">
|
2025-01-16 03:12:52 +00:00
|
|
|
|
<sideButton class="absolute top-196px right-0 z-999"></sideButton>
|
2025-01-13 12:59:25 +00:00
|
|
|
|
<div class="absolute top-505px left-1/2 transform -translate-x-1/2 flex flex-col items-center">
|
|
|
|
|
<div class="text-16px text-#FFB25F font-600">
|
|
|
|
|
当前价:RMB
|
|
|
|
|
<van-rolling-text class="my-rolling-text" :start-num="0" :target-num="3000" direction="up"/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-16px text-#fff font-600">
|
|
|
|
|
下口价:RMB
|
|
|
|
|
<van-rolling-text class="my-rolling-text1" :start-num="0" :target-num="3500" direction="up"/>
|
|
|
|
|
</div>
|
2025-01-16 03:12:52 +00:00
|
|
|
|
<PressableButton>
|
|
|
|
|
<div
|
|
|
|
|
:class="`w-344px h-[40px] ${quoteStatus ? 'bg-#FFB25F' : 'bg-#D6D6D8'} rounded-4px ${quoteStatus ? 'text-#fff' : 'text-#7D7D7F'} text-14px flex justify-center items-center mt-10px mb-10px`">
|
|
|
|
|
{{ quoteStatus ? '确认出价 RMB 3,000' : '点击"开启出价",即刻参与竞拍 ' }}
|
|
|
|
|
</div>
|
|
|
|
|
</PressableButton>
|
2025-01-15 08:45:29 +00:00
|
|
|
|
<broadcast></broadcast>
|
2025-01-13 07:28:22 +00:00
|
|
|
|
</div>
|
2025-01-16 03:12:52 +00:00
|
|
|
|
<paymentInput v-model:show="show"/>
|
2025-01-16 03:07:38 +00:00
|
|
|
|
<div>
|
|
|
|
|
</div>
|
2025-01-16 03:12:52 +00:00
|
|
|
|
<paymentResults v-model:show="show1" type="error"/>
|
2025-01-13 12:59:25 +00:00
|
|
|
|
</template>
|
2025-01-15 08:10:28 +00:00
|
|
|
|
|
2025-01-13 07:28:22 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2025-01-15 08:10:28 +00:00
|
|
|
|
<style>
|
2025-01-16 03:12:52 +00:00
|
|
|
|
:root:root {
|
|
|
|
|
--van-dialog-radius: 8px
|
2025-01-15 03:45:46 +00:00
|
|
|
|
}
|
2025-01-15 08:10:28 +00:00
|
|
|
|
</style>
|
|
|
|
|
<style scoped>
|
2025-01-16 03:07:38 +00:00
|
|
|
|
|
2025-01-13 07:28:22 +00:00
|
|
|
|
.my-rolling-text {
|
|
|
|
|
--van-rolling-text-item-width: 10px;
|
|
|
|
|
--van-rolling-text-font-size: 16px;
|
|
|
|
|
--van-rolling-text-color: #FFB25F;
|
|
|
|
|
}
|
2025-01-13 08:52:59 +00:00
|
|
|
|
|
2025-01-13 07:28:22 +00:00
|
|
|
|
.my-rolling-text1 {
|
|
|
|
|
--van-rolling-text-item-width: 10px;
|
|
|
|
|
--van-rolling-text-font-size: 16px;
|
|
|
|
|
--van-rolling-text-color: #FFF;
|
|
|
|
|
}
|
2025-01-15 03:45:46 +00:00
|
|
|
|
|
|
|
|
|
:deep(.prism-license-watermark) {
|
|
|
|
|
display: none !important;
|
2025-01-13 12:59:25 +00:00
|
|
|
|
}
|
2025-01-13 07:28:22 +00:00
|
|
|
|
</style>
|