diff --git a/index.html b/index.html
index f6e5246..ccec625 100644
--- a/index.html
+++ b/index.html
@@ -6,7 +6,9 @@
vtsuru.live
-
+
+
+
diff --git a/src/api/account.ts b/src/api/account.ts
index 6680014..28fb99a 100644
--- a/src/api/account.ts
+++ b/src/api/account.ts
@@ -47,6 +47,9 @@ function refreshCookie() {
}
})
}
+export async function SaveAccountSettings() {
+ return await QueryPostAPI(ACCOUNT_API_URL + 'update-setting', ACCOUNT.value?.settings)
+}
export function useAccount() {
return ACCOUNT
}
diff --git a/src/api/api-models.ts b/src/api/api-models.ts
index 32e56de..5f0dee3 100644
--- a/src/api/api-models.ts
+++ b/src/api/api-models.ts
@@ -60,16 +60,38 @@ export interface Setting_QuestionBox {
export interface UserSetting {
sendEmail: Setting_SendEmail
questionBox: Setting_QuestionBox
+ songRequest: Setting_SongRequest
enableFunctions: FunctionTypes[]
indexTemplate: string | null,
songListTemplate: string | null
scheduleTemplate: string | null
}
+export interface Setting_SongRequest {
+ orderPrefix: string
+ onlyAllowSongList: boolean
+ queueMaxSize: number
+ allowAllDanmaku: boolean
+ allowFromWeb: boolean
+ needWearFanMedal: boolean
+ needJianzhang: boolean
+ needTidu: boolean
+ needZongdu: boolean
+ allowSC: boolean
+ sCIgnoreLimit: boolean
+ sCMinPrice: number
+ fanMedalMinLevel: number
+ allowReorderSong: boolean
+ cooldownSecond: number
+ zongduCooldownSecond: number
+ tiduCooldownSecond: number
+ jianzhangCooldownSecond: number
+}
export enum FunctionTypes {
SongList,
QuestionBox,
Schedule,
+ SongRequest,
}
export interface SongAuthorInfo {
name: string
@@ -257,6 +279,7 @@ export interface UpdateLiveLotteryUsersModel {
type: OpenLiveLotteryType
}
export interface SongRequestInfo {
+ id: number
songName: string
song?: SongsInfo
status: SongRequestStatus
@@ -267,11 +290,11 @@ export interface SongRequestInfo {
}
export interface SongRequestUserInfo {
name: string
- uId: number
- guardLevel: number
- fansMedalLevel: number
- fansMedalName: string
- fansMedalWearingStatus: boolean
+ uid: number
+ guard_level: number
+ fans_medal_level: number
+ fans_medal_name: string
+ fans_medal_wearing_status: boolean
}
export enum SongRequestFrom {
@@ -286,4 +309,24 @@ export enum SongRequestStatus {
Singing,
Finish,
Cancel,
+}
+export interface EventModel {
+ type: EventDataTypes
+ name: string
+ avatar: string
+ uid: number
+ msg: string
+ time: number
+ num: number
+ price: number
+ guard_level: number
+ fans_medal_level: number
+ fans_medal_name: string
+ fans_medal_wearing_status: boolean
+}
+export enum EventDataTypes {
+ Guard,
+ SC,
+ Gift,
+ Message,
}
\ No newline at end of file
diff --git a/src/data/constants.ts b/src/data/constants.ts
index e541e04..1a5027f 100644
--- a/src/data/constants.ts
+++ b/src/data/constants.ts
@@ -23,6 +23,8 @@ export const HISTORY_API_URL = `${BASE_API}history/`
export const SCHEDULE_API_URL = `${BASE_API}schedule/`
export const VIDEO_COLLECT_API_URL = `${BASE_API}video-collect/`
export const OPEN_LIVE_API_URL = `${BASE_API}open-live/`
+export const SONG_REQUEST_API_URL = `${BASE_API}song-request/`
+export const EVENT_API_URL = `${BASE_API}event/`
export const ScheduleTemplateMap = {
'': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')) },
diff --git a/src/data/notifactions.ts b/src/data/notifactions.ts
index 4f36b45..21eba69 100644
--- a/src/data/notifactions.ts
+++ b/src/data/notifactions.ts
@@ -1,6 +1,6 @@
import { QueryGetAPI } from '@/api/query'
import { useRequest } from 'vue-request'
-import { NOTIFACTION_API_URL, isBackendUsable } from './constants'
+import { NOTIFACTION_API_URL, SONG_REQUEST_API_URL, isBackendUsable } from './constants'
import { NotifactionInfo } from '@/api/api-models'
import { useAccount } from '@/api/account'
import { ref } from 'vue'
@@ -10,7 +10,7 @@ const n = ref()
let isLoading = false
function get() {
if (isLoading) return
- QueryGetAPI(NOTIFACTION_API_URL + 'get')
+ QueryGetAPI(SONG_REQUEST_API_URL + 'get-active')
.then((data) => {
if (data.code == 200) {
n.value = data.data
diff --git a/src/views/OpenLiveLayout.vue b/src/views/OpenLiveLayout.vue
index 48ea756..77dbd35 100644
--- a/src/views/OpenLiveLayout.vue
+++ b/src/views/OpenLiveLayout.vue
@@ -29,8 +29,9 @@ import {
useMessage,
NDivider,
NTag,
+NAlert,
} from 'naive-ui'
-import { ref, onMounted, h } from 'vue'
+import { ref, onMounted, h, onUnmounted } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
const route = useRoute()
@@ -89,6 +90,9 @@ onMounted(async () => {
message.error('你不是从幻星平台访问此页面, 或未提供对应参数, 无法使用此功能')
}
})
+onUnmounted(() => {
+ client.value?.Stop()
+})
@@ -108,7 +112,7 @@ onMounted(async () => {
- {{ client ? `已连接 | ${client.roomAuthInfo.value?.anchor_info.uname}` : '未连接' }}
+ {{ client?.roomAuthInfo.value ? `已连接 | ${client.roomAuthInfo.value?.anchor_info.uname}` : '未连接' }}
themeType = value ? ThemeType.Light : ThemeType.Dark">
@@ -152,14 +156,16 @@ onMounted(async () => {
-
-
+
+
-
+
+
+
diff --git a/src/views/manage/SettingsManageView.vue b/src/views/manage/SettingsManageView.vue
index 8a32a24..2fedcdd 100644
--- a/src/views/manage/SettingsManageView.vue
+++ b/src/views/manage/SettingsManageView.vue
@@ -1,5 +1,5 @@
开发中...
-
-
-
-
-
-
diff --git a/src/views/open_live/OpenLottery.vue b/src/views/open_live/OpenLottery.vue
index 164eb27..d0d1677 100644
--- a/src/views/open_live/OpenLottery.vue
+++ b/src/views/open_live/OpenLottery.vue
@@ -333,193 +333,200 @@ onUnmounted(() => {
-
-
-
+
+
+
+
+ 直播抽奖
+
+ 前往 VTsuru.live 主站
+
+ 请先绑定B站账号
+ 身份码状态异常, 请重新绑定
-
- 直播抽奖
-
- 前往 VTsuru.live 主站
+
+ 抽奖历史
+ OBS组件
+
+
+
+
+ 恢复默认
- 请先绑定B站账号
- 身份码状态异常, 请重新绑定
-
-
- 抽奖历史
- OBS组件
-
-
-
-
- 恢复默认
-
-
- 抽奖类型
-
- 弹幕
- 礼物
-
-
-
-
-
- 抽选人数
-
+
+ 抽奖类型
+
+ 弹幕
+ 礼物
+
+
+
+
+
+ 抽选人数
+
+
+ 需要上舰
+ 需要粉丝牌
+
+
+ 最低粉丝牌等级
+
- 需要上舰
- 需要粉丝牌
-
-
- 最低粉丝牌等级
-
-
-
-
+
+
+
+
+
+ 弹幕内容
+
+
+
+ 符合规则的弹幕才会被添加到抽奖队列中
+
+
+ 完全一致
+ 包含
+ 正则
+
+
+
+
+ 最低价格
+
+
+
+ 礼物名称
+
+
+
+
+
+
+ 抽取方式
+
+
+ 单个
-
- 弹幕内容
-
-
+
- 符合规则的弹幕才会被添加到抽奖队列中
+ 一个一个减少
-
- 完全一致
- 包含
- 正则
-
-
-
-
- 最低价格
-
-
-
- 礼物名称
-
-
-
-
-
-
- 抽取方式
-
-
- 单个
-
-
-
-
- 一个一个减少
-
-
-
- 减半
-
-
-
-
- 点一次减少一半
-
-
-
-
-
-
-
- 开始
- 停止
- 清空
-
- 进行抽取前需要先停止
-
- 进行抽取
- 重置
-
- 共 {{ currentUsers?.length }} 人
-
-
-
-
-
-
-
-
-
- {{ item.fans_medal_level }}
-
-
- {{ item.fans_medal_name }}
-
-
-
- 无粉丝牌
- {{ item.name }}
-
-
-
-
-
-
-
+
+
+ 减半
+
+
+
-
-
-
-
-
+ 点一次减少一半
+
+
+
+
-
-
-
- 清空
-
-
-
-
-
+
+
+ 开始
+ 停止
+ 清空
+
+ 进行抽取前需要先停止
+
+
+ 进行抽取
+
+ 重置
+
+ 共 {{ currentUsers?.length }} 人
+
+
+
-
-
-
- 删除
-
-
-
-
- {{ user.name }}
+
+
+
+
+
+ {{ item.fans_medal_level }}
+
+
+ {{ item.fans_medal_name }}
+
+
+
+ 无粉丝牌
+ {{ item.name }}
-
-
-
-
-
-
-
-
- 将等待队列以及结果显示在OBS中
- 浏览
-
-
-
-
-
-
-
-
-
- 在 OBS 来源中添加源, 选择 浏览器
- 在 URL 栏填入上方链接
- 根据自己的需要调整宽度和高度
- 完事
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 清空
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+ {{ user.name }}
+
+
+
+
+
+
+
+
+
+ 将等待队列以及结果显示在OBS中
+ 浏览
+
+
+
+
+
+
+
+
+
+ 在 OBS 来源中添加源, 选择 浏览器
+ 在 URL 栏填入上方链接
+ 根据自己的需要调整宽度和高度
+ 完事
+
+
+
+
+
+
-@/data/DanmakuClient