mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
update sink alert
This commit is contained in:
@@ -12,7 +12,7 @@ const emptyCover = IMGUR_URL + 'None.png'
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NCard style="max-width: 300px">
|
<NCard>
|
||||||
<template #cover>
|
<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%" />
|
<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>
|
</template>
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ export const useMusicRequestProvider = defineStore('MusicRequest', () => {
|
|||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
function addWaitingMusic(info: WaitMusicInfo) {
|
function addWaitingMusic(info: WaitMusicInfo) {
|
||||||
console.log(settings.value.orderMusicFirst + ' ' + isPlayingOrderMusic.value)
|
|
||||||
if ((settings.value.orderMusicFirst && !isPlayingOrderMusic.value) || aplayerRef.value?.audio.paused == true) {
|
if ((settings.value.orderMusicFirst && !isPlayingOrderMusic.value) || aplayerRef.value?.audio.paused == true) {
|
||||||
playMusic(info.music)
|
playMusic(info.music)
|
||||||
isPlayingOrderMusic.value = true
|
isPlayingOrderMusic.value = true
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { NButton, NCard, NDivider, NLayoutContent, NSpace, NText, NTimeline, NTi
|
|||||||
</NSpace>
|
</NSpace>
|
||||||
<NDivider title-placement="left"> 更新日志 </NDivider>
|
<NDivider title-placement="left"> 更新日志 </NDivider>
|
||||||
<NTimeline>
|
<NTimeline>
|
||||||
|
<NTimelineItem type="warning" title="Bug修复" content="修复点歌会直接跳到下一首的问题 (怎么没人跟我说" time="2024-1-22" />
|
||||||
<NTimelineItem type="info" title="功能更新" content="读弹幕支持自定义API" time="2023-12-25" />
|
<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-24" />
|
||||||
<NTimelineItem type="success" title="功能添加" content="读弹幕" time="2023-12-17" />
|
<NTimelineItem type="success" title="功能添加" content="读弹幕" time="2023-12-17" />
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ function OnClickCover(live: ResponseLiveInfoModel) {
|
|||||||
params: { id: live.liveId },
|
params: { id: live.liveId },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -50,12 +49,12 @@ function OnClickCover(live: ResponseLiveInfoModel) {
|
|||||||
<NAlert v-if="accountInfo?.isBiliVerified != true" type="info"> 尚未进行Bilibili认证 </NAlert>
|
<NAlert v-if="accountInfo?.isBiliVerified != true" type="info"> 尚未进行Bilibili认证 </NAlert>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<NSpace vertical justify="center" align="center">
|
<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>
|
</NSpace>
|
||||||
<NDivider />
|
<NDivider />
|
||||||
<NList bordered hoverable clickable>
|
<NList bordered hoverable clickable>
|
||||||
<NListItem @click="OnClickCover(live)" v-for="live in lives" v-bind: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"/>
|
<LiveInfoContainer :live="live" :key="live.liveId" />
|
||||||
</NListItem>
|
</NListItem>
|
||||||
</NList>
|
</NList>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -159,11 +159,12 @@ async function updateGoods(e: MouseEvent) {
|
|||||||
if (fileList.value.length > 0) {
|
if (fileList.value.length > 0) {
|
||||||
currentGoodsModel.value.cover = await getImageUploadModel(fileList.value)
|
currentGoodsModel.value.cover = await getImageUploadModel(fileList.value)
|
||||||
}
|
}
|
||||||
console.log(currentGoodsModel.value.cover)
|
|
||||||
await QueryPostAPI<ResponsePointGoodModel>(POINT_API_URL + 'update-goods', currentGoodsModel.value)
|
await QueryPostAPI<ResponsePointGoodModel>(POINT_API_URL + 'update-goods', currentGoodsModel.value)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.code == 200) {
|
if (data.code == 200) {
|
||||||
message.success('成功')
|
message.success('成功')
|
||||||
|
showAddGoodsModal.value = false
|
||||||
|
currentGoodsModel.value = {} as PointGoodsModel
|
||||||
if (goods.value.find((g) => g.id == data.data.id)) {
|
if (goods.value.find((g) => g.id == data.data.id)) {
|
||||||
goods.value[goods.value.findIndex((g) => g.id == data.data.id)] = data.data
|
goods.value[goods.value.findIndex((g) => g.id == data.data.id)] = data.data
|
||||||
} else {
|
} else {
|
||||||
@@ -184,8 +185,6 @@ async function updateGoods(e: MouseEvent) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
isUpdating.value = false
|
isUpdating.value = false
|
||||||
showAddGoodsModal.value = false
|
|
||||||
currentGoodsModel.value = {} as PointGoodsModel
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function OnFileListChange(files: UploadFileInfo[]) {
|
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>
|
<NButton text type="primary" tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank"> VtsuruEventFetcher </NButton>
|
||||||
</NText>
|
</NText>
|
||||||
</NAlert>
|
</NAlert>
|
||||||
<NTabs>
|
<NDivider />
|
||||||
|
<NTabs animated>
|
||||||
<NTabPane name="goods" tab="礼物">
|
<NTabPane name="goods" tab="礼物">
|
||||||
<NFlex>
|
<NFlex>
|
||||||
<NButton type="primary" @click="showAddGoodsModal = true"> 添加礼物 </NButton>
|
<NButton type="primary" @click="showAddGoodsModal = true"> 添加礼物 </NButton>
|
||||||
</NFlex>
|
</NFlex>
|
||||||
<NDivider />
|
<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">
|
<NGridItem v-for="item in goods" :key="item.id">
|
||||||
<PointGoodsItem :goods="item">
|
<PointGoodsItem :goods="item">
|
||||||
<template #header-extra>
|
<template #header-extra>
|
||||||
@@ -275,6 +275,15 @@ function onDeleteClick(item: ResponsePointGoodModel) {
|
|||||||
</NGridItem>
|
</NGridItem>
|
||||||
</NGrid>
|
</NGrid>
|
||||||
</NTabPane>
|
</NTabPane>
|
||||||
|
<NTabPane name="orders" tab="订单">
|
||||||
|
|
||||||
|
</NTabPane>
|
||||||
|
<NTabPane name="users" tab="用户">
|
||||||
|
|
||||||
|
</NTabPane>
|
||||||
|
<NTabPane name="settings" tab="设置">
|
||||||
|
|
||||||
|
</NTabPane>
|
||||||
</NTabs>
|
</NTabs>
|
||||||
|
|
||||||
<NModal v-model:show="showAddGoodsModal" preset="card" style="width: 600px; max-width: 90%" title="添加/修改礼物信息">
|
<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>
|
<NFormItem path="price" label="所需积分" required>
|
||||||
<NInputNumber v-model:value="currentGoodsModel.price" placeholder="必填, 兑换所需要的积分" min="0" />
|
<NInputNumber v-model:value="currentGoodsModel.price" placeholder="必填, 兑换所需要的积分" min="0" />
|
||||||
</NFormItem>
|
</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="描述">
|
<NFormItem path="description" label="描述">
|
||||||
<NInput v-model:value="currentGoodsModel.description" placeholder="可选, 礼物描述" />
|
<NInput v-model:value="currentGoodsModel.description" placeholder="可选, 礼物描述" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import {
|
|||||||
NTabs,
|
NTabs,
|
||||||
NTag,
|
NTag,
|
||||||
NText,
|
NText,
|
||||||
|
NTooltip,
|
||||||
NTransfer,
|
NTransfer,
|
||||||
NUl,
|
NUl,
|
||||||
NVirtualList,
|
NVirtualList,
|
||||||
@@ -133,6 +134,10 @@ async function get() {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
async function searchMusic(keyword: string) {
|
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, {
|
const data = await QueryGetAPI<SongsInfo>(MUSIC_REQUEST_API_URL + 'search-' + settings.value.platform, {
|
||||||
keyword: keyword,
|
keyword: keyword,
|
||||||
})
|
})
|
||||||
@@ -459,7 +464,12 @@ onUnmounted(() => {
|
|||||||
<NCheckbox v-model:checked="settings.orderMusicFirst"> 优先播放点歌 </NCheckbox>
|
<NCheckbox v-model:checked="settings.orderMusicFirst"> 优先播放点歌 </NCheckbox>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
<NSpace>
|
<NSpace>
|
||||||
<NButton @click="getOutputDevice"> 获取输出设备 </NButton>
|
<NTooltip>
|
||||||
|
<template #trigger>
|
||||||
|
<NButton @click="getOutputDevice" type="info"> 获取输出设备 </NButton>
|
||||||
|
</template>
|
||||||
|
获取和修改输出设备需要打开麦克风权限
|
||||||
|
</NTooltip>
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="settings.deviceId"
|
v-model:value="settings.deviceId"
|
||||||
:options="deviceList"
|
:options="deviceList"
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ function getTextFromDanmaku(data: EventModel | undefined) {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let text: string
|
let text: string = ''
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case EventDataTypes.Message:
|
case EventDataTypes.Message:
|
||||||
if (!settings.value.danmakuTemplate) {
|
if (!settings.value.danmakuTemplate) {
|
||||||
@@ -829,6 +829,7 @@ onUnmounted(() => {
|
|||||||
</NTooltip>
|
</NTooltip>
|
||||||
</NCheckbox>
|
</NCheckbox>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
|
<NDivider />
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user