diff --git a/src/api/account.ts b/src/api/account.ts
index 8ab864f..3b31c4e 100644
--- a/src/api/account.ts
+++ b/src/api/account.ts
@@ -63,6 +63,38 @@ export async function SaveAccountSettings() {
export async function SaveEnableFunctions(functions: FunctionTypes[]) {
return await QueryPostAPI(ACCOUNT_API_URL + 'update-enable-functions', functions)
}
+export async function UpdateFunctionEnable(func: FunctionTypes) {
+ if (ACCOUNT.value) {
+ const oldValue = JSON.parse(JSON.stringify(ACCOUNT.value.settings.enableFunctions))
+ if (ACCOUNT.value?.settings.enableFunctions.includes(func)) {
+ ACCOUNT.value.settings.enableFunctions = ACCOUNT.value.settings.enableFunctions.filter(
+ (f) => f != func,
+ )
+ } else {
+ ACCOUNT.value.settings.enableFunctions.push(func)
+ }
+ await SaveEnableFunctions(ACCOUNT.value?.settings.enableFunctions)
+ .then((data) => {
+ if (data.code == 200) {
+ message.success(
+ `已${ACCOUNT.value?.settings.enableFunctions.includes(func) ? '启用' : '禁用'}`,
+ )
+ } else {
+ if (ACCOUNT.value) {
+ ACCOUNT.value.settings.enableFunctions = oldValue
+ }
+ message.error(
+ `${ACCOUNT.value?.settings.enableFunctions.includes(func) ? '启用' : '禁用'}失败: ${data.message}`,
+ )
+ }
+ })
+ .catch((err) => {
+ message.error(
+ `${ACCOUNT.value?.settings.enableFunctions.includes(func) ? '启用' : '禁用'}失败: ${err}`,
+ )
+ })
+ }
+}
export function useAccount() {
return ACCOUNT
}
diff --git a/src/api/api-models.ts b/src/api/api-models.ts
index ede1c39..4677d9b 100644
--- a/src/api/api-models.ts
+++ b/src/api/api-models.ts
@@ -234,6 +234,7 @@ export enum FunctionTypes {
SongRequest,
Queue,
Point,
+ VideoCollect
}
export interface SongAuthorInfo {
name: string
diff --git a/src/components/VideoCollectInfoCard.vue b/src/components/VideoCollectInfoCard.vue
index df22656..b5f0b9d 100644
--- a/src/components/VideoCollectInfoCard.vue
+++ b/src/components/VideoCollectInfoCard.vue
@@ -19,19 +19,25 @@ import {
const props = defineProps<{
item: VideoCollectTable
canClick?: boolean
+ from: 'user' | 'owner'
+ bordered?: boolean
}>()
const renderCountdown: CountdownProps['render'] = (info: { hours: number; minutes: number; seconds: number }) => {
return `${String(info.hours).padStart(2, '0')}时 ${String(info.minutes).padStart(2, '0')}分 ${String(info.seconds).padStart(2, '0')}秒`
}
function onClick() {
if (props.canClick == true) {
- router.push({ name: 'manage-videoCollect-Detail', params: { id: props.item.id } })
+ if (props.from == 'user') {
+ window.open('https://vtsuru.live/video-collect/' + props.item.shortId, '_blank')
+ } else {
+ router.push({ name: 'manage-videoCollect-Detail', params: { id: props.item.id } })
+ }
}
}
-
+
已结束
diff --git a/src/router/user.ts b/src/router/user.ts
index 63cd4ed..6b1e3ea 100644
--- a/src/router/user.ts
+++ b/src/router/user.ts
@@ -55,4 +55,13 @@ export default [
keepAlive: true,
},
},
+ {
+ path: 'video-collect',
+ name: 'user-video-collect',
+ component: () => import('@/views/view/VideoCollectView.vue'),
+ meta: {
+ title: '视频征集',
+ keepAlive: true,
+ },
+ },
]
diff --git a/src/views/IndexView.vue b/src/views/IndexView.vue
index efd17fa..9abef25 100644
--- a/src/views/IndexView.vue
+++ b/src/views/IndexView.vue
@@ -120,8 +120,21 @@ const iconColor = 'white'
一个给主播提供便利功能的网站 😊
-
- 开始使用
+
+
+
+ 我是主播
+
+ 开始使用
+
+
+
+ 我是观众
+
+ 用户主页
+
+
+
展示
{
{{ table.owner?.name }}
-
+
diff --git a/src/views/ViewerLayout.vue b/src/views/ViewerLayout.vue
index c342888..360e617 100644
--- a/src/views/ViewerLayout.vue
+++ b/src/views/ViewerLayout.vue
@@ -7,7 +7,7 @@ import { useUser } from '@/api/user'
import RegisterAndLogin from '@/components/RegisterAndLogin.vue'
import { FETCH_API } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
-import { BookCoins20Filled, CalendarClock24Filled } from '@vicons/fluent'
+import { BookCoins20Filled, CalendarClock24Filled, VideoAdd20Filled } from '@vicons/fluent'
import { Chatbox, Home, Moon, MusicalNote, Sunny } from '@vicons/ionicons5'
import { useElementSize, useStorage } from '@vueuse/core'
import {
@@ -145,6 +145,21 @@ onMounted(async () => {
key: 'user-questionBox',
icon: renderIcon(Chatbox),
},
+ {
+ label: () =>
+ h(
+ RouterLink,
+ {
+ to: {
+ name: 'user-video-collect',
+ },
+ },
+ { default: () => '视频征集' },
+ ),
+ show: (userInfo.value?.extra?.enableFunctions.indexOf(FunctionTypes.VideoCollect) ?? -1) > -1,
+ key: 'user-video-collect',
+ icon: renderIcon(VideoAdd20Filled),
+ },
{
label: () =>
h(
diff --git a/src/views/manage/VideoCollectDetailView.vue b/src/views/manage/VideoCollectDetailView.vue
index 2e3172b..ffe9541 100644
--- a/src/views/manage/VideoCollectDetailView.vue
+++ b/src/views/manage/VideoCollectDetailView.vue
@@ -387,7 +387,7 @@ onActivated(async () => {
-
+
分享
diff --git a/src/views/manage/VideoCollectManageView.vue b/src/views/manage/VideoCollectManageView.vue
index f64ce75..c863c2c 100644
--- a/src/views/manage/VideoCollectManageView.vue
+++ b/src/views/manage/VideoCollectManageView.vue
@@ -1,11 +1,12 @@
+
+ 在个人主页展示进行中的征集表
+
+
+
新建征集表
@@ -132,9 +142,9 @@ function createTable() {
-
-
-
+
+
+
diff --git a/src/views/open_live/LiveRequest.vue b/src/views/open_live/LiveRequest.vue
index d028f2c..eb3873c 100644
--- a/src/views/open_live/LiveRequest.vue
+++ b/src/views/open_live/LiveRequest.vue
@@ -180,7 +180,7 @@ const filterSongNameContains = ref(false)
const filterName = ref('')
const filterNameContains = ref(false)
-const defaultPrefix = useStorage('Settings.SongRequest.DefaultPrefix', '点歌')
+const defaultPrefix = useStorage('Settings.SongRequest.DefaultPrefix', '点播')
const configCanEdit = computed(() => {
return accountInfo.value != null && accountInfo.value != undefined
})
diff --git a/src/views/view/VideoCollectView.vue b/src/views/view/VideoCollectView.vue
index a105ade..0072eb4 100644
--- a/src/views/view/VideoCollectView.vue
+++ b/src/views/view/VideoCollectView.vue
@@ -1,15 +1,53 @@
- 1
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+