optimize layout

This commit is contained in:
2025-03-22 03:27:08 +08:00
parent 543a2c0ae8
commit b96d10cb62
10 changed files with 65 additions and 57 deletions

View File

@@ -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`">

View File

@@ -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>

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
1
</template>

View File

@@ -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>

View File

@@ -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

View File

@@ -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';