update sink alert

This commit is contained in:
2024-01-22 00:19:04 +08:00
parent c1d8f75690
commit 635cafd7ca
7 changed files with 36 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ const emptyCover = IMGUR_URL + 'None.png'
</script>
<template>
<NCard style="max-width: 300px">
<NCard>
<template #cover>
<NImage :src="goods.cover ? FILE_BASE_URL + goods.cover : emptyCover" :fallback-src="emptyCover" height="150" object-fit="cover" :preview-disabled="!goods.cover" style="width: 100%" />
</template>

View File

@@ -66,7 +66,6 @@ export const useMusicRequestProvider = defineStore('MusicRequest', () => {
const message = useMessage()
function addWaitingMusic(info: WaitMusicInfo) {
console.log(settings.value.orderMusicFirst + ' ' + isPlayingOrderMusic.value)
if ((settings.value.orderMusicFirst && !isPlayingOrderMusic.value) || aplayerRef.value?.audio.paused == true) {
playMusic(info.music)
isPlayingOrderMusic.value = true

View File

@@ -31,6 +31,7 @@ import { NButton, NCard, NDivider, NLayoutContent, NSpace, NText, NTimeline, NTi
</NSpace>
<NDivider title-placement="left"> 更新日志 </NDivider>
<NTimeline>
<NTimelineItem type="warning" title="Bug修复" content="修复点歌会直接跳到下一首的问题 (怎么没人跟我说" time="2024-1-22" />
<NTimelineItem type="info" title="功能更新" content="读弹幕支持自定义API" time="2023-12-25" />
<NTimelineItem type="success" title="功能添加" content="弹幕点歌 (点播)" time="2023-12-24" />
<NTimelineItem type="success" title="功能添加" content="读弹幕" time="2023-12-17" />

View File

@@ -39,7 +39,6 @@ function OnClickCover(live: ResponseLiveInfoModel) {
params: { id: live.liveId },
})
}
</script>
<template>
@@ -50,12 +49,12 @@ function OnClickCover(live: ResponseLiveInfoModel) {
<NAlert v-if="accountInfo?.isBiliVerified != true" type="info"> 尚未进行Bilibili认证 </NAlert>
<template v-else>
<NSpace vertical justify="center" align="center">
<NPagination v-model:page="page" show-quick-jumper show-size-picker :page-sizes="[10, 20, 30, 40]" :item-count="lives.length" />
<NPagination v-model:page="page" v-model:page-size="pageSize" show-quick-jumper show-size-picker :page-sizes="[10, 20, 30, 40]" :item-count="lives.length" />
</NSpace>
<NDivider />
<NList bordered hoverable clickable>
<NListItem @click="OnClickCover(live)" v-for="live in lives" v-bind:key="live.liveId">
<LiveInfoContainer :live="live" :key="live.liveId"/>
<NListItem @click="OnClickCover(live)" v-for="live in lives.slice((page - 1) * pageSize, page * pageSize)" v-bind:key="live.liveId">
<LiveInfoContainer :live="live" :key="live.liveId" />
</NListItem>
</NList>
</template>

View File

@@ -159,11 +159,12 @@ async function updateGoods(e: MouseEvent) {
if (fileList.value.length > 0) {
currentGoodsModel.value.cover = await getImageUploadModel(fileList.value)
}
console.log(currentGoodsModel.value.cover)
await QueryPostAPI<ResponsePointGoodModel>(POINT_API_URL + 'update-goods', currentGoodsModel.value)
.then((data) => {
if (data.code == 200) {
message.success('成功')
showAddGoodsModal.value = false
currentGoodsModel.value = {} as PointGoodsModel
if (goods.value.find((g) => g.id == data.data.id)) {
goods.value[goods.value.findIndex((g) => g.id == data.data.id)] = data.data
} else {
@@ -184,8 +185,6 @@ async function updateGoods(e: MouseEvent) {
})
.finally(() => {
isUpdating.value = false
showAddGoodsModal.value = false
currentGoodsModel.value = {} as PointGoodsModel
})
}
function OnFileListChange(files: UploadFileInfo[]) {
@@ -253,13 +252,14 @@ function onDeleteClick(item: ResponsePointGoodModel) {
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
</NText>
</NAlert>
<NTabs>
<NDivider />
<NTabs animated>
<NTabPane name="goods" tab="礼物">
<NFlex>
<NButton type="primary" @click="showAddGoodsModal = true"> 添加礼物 </NButton>
</NFlex>
<NDivider />
<NGrid :cols="4">
<NGrid cols="1 500:2 700:3 1000:4 1200:5" :x-gap="12" :y-gap="8">
<NGridItem v-for="item in goods" :key="item.id">
<PointGoodsItem :goods="item">
<template #header-extra>
@@ -275,6 +275,15 @@ function onDeleteClick(item: ResponsePointGoodModel) {
</NGridItem>
</NGrid>
</NTabPane>
<NTabPane name="orders" tab="订单">
</NTabPane>
<NTabPane name="users" tab="用户">
</NTabPane>
<NTabPane name="settings" tab="设置">
</NTabPane>
</NTabs>
<NModal v-model:show="showAddGoodsModal" preset="card" style="width: 600px; max-width: 90%" title="添加/修改礼物信息">
@@ -286,6 +295,10 @@ function onDeleteClick(item: ResponsePointGoodModel) {
<NFormItem path="price" label="所需积分" required>
<NInputNumber v-model:value="currentGoodsModel.price" placeholder="必填, 兑换所需要的积分" min="0" />
</NFormItem>
<NFormItem path="count" label="库存">
<NCheckbox :checked="currentGoodsModel.count && currentGoodsModel.count < 0" @update:checked="(v) => (currentGoodsModel.count = v ? -1 : 100)"> 不限 </NCheckbox>
<NInputNumber v-if="currentGoodsModel.count > -1" v-model:value="currentGoodsModel.count" placeholder="可选, 礼物库存" style="max-width: 120px;"/>
</NFormItem>
<NFormItem path="description" label="描述">
<NInput v-model:value="currentGoodsModel.description" placeholder="可选, 礼物描述" />
</NFormItem>

View File

@@ -32,6 +32,7 @@ import {
NTabs,
NTag,
NText,
NTooltip,
NTransfer,
NUl,
NVirtualList,
@@ -133,6 +134,10 @@ async function get() {
return []
}
async function searchMusic(keyword: string) {
const inSongList = originMusics.value.find((m) => m.name.toLowerCase().trim() == keyword.toLowerCase().trim())
if (inSongList) {
return inSongList
}
const data = await QueryGetAPI<SongsInfo>(MUSIC_REQUEST_API_URL + 'search-' + settings.value.platform, {
keyword: keyword,
})
@@ -459,7 +464,12 @@ onUnmounted(() => {
<NCheckbox v-model:checked="settings.orderMusicFirst"> 优先播放点歌 </NCheckbox>
</NSpace>
<NSpace>
<NButton @click="getOutputDevice"> 获取输出设备 </NButton>
<NTooltip>
<template #trigger>
<NButton @click="getOutputDevice" type="info"> 获取输出设备 </NButton>
</template>
获取和修改输出设备需要打开麦克风权限
</NTooltip>
<NSelect
v-model:value="settings.deviceId"
:options="deviceList"

View File

@@ -350,7 +350,7 @@ function getTextFromDanmaku(data: EventModel | undefined) {
if (!data) {
return
}
let text: string
let text: string = ''
switch (data.type) {
case EventDataTypes.Message:
if (!settings.value.danmakuTemplate) {
@@ -829,6 +829,7 @@ onUnmounted(() => {
</NTooltip>
</NCheckbox>
</NSpace>
<NDivider />
</template>
</template>