add question display page

This commit is contained in:
2024-02-20 22:03:49 +08:00
parent e4c8839491
commit 6bf003d18b
21 changed files with 1427 additions and 573 deletions

View File

@@ -5,9 +5,11 @@ import { isSameDay } from 'date-fns'
import { createDiscreteApi } from 'naive-ui'
import { ref } from 'vue'
import { APIRoot, AccountInfo, FunctionTypes } from './api-models'
import { useRoute } from 'vue-router'
export const ACCOUNT = ref<AccountInfo>()
export const isLoadingAccount = ref(true)
const route = useRoute()
const { message } = createDiscreteApi(['message'])
const cookie = useLocalStorage('JWT_Token', '')
@@ -40,7 +42,8 @@ export async function GetSelfAccount() {
}
export function UpdateAccountLoop() {
setInterval(() => {
if (ACCOUNT.value) {
if (ACCOUNT.value && route?.name != 'question-display') {
// 防止在问题详情页刷新
GetSelfAccount()
}
}, 60 * 1000)
@@ -93,7 +96,7 @@ export async function DelBiliBlackList(id: number): Promise<APIRoot<unknown>> {
id: id,
})
}
export function downloadConfigDirect<T>(name: string) {
export function downloadConfigDirect(name: string) {
return QueryGetAPI<string>(VTSURU_API_URL + 'get-config', {
name: name,
})

View File

@@ -91,6 +91,7 @@ export interface UserSetting {
songRequest: Setting_SongRequest
queue: Setting_Queue
point: Setting_Point
questionDisplay: Setting_QuestionDisplay
enableFunctions: FunctionTypes[]
@@ -169,6 +170,32 @@ export interface Setting_Point {
giftPointPercent: number // double maps to number in TypeScript
giftAllowType: SettingPointGiftAllowType
}
export interface Setting_QuestionDisplay {
font?: string // Optional string, with a maximum length of 30 characters
nameFont: string // Optional string, with a maximum length of 30 characters
fontSize: number // Default is 20
fontWeight: number
nameFontSize: number // Default is 20
lineSpacing: number // Default is 0, 行间距
fontColor?: string // Optional string, must exactly be 6 characters long
nameFontColor?: string // Optional string, must exactly be 6 characters long
nameFontWeight?: number
backgroundColor?: string // Optional string, must exactly be 6 characters long
showUserName: boolean // Default is true
align: QuestionDisplayAlign // Default is QuestionDisplayAlign.Left, 对齐
showImage: boolean // Default is false
borderColor?: string
borderWidth?: number
currentQuestion?: number
}
export enum QuestionDisplayAlign {
Left,
Right,
Center,
}
export enum SettingPointGiftAllowType {
All,
WhiteList,