allow all gifts rebuy

This commit is contained in:
2025-01-10 02:40:42 +08:00
parent e71c84d572
commit 02e24a5783
5 changed files with 423 additions and 96 deletions

View File

@@ -14,6 +14,7 @@ import { useRoute } from 'vue-router'
import { Vue3Marquee } from 'vue3-marquee'
import { NCard, NDivider, NEmpty, NMessageProvider, NSpace, NText, useMessage } from 'naive-ui'
import { List } from 'linqts'
import { useWebRTC } from '@/store/useRTC'
const props = defineProps<{
id?: number
@@ -24,6 +25,7 @@ const route = useRoute()
const currentId = computed(() => {
return props.id ?? route.query.id
})
const rtc = await useWebRTC().Init('slave')
const cardRef = ref()
const listContainerRef = ref()
@@ -114,6 +116,9 @@ async function update() {
}
}
}
async function onAddedItem() {
}
const direction = ref<'normal' | 'reverse'>('normal')
@@ -122,7 +127,11 @@ const active = ref(true)
let timer: any
onMounted(() => {
update()
timer = setInterval(update, 2000)
timer = setInterval(() => update(), 2000)
// 接收点播结果消息
rtc.on('function.live-request.add', () => update())
//@ts-expect-error 这里获取不了
if (window.obsstudio) {
//@ts-expect-error 这里获取不了
@@ -141,7 +150,6 @@ onUnmounted(() => {
</script>
<template>
<NMessageProvider :to="cardRef" />
<div ref="cardRef" class="live-request-background" v-bind="$attrs">
<p class="live-request-header">{{ settings.obsTitle ?? '点播' }}</p>
<NDivider class="live-request-divider">