@@ -48,10 +53,11 @@ export default defineComponent({
settings.state.siderDirection = 'right'
}}
class={clsx(
- 'bg-white flex items-end w-full flex-col h-[92px] p-3 justify-between rounded-lg cursor-pointer border-[1px] ',
+ ' flex items-end w-full flex-col h-[92px] p-3 justify-between rounded-lg cursor-pointer border-[1px] ',
settings.state.siderDirection === 'right'
? 'border-[#ffa94d]'
- : 'border-transparent'
+ : 'border-transparent',
+ layout.state.current === 0 ? 'bg-[#7B7C85]' : 'bg-white'
)}
>
diff --git a/src/layout/grid/WelcomePage.tsx b/src/layout/grid/WelcomePage.tsx
new file mode 100644
index 0000000..cb120fa
--- /dev/null
+++ b/src/layout/grid/WelcomePage.tsx
@@ -0,0 +1,141 @@
+import { computed, defineComponent, onMounted, ref, Transition } from 'vue'
+import WelcomeImg from '~/public/icons/welcome/welcomeTitle.png'
+import DivBgImg from '~/public/icons/welcome/back.png'
+import startUseImg from '~/public/icons/welcome/startUse.png'
+import useBackgroundStore from '../background/useBackgroundStore'
+import useLayoutStore from '../useLayoutStore'
+export const DefaultPageSetting = [
+ {
+ name: '游戏',
+ backgroundUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/831a4d4c-61ff-4bae-ad31-9c0f4fa2db1c.webp',
+ contentUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/b2f3ed2f-f550-499b-8ea1-dfd192cfd388.webp',
+ desct: '聚合多类游戏工具,以及 资讯、排行榜'
+ },
+ {
+ name: '工作台',
+ backgroundUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/b82fd47c-24c1-4f58-b0db-51414b3bdda4.webp',
+ contentUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/7e4cf74a-85cb-4e39-9e61-385b222ac8c4.webp',
+ desct: '结合番茄计时法等效率工具,让您可以高效学'
+ },
+ {
+ name: '轻娱',
+ backgroundUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/73164094-cb0d-4366-8d1a-afc84ac119cc.webp',
+ contentUrl:
+ 'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/bcbbffc6-c8a4-4c8e-8ba5-36fa1fbad4f9.webp',
+ desct: '综合办公、学习、游戏等 属性,功能较为均'
+ }
+]
+export default defineComponent(() => {
+ const show = computed(() => true)
+ const selectMode = ref(0)
+ const layout = useLayoutStore()
+
+ const isFirst = ref(false)
+ onMounted(() => {
+ // 检查 localStorage 是否已经有访问记录
+ const visited = localStorage.getItem('hasVisited')
+
+ if (!visited) {
+ // 如果没有记录,说明是第一次访问
+ isFirst.value = true
+ // 设置标记,后续访问不会再次显示
+ }
+ })
+ return () =>
+ isFirst.value && (
+
+
+ {show.value && (
+ {}}
+ style={{
+ backgroundImage: `url('${DefaultPageSetting[selectMode.value].backgroundUrl}')`,
+ backgroundSize: '100% 100%',
+ backgroundPosition: 'center center',
+ backgroundRepeat: 'no-repeat'
+ }}
+ >
+
{}}>
+
+ )}
+
+
+
+
+ 请选择您的初始模式
+
+
+
+
+ {DefaultPageSetting.map((item, idx) => (
+
{
+ selectMode.value = idx
+ }}
+ style={{
+ transform: `translate(${idx === selectMode.value ? 80 : idx === (selectMode.value + 1) % 2 ? 219 : -52}px) scale(${
+ idx === selectMode.value ? 1 : 0.85
+ })`,
+ backgroundImage: `url('${DivBgImg}')`,
+ backgroundSize: '100% 100%',
+ zIndex: selectMode.value === idx ? 10 : 0
+ }}
+ >
+
+
+ ))}
+
+
+
+
+ {DefaultPageSetting[selectMode.value].name}模式
+ {DefaultPageSetting[selectMode.value].desct}
+
+
{
+ localStorage.setItem('hasVisited', 'true')
+ isFirst.value = false
+ layout.changeBackground(DefaultPageSetting[selectMode.value].backgroundUrl)
+ }}
+ style={{
+ backgroundImage: `url('${startUseImg}')`,
+ backgroundSize: '100% 100%',
+ backgroundPosition: 'center center',
+ backgroundRepeat: 'no-repeat'
+ }}
+ >
+ 开始使用
+
+
+
+
+ )
+})
diff --git a/src/layout/sider/index.tsx b/src/layout/sider/index.tsx
index e517b56..4f5a9b1 100644
--- a/src/layout/sider/index.tsx
+++ b/src/layout/sider/index.tsx
@@ -80,6 +80,9 @@ export default defineComponent(() => {
'w-[130px] min-h-[620px] hover:bg-red-10 z-20 fixed top-1/2 -translate-y-1/2 bottom-0 ',
settings.state.siderDirection === 'left' ? 'left-0' : 'right-0'
)}
+ onDragover={() => {
+ show.value = true
+ }}
onMouseleave={() => {
show.value = false
}}
diff --git a/src/settings/SettingItem.tsx b/src/settings/SettingItem.tsx
index c1a4026..f0664b1 100644
--- a/src/settings/SettingItem.tsx
+++ b/src/settings/SettingItem.tsx
@@ -1,5 +1,6 @@
+import useLayoutStore from '@/layout/useLayoutStore'
import clsx from 'clsx'
-import { defineComponent, type SlotsType, type VNode } from 'vue'
+import { computed, defineComponent, type SlotsType, type VNode } from 'vue'
export default defineComponent({
props: {
@@ -22,18 +23,25 @@ export default defineComponent({
end?: () => VNode[]
}>,
setup(props, ctx) {
+ const layout = useLayoutStore()
+ const isGame = computed(() => {
+ return layout.state.current === 0
+ })
return () => (
-
{ctx.slots.label?.()}
+
+ {ctx.slots.label?.()}
+
{ctx.slots.default?.()}
{/* {ctx.slots.end?.()} */}
diff --git a/src/settings/SettingsOverlay.tsx b/src/settings/SettingsOverlay.tsx
index 05a7446..4c890f9 100644
--- a/src/settings/SettingsOverlay.tsx
+++ b/src/settings/SettingsOverlay.tsx
@@ -1,7 +1,12 @@
+import useLayoutStore from '@/layout/useLayoutStore'
import AvatarCircle from '@/user/AvatarCircle'
+import useUserStore from '@/user/useUserStore'
import useRouterStore from '@/useRouterStore'
import asyncLoader from '@/utils/asyncLoader'
+import clsx from 'clsx'
+import { OhVueIcon } from 'oh-vue-icons'
import { computed, defineComponent, Transition } from 'vue'
+import SettingLineImg from '~/public/icons/settingLine.png'
const Content = asyncLoader(() => import('./SettingsOverlayContent'))
const SettingsTab = defineComponent({
@@ -17,12 +22,23 @@ const SettingsTab = defineComponent({
},
setup(props) {
const router = useRouterStore()
+ const layout = useLayoutStore()
+ const isGame = computed(() => {
+ return layout.state.current === 0
+ })
return () => (
{
router.go(props.path as any)
}}
@@ -35,7 +51,12 @@ const SettingsTab = defineComponent({
export default defineComponent(() => {
const router = useRouterStore()
+ const { profile } = useUserStore()
const show = computed(() => router.path.startsWith('settings-'))
+ const layout = useLayoutStore()
+ const isGame = computed(() => {
+ return layout.state.current === 0
+ })
return () => (
{/* 背景遮罩 */}
@@ -50,31 +71,64 @@ export default defineComponent(() => {
{/* 弹框主体 */}
{show.value && (
-
-
+
+
{
- router.go('settings-user')
- }}
>
-
-
+
+ {profile.id ? (
+
{
+ router.go('settings-user')
+ }}
+ >
+
+
+ ) : (
+
{
+ router.go('settings-user')
+ }}
+ >
+ 登录注册
+
+ )}
-
-
-
-
-
-
-
-
-
-
+ {isGame.value ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/user/UserPage.tsx b/src/user/UserPage.tsx
index 6766d4a..f8afa8a 100644
--- a/src/user/UserPage.tsx
+++ b/src/user/UserPage.tsx
@@ -5,11 +5,14 @@ import AvatarCircle from './AvatarCircle'
import useUserStore from './useUserStore'
import { EditOutlined, LoginOutlined, LogoutOutlined } from '@ant-design/icons-vue'
import { globalToast } from '@/main'
+import clsx from 'clsx'
+import useLayoutStore from '@/layout/useLayoutStore'
-const labelStyle = 'w-16 text-black/60'
+const labelStyle = 'w-16'
export default defineComponent(() => {
const router = useRouterStore()
+ const layout = useLayoutStore()
const user = useUserStore()
return () => (
@@ -19,7 +22,12 @@ export default defineComponent(() => {
{user.isLogin && (
-
+
用户名:
@@ -52,6 +60,7 @@ export default defineComponent(() => {
}
onClick={() => {
Modal.confirm({
diff --git a/vite.config.ts b/vite.config.ts
index fd1ddb0..45b5c4d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -30,7 +30,8 @@ export default defineConfig({
base: '/tab',
resolve: {
alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
+ '~': fileURLToPath(new URL('./', import.meta.url))
}
},
build: {