fix queue gift

This commit is contained in:
2023-12-17 19:33:08 +08:00
parent 7ae3fdfe99
commit 4d3ea1e34f
2 changed files with 7 additions and 8 deletions

View File

@@ -366,7 +366,7 @@ function checkMessage(eventData: EventModel) {
if (settings.value.keyword && eventData.type === EventDataTypes.Message && !checkMatch(eventData.msg)) { if (settings.value.keyword && eventData.type === EventDataTypes.Message && !checkMatch(eventData.msg)) {
return false //非排队弹幕 return false //非排队弹幕
} else if (eventData.type === EventDataTypes.Gift) { } else if (eventData.type === EventDataTypes.Gift) {
if (!settings.value.allowGift) { if (!settings.value.allowGift && !settings.value.allowIncreasePaymentBySendGift) {
return false // { success: false, message: '不允许通过礼物排队' } return false // { success: false, message: '不允许通过礼物排队' }
} }
const nameNotMatch = (settings.value.giftNames?.length ?? 0) > 0 && settings.value.giftNames?.some((n) => eventData.msg.toLowerCase() === n.toLowerCase()) != true const nameNotMatch = (settings.value.giftNames?.length ?? 0) > 0 && settings.value.giftNames?.some((n) => eventData.msg.toLowerCase() === n.toLowerCase()) != true
@@ -814,7 +814,7 @@ onUnmounted(() => {
<NCard embedded size="small" content-style="padding: 5px;" :style="`${queueData.status == QueueStatus.Progressing ? 'animation: animated-border 2.5s infinite;' : ''};height: 100%;`"> <NCard embedded size="small" content-style="padding: 5px;" :style="`${queueData.status == QueueStatus.Progressing ? 'animation: animated-border 2.5s infinite;' : ''};height: 100%;`">
<NSpace justify="space-between" align="center" style="height: 100%; margin: 0 5px 0 5px"> <NSpace justify="space-between" align="center" style="height: 100%; margin: 0 5px 0 5px">
<NSpace align="center"> <NSpace align="center">
<div :style="`border-radius: 4px; background-color: ${queueData.status == QueueStatus.Progressing ? '#75c37f' : '#577fb8'}; width: 20px; height: 20px;text-align: center;`"> <div :style="`border-radius: 4px; background-color: ${queueData.status == QueueStatus.Progressing ? '#75c37f' : '#577fb8'}; width: 20px; height: 20px;text-align: center;color: white;`">
{{ index + 1 }} {{ index + 1 }}
</div> </div>
<NText strong style="font-size: 18px"> <NText strong style="font-size: 18px">

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, onUnmounted, ref } from 'vue' import { computed, onMounted, onUnmounted, ref } from 'vue'
import EasySpeech from 'easy-speech' import EasySpeech from 'easy-speech'
import { NButton, NDivider, NIcon, NInput, NInputGroup, NInputGroupLabel, NPopconfirm, NSelect, NSlider, NSpace, NTag, NText, NTooltip, useMessage } from 'naive-ui' import { NAlert, NButton, NDivider, NIcon, NInput, NInputGroup, NInputGroupLabel, NPopconfirm, NSelect, NSlider, NSpace, NTag, NText, NTooltip, useMessage } from 'naive-ui'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { Queue } from 'queue-typescript' import { Queue } from 'queue-typescript'
@@ -350,7 +350,8 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<NSpace> <NAlert v-if="!speechSynthesisInfo || !speechSynthesisInfo.speechSynthesis" type="error"> 你的浏览器不支持语音功能 </NAlert>
<NSpace v-else>
<NButton @click="canSpeech ? stopSpeech() : startSpeech()" :type="canSpeech ? 'error' : 'primary'"> {{ canSpeech ? '停止监听' : '开始监听' }} </NButton> <NButton @click="canSpeech ? stopSpeech() : startSpeech()" :type="canSpeech ? 'error' : 'primary'"> {{ canSpeech ? '停止监听' : '开始监听' }} </NButton>
<NButton @click="uploadConfig" type="primary" secondary> 保存配置到服务器 </NButton> <NButton @click="uploadConfig" type="primary" secondary> 保存配置到服务器 </NButton>
<NPopconfirm @positive-click="downloadConfig"> <NPopconfirm @positive-click="downloadConfig">
@@ -373,7 +374,7 @@ onUnmounted(() => {
</template> </template>
{{ isSpeaking ? '取消朗读' : '未朗读' }} {{ isSpeaking ? '取消朗读' : '未朗读' }}
</NTooltip> </NTooltip>
<NText depth="3"> 队列: {{ speechCount }} <NDivider vertical /> 已读: {{readedDanmaku }} </NText> <NText depth="3"> 队列: {{ speechCount }} <NDivider vertical /> 已读: {{ readedDanmaku }} </NText>
</NSpace> </NSpace>
</template> </template>
<NDivider /> <NDivider />
@@ -420,9 +421,7 @@ onUnmounted(() => {
</NInputGroup> </NInputGroup>
</NSpace> </NSpace>
<NDivider> 设置 </NDivider> <NDivider> 设置 </NDivider>
<NText depth="3"> <NText depth="3"> 没想好需要什么, 有建议的话可以和我说 </NText>
没想好需要什么, 有建议的话可以和我说
</NText>
</template> </template>
<style> <style>