diff --git a/src/views/manage/point/PointOrderManage.vue b/src/views/manage/PointOrderManage.vue similarity index 100% rename from src/views/manage/point/PointOrderManage.vue rename to src/views/manage/PointOrderManage.vue diff --git a/src/views/manage/point/PointManage.vue b/src/views/manage/point/PointManage.vue index e18889a..0e69dc2 100644 --- a/src/views/manage/point/PointManage.vue +++ b/src/views/manage/point/PointManage.vue @@ -42,7 +42,7 @@ import { NPopconfirm, } from 'naive-ui' import { computed, ref } from 'vue' -import PointOrderManage from './PointOrderManage.vue' +import PointOrderManage from '../PointOrderManage.vue' const message = useMessage() const accountInfo = useAccount() diff --git a/src/views/open_live/OpenQueue.vue b/src/views/open_live/OpenQueue.vue index 01f9e02..91c1956 100644 --- a/src/views/open_live/OpenQueue.vue +++ b/src/views/open_live/OpenQueue.vue @@ -326,37 +326,11 @@ async function updateStatus(queueData: ResponseQueueModel, status: QueueStatus) }) } -function onGetDanmaku(danmaku: DanmakuInfo) { - add({ - msg: danmaku.msg, - type: EventDataTypes.Message, - time: danmaku.timestamp, - uid: danmaku.uid, - name: danmaku.uname, - avatar: danmaku.uface, - fans_medal_level: danmaku.fans_medal_level, - fans_medal_name: danmaku.fans_medal_name, - fans_medal_wearing_status: danmaku.fans_medal_wearing_status, - guard_level: danmaku.guard_level, - num: 1, - price: 0, - } as EventModel) +function onGetDanmaku(danmaku: EventModel) { + add(danmaku) } -function onGetGift(danmaku: GiftInfo) { - add({ - msg: danmaku.gift_name, - type: EventDataTypes.Gift, - time: danmaku.timestamp, - uid: danmaku.uid, - name: danmaku.uname, - fans_medal_level: danmaku.fans_medal_level, - fans_medal_name: danmaku.fans_medal_name, - fans_medal_wearing_status: danmaku.fans_medal_wearing_status, - guard_level: danmaku.guard_level, - avatar: danmaku.uface, - num: 1, - price: (danmaku.gift_num * danmaku.price) / 1000, - } as EventModel) +function onGetGift(danmaku: EventModel) { + add(danmaku) } function checkMessage(eventData: EventModel) { if (!configCanEdit.value && queue.value.find((q) => q.user?.uid == eventData.uid)) { @@ -714,8 +688,8 @@ onMounted(() => { if (accountInfo.value) { settings.value = accountInfo.value.settings.queue } - props.client.on('danmaku', onGetDanmaku) - props.client.on('gift', onGetGift) + props.client.onEvent('danmaku', onGetDanmaku) + props.client.onEvent('gift', onGetGift) init() }) onActivated(() => { @@ -738,8 +712,8 @@ onDeactivated(() => { dispose() }) onUnmounted(() => { - props.client.off('danmaku', onGetDanmaku) - props.client.off('gift', onGetGift) + props.client.offEvent('danmaku', onGetDanmaku) + props.client.offEvent('gift', onGetGift) dispose() }) diff --git a/src/views/open_live/ReadDanmaku.vue b/src/views/open_live/ReadDanmaku.vue index 023ed08..ab4e83f 100644 --- a/src/views/open_live/ReadDanmaku.vue +++ b/src/views/open_live/ReadDanmaku.vue @@ -467,7 +467,7 @@ function test(type: EventDataTypes) { fans_medal_name: '', fans_medal_wearing_status: false, emoji: undefined, - avatar: '', + uface: '', }) break case EventDataTypes.SC: @@ -484,7 +484,7 @@ function test(type: EventDataTypes) { fans_medal_name: '', fans_medal_wearing_status: false, emoji: undefined, - avatar: '', + uface: '', }) break case EventDataTypes.Guard: @@ -501,7 +501,7 @@ function test(type: EventDataTypes) { fans_medal_name: '', fans_medal_wearing_status: false, emoji: undefined, - avatar: '', + uface: '', }) break case EventDataTypes.Gift: @@ -518,7 +518,7 @@ function test(type: EventDataTypes) { fans_medal_name: '', fans_medal_wearing_status: false, emoji: undefined, - avatar: '', + uface: '', }) break } diff --git a/src/views/open_live/SongRequest.vue b/src/views/open_live/SongRequest.vue index d7b3a6d..a4ffb42 100644 --- a/src/views/open_live/SongRequest.vue +++ b/src/views/open_live/SongRequest.vue @@ -319,40 +319,14 @@ async function updateSongStatus(song: SongRequestInfo, status: SongRequestStatus }) } -function onGetDanmaku(danmaku: DanmakuInfo) { +function onGetDanmaku(danmaku: EventModel) { if (checkMessage(danmaku.msg)) { - addSong({ - msg: danmaku.msg, - type: EventDataTypes.Message, - time: danmaku.timestamp, - uid: danmaku.uid, - name: danmaku.uname, - avatar: danmaku.uface, - fans_medal_level: danmaku.fans_medal_level, - fans_medal_name: danmaku.fans_medal_name, - fans_medal_wearing_status: danmaku.fans_medal_wearing_status, - guard_level: danmaku.guard_level, - num: 1, - price: 0, - } as EventModel) + addSong(danmaku) } } -function onGetSC(danmaku: SCInfo) { - if (settings.value.allowSC && checkMessage(danmaku.message)) { - addSong({ - msg: danmaku.message, - type: EventDataTypes.SC, - time: danmaku.timestamp, - uid: danmaku.uid, - name: danmaku.uname, - fans_medal_level: danmaku.fans_medal_level, - fans_medal_name: danmaku.fans_medal_name, - fans_medal_wearing_status: danmaku.fans_medal_wearing_status, - guard_level: danmaku.guard_level, - avatar: danmaku.uface, - num: 1, - price: danmaku.rmb, - } as EventModel) +function onGetSC(danmaku: EventModel) { + if (settings.value.allowSC && checkMessage(danmaku.msg)) { + addSong(danmaku) } } function checkMessage(msg: string) { @@ -698,8 +672,8 @@ onMounted(() => { if (accountInfo.value) { settings.value = accountInfo.value.settings.songRequest } - props.client.on('danmaku', onGetDanmaku) - props.client.on('sc', onGetSC) + props.client.onEvent('danmaku', onGetDanmaku) + props.client.onEvent('sc', onGetSC) init() }) onActivated(() => { @@ -722,8 +696,8 @@ onDeactivated(() => { dispose() }) onUnmounted(() => { - props.client.off('danmaku', onGetDanmaku) - props.client.off('sc', onGetSC) + props.client.offEvent('danmaku', onGetDanmaku) + props.client.offEvent('sc', onGetSC) dispose() })