mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
optimize layout
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
NButton,
|
||||
NCountdown,
|
||||
NDivider,
|
||||
NElement,
|
||||
NFlex,
|
||||
NIcon,
|
||||
NLayout,
|
||||
@@ -483,7 +484,7 @@ onMounted(() => {
|
||||
<template #extra>
|
||||
<NSpace align="center" justify="center">
|
||||
<NSwitch :default-value="!isDarkMode" @update:value="(value: string & number & boolean) => (themeType = value ? ThemeType.Light : ThemeType.Dark)
|
||||
">
|
||||
">
|
||||
<template #checked>
|
||||
<NIcon :component="Sunny" />
|
||||
</template>
|
||||
@@ -550,39 +551,40 @@ onMounted(() => {
|
||||
</NLayoutSider>
|
||||
<NLayout>
|
||||
<NScrollbar :style="`height: calc(100vh - 50px - ${aplayerHeight}px)`">
|
||||
<NLayoutContent
|
||||
:style="`box-sizing: border-box; padding: 20px; min-width: 300px; height: calc(100vh - 50px - ${aplayerHeight}px);`">
|
||||
<RouterView v-if="accountInfo?.isEmailVerified" v-slot="{ Component, route }">
|
||||
<KeepAlive>
|
||||
<Suspense>
|
||||
<component :is="Component" />
|
||||
<template #fallback>
|
||||
<NSpin show />
|
||||
</template>
|
||||
</Suspense>
|
||||
</KeepAlive>
|
||||
</RouterView>
|
||||
<template v-else>
|
||||
<NAlert type="info">
|
||||
请进行邮箱验证
|
||||
<br /><br />
|
||||
<NSpace>
|
||||
<NButton size="small" type="info" :disabled="!canResendEmail" @click="resendEmail">
|
||||
重新发送验证邮件
|
||||
</NButton>
|
||||
<NCountdown v-if="!canResendEmail" :duration="(accountInfo?.nextSendEmailTime ?? 0) - Date.now()"
|
||||
@finish="canResendEmail = true" />
|
||||
|
||||
<NPopconfirm @positive-click="logout" size="small">
|
||||
<template #trigger>
|
||||
<NButton type="error"> 登出 </NButton>
|
||||
<NLayoutContent content-style="margin: 12px">
|
||||
<NElement>
|
||||
<RouterView v-if="accountInfo?.isEmailVerified" v-slot="{ Component, route }">
|
||||
<KeepAlive>
|
||||
<Suspense>
|
||||
<component :is="Component" />
|
||||
<template #fallback>
|
||||
<NSpin show />
|
||||
</template>
|
||||
确定登出?
|
||||
</NPopconfirm>
|
||||
</NSpace>
|
||||
</NAlert>
|
||||
</template>
|
||||
<NBackTop />
|
||||
</Suspense>
|
||||
</KeepAlive>
|
||||
</RouterView>
|
||||
<template v-else>
|
||||
<NAlert type="info">
|
||||
请进行邮箱验证
|
||||
<br /><br />
|
||||
<NSpace>
|
||||
<NButton size="small" type="info" :disabled="!canResendEmail" @click="resendEmail">
|
||||
重新发送验证邮件
|
||||
</NButton>
|
||||
<NCountdown v-if="!canResendEmail" :duration="(accountInfo?.nextSendEmailTime ?? 0) - Date.now()"
|
||||
@finish="canResendEmail = true" />
|
||||
|
||||
<NPopconfirm @positive-click="logout" size="small">
|
||||
<template #trigger>
|
||||
<NButton type="error"> 登出 </NButton>
|
||||
</template>
|
||||
确定登出?
|
||||
</NPopconfirm>
|
||||
</NSpace>
|
||||
</NAlert>
|
||||
</template>
|
||||
<NBackTop />
|
||||
</NElement>
|
||||
</NLayoutContent>
|
||||
</NScrollbar>
|
||||
<NLayoutFooter :style="`height: ${aplayerHeight}px;overflow: auto`">
|
||||
|
||||
@@ -273,10 +273,10 @@ onMounted(async () => {
|
||||
style="height: 100%"
|
||||
>
|
||||
<Transition>
|
||||
<div v-if="biliUserInfo" style="margin-top: 8px">
|
||||
<div v-if="accountInfo.streamerInfo" style="margin-top: 8px">
|
||||
<NSpace vertical justify="center" align="center">
|
||||
<NAvatar
|
||||
:src="biliUserInfo.face"
|
||||
:src="accountInfo.streamerInfo.faceUrl"
|
||||
:img-props="{ referrerpolicy: 'no-referrer' }"
|
||||
round
|
||||
bordered
|
||||
@@ -286,7 +286,7 @@ onMounted(async () => {
|
||||
/>
|
||||
<NEllipsis v-if="width > 100" style="max-width: 100%">
|
||||
<NText strong>
|
||||
{{ biliUserInfo.name }}
|
||||
{{ accountInfo.streamerInfo.name }}
|
||||
</NText>
|
||||
</NEllipsis>
|
||||
</NSpace>
|
||||
|
||||
6
src/views/client/ClientLayout.vue
Normal file
6
src/views/client/ClientLayout.vue
Normal file
@@ -0,0 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<template>
|
||||
1
|
||||
</template>
|
||||
@@ -284,7 +284,7 @@ onMounted(() => {
|
||||
<QuestionItems :questions="pagedQuestions">
|
||||
<template #footer="{ item }">
|
||||
<NSpace>
|
||||
<NButton v-if="!item.isReaded" size="small" @click="useQB.read(item, true)" type="success">
|
||||
<NButton v-if="!item.isReaded" size="small" @click="useQB.read(item, true)" type="info">
|
||||
设为已读
|
||||
</NButton>
|
||||
<NButton v-else size="small" @click="useQB.read(item, false)" type="warning">重设为未读</NButton>
|
||||
|
||||
@@ -80,11 +80,11 @@ async function getSongs() {
|
||||
currentData.value = data.data
|
||||
} else {
|
||||
errMessage.value = data.message
|
||||
message.error('加载失败: ' + data.message)
|
||||
message.error('加载歌单失败: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('加载失败')
|
||||
message.error('加载失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
@@ -102,7 +102,7 @@ async function getConfig() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('加载失败')
|
||||
message.error('加载失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
@@ -154,9 +154,11 @@ onMounted(async () => {
|
||||
songsActive.value = r.songs
|
||||
settings.value = r.setting
|
||||
}
|
||||
}, 1000)
|
||||
await getConfig()
|
||||
}, 300)
|
||||
} catch (err) {
|
||||
message.error('加载失败')
|
||||
message.error('加载失败: ' + err)
|
||||
console.error(err)
|
||||
}
|
||||
} else {
|
||||
currentData.value = props.fakeData
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Setting_LiveRequest, SongRequestInfo, SongsInfo, UserInfo } from '@/api/api-models';
|
||||
import { SongListConfigType, SongListConfigTypeWithConfig } from '@/data/TemplateTypes';
|
||||
import { SongListConfigTypeWithConfig } from '@/data/TemplateTypes';
|
||||
import { TemplateConfig } from '@/data/VTsuruTypes';
|
||||
import { FILE_BASE_URL } from '@/data/constants';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user