2024-09-13 10:15:43 +08:00
|
|
|
import AvatarCircle from '@/user/AvatarCircle'
|
2024-09-09 17:53:07 +08:00
|
|
|
import useRouterStore from '@/useRouterStore'
|
|
|
|
import asyncLoader from '@/utils/asyncLoader'
|
2024-09-29 15:17:52 +08:00
|
|
|
import { OhVueIcon } from 'oh-vue-icons'
|
2024-09-09 17:53:07 +08:00
|
|
|
import { computed, defineComponent, Transition } from 'vue'
|
2024-09-13 12:19:12 +08:00
|
|
|
const Content = asyncLoader(() => import('./SettingsOverlayContent'))
|
2024-09-09 17:53:07 +08:00
|
|
|
|
|
|
|
const SettingsTab = defineComponent({
|
|
|
|
props: {
|
|
|
|
label: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
path: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
setup(props) {
|
|
|
|
const router = useRouterStore()
|
|
|
|
return () => (
|
|
|
|
<div
|
|
|
|
class={
|
|
|
|
'w-full h-[30px] leading-[30px] text-sm text-center rounded-lg text-slate-600 my-1 transition-all cursor-pointer hover:bg-white/70 ' +
|
|
|
|
(router.path === props.path ? 'bg-white/70 font-bold shadow-lg' : '')
|
|
|
|
}
|
|
|
|
onClick={() => {
|
|
|
|
router.path = props.path as any
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{props.label}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
export default defineComponent(() => {
|
|
|
|
const router = useRouterStore()
|
|
|
|
const show = computed(() => router.path.startsWith('settings-'))
|
|
|
|
return () => (
|
2024-09-11 13:46:40 +08:00
|
|
|
<div class="fixed left-0 bottom-0 z-40 w-full">
|
2024-09-09 17:53:07 +08:00
|
|
|
{/* 背景遮罩 */}
|
|
|
|
{show.value && (
|
|
|
|
<div
|
2024-09-13 18:27:39 +08:00
|
|
|
class="w-full h-screen"
|
2024-09-09 17:53:07 +08:00
|
|
|
onClick={() => {
|
|
|
|
router.path = ''
|
|
|
|
}}
|
|
|
|
></div>
|
|
|
|
)}
|
|
|
|
{/* 弹框主体 */}
|
|
|
|
<Transition name="settings">
|
|
|
|
{show.value && (
|
2024-09-11 13:46:40 +08:00
|
|
|
<div class="absolute left-6 bottom-20 w-[600px] h-[480px] rounded-lg overflow-hidden shadow-2xl flex">
|
2024-09-29 15:31:47 +08:00
|
|
|
<div class="w-[200px] p-4 h-full bg-white/60 backdrop-blur flex flex-col">
|
|
|
|
<div
|
|
|
|
class={
|
|
|
|
'w-full h-0 flex-grow mb-4 rounded-lg hover:bg-white/70 transition-all cursor-pointer flex justify-center items-center ' +
|
|
|
|
(router.path === 'settings-user' ? 'bg-white/70 shadow-lg' : '')
|
|
|
|
}
|
|
|
|
onClick={() => {
|
|
|
|
router.path = 'settings-user'
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div class="w-12 h-12 relative">
|
|
|
|
<AvatarCircle />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<SettingsTab label="壁纸" path="settings-background" />
|
|
|
|
<SettingsTab label="图标" path="settings-block" />
|
|
|
|
<SettingsTab label="搜索" path="settings-search" />
|
|
|
|
<SettingsTab label="时间" path="settings-time" />
|
|
|
|
<SettingsTab label="侧边栏" path="settings-sider" />
|
|
|
|
<SettingsTab label="AI助手" path="settings-ai" />
|
|
|
|
<SettingsTab label="快捷栏" path="settings-dock" />
|
|
|
|
<SettingsTab label="重置" path="settings-reset" />
|
|
|
|
<SettingsTab label="问题反馈" path="settings-fallback" />
|
|
|
|
</div>
|
|
|
|
<Content />
|
|
|
|
|
2024-09-29 15:17:52 +08:00
|
|
|
|
|
|
|
|
2024-09-09 17:53:07 +08:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Transition>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
})
|