create-young-proj 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +14 -0
- package/.vscode/settings.json +39 -0
- package/CHANGELOG.md +260 -0
- package/README.md +7 -3
- package/build.config.ts +22 -0
- package/eslint.config.js +35 -0
- package/package.json +1 -7
- package/src/index.ts +366 -0
- package/template-admin-server/.editorconfig +11 -0
- package/template-admin-server/.nvmrc +1 -0
- package/template-admin-server/.vscode/extensions.json +6 -0
- package/template-admin-server/.vscode/settings.json +4 -0
- package/template-admin-server/_gitignore +15 -0
- package/template-admin-server/_nvmrc +1 -0
- package/template-admin-server/boot.mjs +11 -0
- package/template-admin-server/package.json +60 -0
- package/template-admin-server/rome.json +22 -0
- package/template-admin-server/src/config/config.default.ts +56 -0
- package/template-admin-server/src/configuration.ts +47 -0
- package/template-admin-server/src/controller/admin.controller.ts +397 -0
- package/template-admin-server/src/controller/api.controller.ts +98 -0
- package/template-admin-server/src/controller/base.controller.ts +70 -0
- package/template-admin-server/src/controller/dto/api.ts +47 -0
- package/template-admin-server/src/controller/dto/index.ts +36 -0
- package/template-admin-server/src/controller/dto/menu.ts +41 -0
- package/template-admin-server/src/controller/dto/role.ts +41 -0
- package/template-admin-server/src/controller/dto/user.ts +52 -0
- package/template-admin-server/src/controller/menu.controller.ts +138 -0
- package/template-admin-server/src/controller/role.controller.ts +116 -0
- package/template-admin-server/src/controller/user.controller.ts +108 -0
- package/template-admin-server/src/entities/Api.ts +29 -0
- package/template-admin-server/src/entities/BaseCreate.ts +30 -0
- package/template-admin-server/src/entities/Menu.ts +39 -0
- package/template-admin-server/src/entities/Role.ts +36 -0
- package/template-admin-server/src/entities/User.ts +35 -0
- package/template-admin-server/src/entities/index.ts +10 -0
- package/template-admin-server/src/filter/default.filter.ts +22 -0
- package/template-admin-server/src/filter/notfound.filter.ts +23 -0
- package/template-admin-server/src/middleware/helper.middleware.ts +28 -0
- package/template-admin-server/src/middleware/index.ts +9 -0
- package/template-admin-server/src/middleware/jwt.middleware.ts +32 -0
- package/template-admin-server/src/middleware/report.middleware.ts +26 -0
- package/template-admin-server/src/service/api.service.ts +174 -0
- package/template-admin-server/src/service/basic.ts +118 -0
- package/template-admin-server/src/service/index.ts +10 -0
- package/template-admin-server/src/service/menu.service.ts +139 -0
- package/template-admin-server/src/service/role.service.ts +286 -0
- package/template-admin-server/src/service/user.service.ts +124 -0
- package/template-admin-server/src/strategy/jwt.strategy.ts +26 -0
- package/template-admin-server/src/types/index.ts +42 -0
- package/template-admin-server/src/types/types.d.ts +31 -0
- package/template-admin-server/tsconfig.json +24 -0
- package/template-nuxt-admin/.vscode/extensions.json +12 -0
- package/template-nuxt-admin/.vscode/settings.json +39 -0
- package/template-nuxt-admin/Dockerfile +41 -0
- package/template-nuxt-admin/_gitignore +23 -0
- package/template-nuxt-admin/_npmrc +2 -0
- package/template-nuxt-admin/_nvmrc +1 -0
- package/template-nuxt-admin/app.vue +49 -0
- package/template-nuxt-admin/boot.mjs +16 -0
- package/template-nuxt-admin/components/ScreenFull.vue +19 -0
- package/template-nuxt-admin/components/TopSearch.vue +76 -0
- package/template-nuxt-admin/components/TopUser.vue +72 -0
- package/template-nuxt-admin/components/YoungChangePassword.vue +94 -0
- package/template-nuxt-admin/components/YoungCodeInput.vue +65 -0
- package/template-nuxt-admin/components/YoungEditor.vue +81 -0
- package/template-nuxt-admin/components/YoungLink.vue +24 -0
- package/template-nuxt-admin/components/YoungLoading.vue +39 -0
- package/template-nuxt-admin/components/ZenMode.vue +21 -0
- package/template-nuxt-admin/components/layout/Footer.vue +29 -0
- package/template-nuxt-admin/components/layout/Logo.vue +54 -0
- package/template-nuxt-admin/components/layout/Main.vue +26 -0
- package/template-nuxt-admin/components/layout/NavBar.vue +90 -0
- package/template-nuxt-admin/components/layout/SideBar.vue +96 -0
- package/template-nuxt-admin/components/layout/SubMenu.vue +52 -0
- package/template-nuxt-admin/components/layout/TabsBar.vue +184 -0
- package/template-nuxt-admin/composables/api.ts +97 -0
- package/template-nuxt-admin/composables/apis/delete.ts +37 -0
- package/template-nuxt-admin/composables/apis/get.ts +83 -0
- package/template-nuxt-admin/composables/apis/index.ts +10 -0
- package/template-nuxt-admin/composables/apis/patch.ts +74 -0
- package/template-nuxt-admin/composables/apis/post.ts +85 -0
- package/template-nuxt-admin/composables/config.ts +13 -0
- package/template-nuxt-admin/composables/icon.ts +25 -0
- package/template-nuxt-admin/composables/nav.ts +85 -0
- package/template-nuxt-admin/composables/tags.ts +136 -0
- package/template-nuxt-admin/composables/user.ts +48 -0
- package/template-nuxt-admin/config/.devrc +1 -0
- package/template-nuxt-admin/config/.onlinerc +1 -0
- package/template-nuxt-admin/config/.testrc +1 -0
- package/template-nuxt-admin/env.d.ts +47 -0
- package/template-nuxt-admin/error.vue +61 -0
- package/template-nuxt-admin/eslint.config.js +33 -0
- package/template-nuxt-admin/layouts/blank.vue +9 -0
- package/template-nuxt-admin/layouts/default.vue +163 -0
- package/template-nuxt-admin/middleware/auth.global.ts +66 -0
- package/template-nuxt-admin/nuxt.config.ts +106 -0
- package/template-nuxt-admin/package.json +63 -0
- package/template-nuxt-admin/pages/home/[id].vue +28 -0
- package/template-nuxt-admin/pages/index.vue +15 -0
- package/template-nuxt-admin/pages/login.vue +199 -0
- package/template-nuxt-admin/pages/system/api.vue +177 -0
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +328 -0
- package/template-nuxt-admin/pages/system/menuList.vue +351 -0
- package/template-nuxt-admin/pages/system/role.vue +144 -0
- package/template-nuxt-admin/pages/system/user.vue +223 -0
- package/template-nuxt-admin/plugins/directive.ts +26 -0
- package/template-nuxt-admin/public/bg.webp +0 -0
- package/template-nuxt-admin/public/default_avatar.svg +1 -0
- package/template-nuxt-admin/public/favicon.svg +2 -0
- package/template-nuxt-admin/public/image_placeholder.svg +15 -0
- package/template-nuxt-admin/public/index.umd.js +74 -0
- package/template-nuxt-admin/public/index.umd.js.map +1 -0
- package/template-nuxt-admin/public/logo.svg +2 -0
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/server/api/[...all].ts +10 -0
- package/template-nuxt-admin/server/plugins/env.ts +88 -0
- package/template-nuxt-admin/server/routes/get/env.ts +13 -0
- package/template-nuxt-admin/server/tsconfig.json +3 -0
- package/template-nuxt-admin/server/utils/index.ts +36 -0
- package/template-nuxt-admin/styles/element.scss +30 -0
- package/template-nuxt-admin/styles/index.scss +59 -0
- package/template-nuxt-admin/styles/variable.scss +103 -0
- package/template-nuxt-admin/tsconfig.json +7 -0
- package/template-nuxt-admin/typings/global.d.ts +16 -0
- package/template-nuxt-admin/typings/system.d.ts +67 -0
- package/template-nuxt-admin/typings/user.d.ts +19 -0
- package/template-nuxt-admin/uno.config.ts +40 -0
- package/template-nuxt-admin/utils/tool.ts +195 -0
- package/template-nuxt-admin/yarn.lock +8398 -0
- package/template-nuxt-website/.nvmrc +1 -0
- package/template-nuxt-website/.vscode/extensions.json +12 -0
- package/template-nuxt-website/.vscode/settings.json +39 -0
- package/template-nuxt-website/Dockerfile +41 -0
- package/template-nuxt-website/_gitignore +26 -0
- package/template-nuxt-website/_npmrc +2 -0
- package/template-nuxt-website/_nvmrc +1 -0
- package/template-nuxt-website/app.vue +66 -0
- package/template-nuxt-website/assets/tabbar/event.png +0 -0
- package/template-nuxt-website/assets/tabbar/event_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/game.png +0 -0
- package/template-nuxt-website/assets/tabbar/game_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/shop.png +0 -0
- package/template-nuxt-website/assets/tabbar/shop_active.png +0 -0
- package/template-nuxt-website/assets/tabbar/user.png +0 -0
- package/template-nuxt-website/assets/tabbar/user_active.png +0 -0
- package/template-nuxt-website/boot.mjs +16 -0
- package/template-nuxt-website/components/AboutNav.vue +27 -0
- package/template-nuxt-website/components/BreadNav.vue +35 -0
- package/template-nuxt-website/components/Follow.vue +48 -0
- package/template-nuxt-website/components/FriendLink.vue +36 -0
- package/template-nuxt-website/components/mobile/NavBar.vue +50 -0
- package/template-nuxt-website/components/top/Extra.vue +50 -0
- package/template-nuxt-website/components/top/Nav.vue +87 -0
- package/template-nuxt-website/components/young/Banner.vue +100 -0
- package/template-nuxt-website/components/young/Footer.vue +44 -0
- package/template-nuxt-website/components/young/Header.vue +25 -0
- package/template-nuxt-website/components/young/Tabbar.vue +76 -0
- package/template-nuxt-website/composables/ad.ts +20 -0
- package/template-nuxt-website/composables/config.ts +11 -0
- package/template-nuxt-website/composables/nav.ts +30 -0
- package/template-nuxt-website/composables/share.ts +22 -0
- package/template-nuxt-website/composables/utils.ts +84 -0
- package/template-nuxt-website/config/.devrc +11 -0
- package/template-nuxt-website/config/.onlinerc +13 -0
- package/template-nuxt-website/config/.testrc +11 -0
- package/template-nuxt-website/env.d.ts +55 -0
- package/template-nuxt-website/error.vue +69 -0
- package/template-nuxt-website/eslint.config.js +34 -0
- package/template-nuxt-website/layouts/default.vue +80 -0
- package/template-nuxt-website/layouts/home.vue +75 -0
- package/template-nuxt-website/layouts/tabbar.vue +78 -0
- package/template-nuxt-website/nuxt.config.ts +98 -0
- package/template-nuxt-website/package.json +41 -0
- package/template-nuxt-website/pages/index.html.vue +16 -0
- package/template-nuxt-website/pages/index.vue +29 -0
- package/template-nuxt-website/pages/match.html.vue +23 -0
- package/template-nuxt-website/pages/news/[id].html.vue +57 -0
- package/template-nuxt-website/pages/news.html.vue +26 -0
- package/template-nuxt-website/pages/shop.html.vue +26 -0
- package/template-nuxt-website/public/favicon.ico +0 -0
- package/template-nuxt-website/public/robots.txt +2 -0
- package/template-nuxt-website/public/svg/image_placeholder.svg +15 -0
- package/template-nuxt-website/server/api/get_footer_info.get.ts +52 -0
- package/template-nuxt-website/server/api/get_gray_status.get.ts +38 -0
- package/template-nuxt-website/server/api/get_head_nav.get.ts +38 -0
- package/template-nuxt-website/server/api/get_home_banner.get.ts +28 -0
- package/template-nuxt-website/server/api/get_seo_info.get.ts +32 -0
- package/template-nuxt-website/server/middleware/platform.ts +11 -0
- package/template-nuxt-website/server/plugins/init.ts +147 -0
- package/template-nuxt-website/server/tsconfig.json +3 -0
- package/template-nuxt-website/server/utils/index.ts +12 -0
- package/template-nuxt-website/server/utils/proxy.ts +59 -0
- package/template-nuxt-website/tsconfig.json +4 -0
- package/template-nuxt-website/typings/banner.d.ts +30 -0
- package/template-nuxt-website/typings/nav.d.ts +34 -0
- package/template-nuxt-website/typings/system.d.ts +22 -0
- package/template-nuxt-website/uno.config.ts +40 -0
- package/template-nuxt-website/utils/tool.ts +171 -0
- package/template-nuxt-website/yarn.lock +8018 -0
- package/template-uni-app/.eslintignore +1 -0
- package/template-uni-app/.eslintrc +16 -0
- package/template-uni-app/.vscode/css.code-snippets +398 -0
- package/template-uni-app/.vscode/extensions.json +12 -0
- package/template-uni-app/.vscode/js.code-snippets +1669 -0
- package/template-uni-app/.vscode/settings.json +39 -0
- package/template-uni-app/.vscode/vue-html.code-snippets +682 -0
- package/template-uni-app/_env +3 -0
- package/template-uni-app/_env.development +11 -0
- package/template-uni-app/_env.production +8 -0
- package/template-uni-app/_env.test +11 -0
- package/template-uni-app/_gitignore +3 -0
- package/template-uni-app/_npmrc +2 -0
- package/template-uni-app/_nvmrc +1 -0
- package/template-uni-app/auto-imports.d.ts +413 -0
- package/template-uni-app/components.d.ts +17 -0
- package/template-uni-app/custom-plugins/index.ts +7 -0
- package/template-uni-app/custom-plugins/multiconf.ts +74 -0
- package/template-uni-app/eslint.config.js +35 -0
- package/template-uni-app/index.html +23 -0
- package/template-uni-app/manifest.config.ts +88 -0
- package/template-uni-app/package.json +109 -0
- package/template-uni-app/pages.config.ts +58 -0
- package/template-uni-app/pnpm-lock.yaml +10981 -0
- package/template-uni-app/src/App.vue +79 -0
- package/template-uni-app/src/apis/index.ts +54 -0
- package/template-uni-app/src/apis/requests/get.ts +52 -0
- package/template-uni-app/src/apis/requests/index.ts +8 -0
- package/template-uni-app/src/apis/requests/post.ts +23 -0
- package/template-uni-app/src/components/young-loading/young-loading.vue +36 -0
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +35 -0
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +252 -0
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +145 -0
- package/template-uni-app/src/config/enum.ts +47 -0
- package/template-uni-app/src/config/index.ts +8 -0
- package/template-uni-app/src/config/map.ts +15 -0
- package/template-uni-app/src/env.d.ts +36 -0
- package/template-uni-app/src/layouts/default.vue +22 -0
- package/template-uni-app/src/layouts/tabbar.vue +38 -0
- package/template-uni-app/src/main.ts +20 -0
- package/template-uni-app/src/manifest.json +75 -0
- package/template-uni-app/src/pages/demo/index.vue +30 -0
- package/template-uni-app/src/pages/index.vue +65 -0
- package/template-uni-app/src/pages/my.vue +30 -0
- package/template-uni-app/src/pages.json +74 -0
- package/template-uni-app/src/static/back.png +0 -0
- package/template-uni-app/src/static/h.png +0 -0
- package/template-uni-app/src/static/home.png +0 -0
- package/template-uni-app/src/static/home_active.png +0 -0
- package/template-uni-app/src/static/more.png +0 -0
- package/template-uni-app/src/static/my.png +0 -0
- package/template-uni-app/src/static/my_active.png +0 -0
- package/template-uni-app/src/static/network.png +0 -0
- package/template-uni-app/src/store/index.ts +16 -0
- package/template-uni-app/src/store/local/index.ts +42 -0
- package/template-uni-app/src/store/system.ts +21 -0
- package/template-uni-app/src/typings/global.d.ts +7 -0
- package/template-uni-app/src/uni.scss +76 -0
- package/template-uni-app/src/utils/auth.ts +204 -0
- package/template-uni-app/src/utils/index.ts +11 -0
- package/template-uni-app/src/utils/map.ts +98 -0
- package/template-uni-app/src/utils/modal.ts +120 -0
- package/template-uni-app/src/utils/route.ts +151 -0
- package/template-uni-app/src/utils/system.ts +67 -0
- package/template-uni-app/tsconfig.json +16 -0
- package/template-uni-app/unocss.config.ts +30 -0
- package/template-uni-app/vite.config.ts +63 -0
- package/template-uni-app/volar.config.js +6 -0
- package/template-vue-mobile/.vscode/base.code-snippets +24 -0
- package/template-vue-mobile/.vscode/extensions.json +10 -0
- package/template-vue-mobile/.vscode/settings.json +7 -0
- package/template-vue-mobile/Dockerfile +42 -0
- package/template-vue-mobile/_env +6 -0
- package/template-vue-mobile/_gitignore +30 -0
- package/template-vue-mobile/boot.mjs +16 -0
- package/template-vue-mobile/build/custom-plugin.ts +30 -0
- package/template-vue-mobile/build/index.ts +7 -0
- package/template-vue-mobile/build/plugins.ts +68 -0
- package/template-vue-mobile/config/.devrc +2 -0
- package/template-vue-mobile/config/.onlinerc +1 -0
- package/template-vue-mobile/config/.testrc +1 -0
- package/template-vue-mobile/index.html +25 -0
- package/template-vue-mobile/nitro.config.ts +19 -0
- package/template-vue-mobile/package.json +48 -0
- package/template-vue-mobile/plugins/env.ts +26 -0
- package/template-vue-mobile/public/vite.svg +1 -0
- package/template-vue-mobile/rome.json +24 -0
- package/template-vue-mobile/routes/[...all].ts +11 -0
- package/template-vue-mobile/routes/get/env.ts +25 -0
- package/template-vue-mobile/src/App.vue +29 -0
- package/template-vue-mobile/src/auto-components.d.ts +24 -0
- package/template-vue-mobile/src/auto-imports.d.ts +289 -0
- package/template-vue-mobile/src/components/Init.vue +36 -0
- package/template-vue-mobile/src/global.d.ts +7 -0
- package/template-vue-mobile/src/hooks/useVerifyCode.ts +46 -0
- package/template-vue-mobile/src/layouts/blank.vue +9 -0
- package/template-vue-mobile/src/layouts/default.vue +27 -0
- package/template-vue-mobile/src/layouts/sub.vue +20 -0
- package/template-vue-mobile/src/main.ts +35 -0
- package/template-vue-mobile/src/modules/1-router.ts +40 -0
- package/template-vue-mobile/src/modules/2-pinia.ts +10 -0
- package/template-vue-mobile/src/modules/3-net.ts +46 -0
- package/template-vue-mobile/src/modules/4-auth.ts +64 -0
- package/template-vue-mobile/src/views/[...all_404].vue +557 -0
- package/template-vue-mobile/src/views/base/login.vue +110 -0
- package/template-vue-mobile/src/views/base/resetPasswd.vue +88 -0
- package/template-vue-mobile/src/views/index.vue +18 -0
- package/template-vue-mobile/src/views/my.vue +15 -0
- package/template-vue-mobile/src/views/sub.vue +18 -0
- package/template-vue-mobile/src/vite-env.d.ts +43 -0
- package/template-vue-mobile/tsconfig.json +21 -0
- package/template-vue-mobile/tsconfig.node.json +9 -0
- package/template-vue-mobile/unocss.config.ts +47 -0
- package/template-vue-mobile/vite.config.ts +32 -0
- package/template-vue-mobile/yarn.lock +4395 -0
- package/template-vue-thin/.vscode/extensions.json +10 -0
- package/template-vue-thin/.vscode/settings.json +4 -0
- package/template-vue-thin/_env +1 -0
- package/template-vue-thin/_gitignore +29 -0
- package/template-vue-thin/index.html +21 -0
- package/template-vue-thin/package.json +40 -0
- package/template-vue-thin/public/vite.svg +1 -0
- package/template-vue-thin/src/App.vue +9 -0
- package/template-vue-thin/src/layouts/blank.vue +9 -0
- package/template-vue-thin/src/layouts/default.vue +12 -0
- package/template-vue-thin/src/layouts/list.vue +12 -0
- package/template-vue-thin/src/main.ts +58 -0
- package/template-vue-thin/src/views/[...all_404].vue +488 -0
- package/template-vue-thin/src/views/index.vue +19 -0
- package/template-vue-thin/src/views/list.vue +17 -0
- package/template-vue-thin/src/vite-env.d.ts +22 -0
- package/template-vue-thin/tsconfig.json +21 -0
- package/template-vue-thin/tsconfig.node.json +9 -0
- package/template-vue-thin/unocss.config.ts +47 -0
- package/template-vue-thin/vite.config.ts +64 -0
- package/tsconfig.json +11 -0
- package/dist/index.mjs +0 -51
@@ -0,0 +1,44 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-27 14:40:31
|
4
|
+
* @LastEditTime: 2023-10-11 16:07:14
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const logo_bottom = ref('')
|
9
|
+
const friend_links = ref<FriendLinkItem[]>([])
|
10
|
+
const follow_us = ref<FollowItem[]>([])
|
11
|
+
const about_nav = ref<AboutNavItem[]>([])
|
12
|
+
|
13
|
+
const { data } = await useFetch('/api/get_footer_info')
|
14
|
+
|
15
|
+
if (!data.value)
|
16
|
+
throw createError('底部信息获取失败')
|
17
|
+
|
18
|
+
const beian = data.value.beian
|
19
|
+
logo_bottom.value = data.value.logo_bottom
|
20
|
+
friend_links.value = data.value.friend_links
|
21
|
+
follow_us.value = data.value.follow_us
|
22
|
+
about_nav.value = data.value.about_nav
|
23
|
+
</script>
|
24
|
+
|
25
|
+
<template>
|
26
|
+
<footer class="w-full " md="bg-[#4E5053]">
|
27
|
+
<div class="container py-50px mx-auto flex items-center h-[280px]" lt-md="!hidden">
|
28
|
+
<div class="img w-240px">
|
29
|
+
<NuxtLink to="/">
|
30
|
+
<img :src="logo_bottom" title="底部logo" alt="">
|
31
|
+
</NuxtLink>
|
32
|
+
</div>
|
33
|
+
<div class="info ml-117px text-white">
|
34
|
+
<FriendLink v-model="friend_links" />
|
35
|
+
<Follow v-model="follow_us" />
|
36
|
+
<AboutNav v-model="about_nav" />
|
37
|
+
|
38
|
+
<div class="text-12px font-500 text-gray-400 reset-img" v-html="beian" />
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<AboutNav v-model="about_nav" md="!hidden" class="container mx-auto px-10px" />
|
42
|
+
<div class="pt-0 pb-92px text-12px font-500 text-gray-400 reset-img container mx-auto px-10px" md="!hidden" v-html="beian" />
|
43
|
+
</footer>
|
44
|
+
</template>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-27 14:40:13
|
4
|
+
* @LastEditTime: 2023-11-07 17:56:32
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
const { logo_url } = storeToRefs(useNavStore())
|
9
|
+
const { showAd } = storeToRefs(useAdStore())
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<template>
|
13
|
+
<div class="w-full top-0 fixed bg-white z-10 shadow" lt-md="w-100vw shadow-none" :class="[showAd ? 'h-160px lt-md:h-80px' : 'h-80px lt-md:h-44px']">
|
14
|
+
<TopExtra v-if="showAd" />
|
15
|
+
<div class="container h-80px m-auto flex justify-between items-center" lt-md="h-44px">
|
16
|
+
<div class="left h-full flex items-center">
|
17
|
+
<NuxtLink class="logo" to="/">
|
18
|
+
<!-- 禁用懒加载插件,手动处理图片 -->
|
19
|
+
<img class="cursor-pointer" width="143" height="42" lt-md="px-10px h-30px w-auto" :src="getFullServerUrl(logo_url)" alt="" data-not-lazy loading="eager">
|
20
|
+
</NuxtLink>
|
21
|
+
<TopNav />
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</template>
|
@@ -0,0 +1,76 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-27 14:40:42
|
4
|
+
* @LastEditTime: 2023-11-08 10:41:02
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import game from '@/assets/tabbar/game.png'
|
9
|
+
import game_active from '@/assets/tabbar/game_active.png'
|
10
|
+
import event from '@/assets/tabbar/event.png'
|
11
|
+
import event_active from '@/assets/tabbar/event_active.png'
|
12
|
+
import shop from '@/assets/tabbar/shop.png'
|
13
|
+
import shop_active from '@/assets/tabbar/shop_active.png'
|
14
|
+
import user from '@/assets/tabbar/user.png'
|
15
|
+
import user_active from '@/assets/tabbar/user_active.png'
|
16
|
+
</script>
|
17
|
+
|
18
|
+
<template>
|
19
|
+
<VanTabbar
|
20
|
+
v-if="['/', '/match.html', '/shop.html', '/news.html'].includes($route.path)"
|
21
|
+
:model-value="$route.path" fixed placeholder safe-area-inset-bottom class="md:hidden bg-white" active-color="#0090EE" inactive-color="#C2D1E7"
|
22
|
+
>
|
23
|
+
<VanTabbarItem name="/" to="/">
|
24
|
+
<template #icon>
|
25
|
+
<img class="" width="20" height="20" :src="$route.path === '/' ? game_active : game" data-not-lazy loading="lazy" alt="">
|
26
|
+
</template>
|
27
|
+
<div title="游戏" class="btntxt">
|
28
|
+
游戏
|
29
|
+
</div>
|
30
|
+
</VanTabbarItem>
|
31
|
+
<VanTabbarItem name="/match.html" to="/match.html">
|
32
|
+
<template #icon>
|
33
|
+
<img class="" width="20" height="20" :src="$route.path === '/match.html' ? event_active : event" data-not-lazy loading="lazy" alt="">
|
34
|
+
</template>
|
35
|
+
<div title="赛事" class="btntxt">
|
36
|
+
赛事
|
37
|
+
</div>
|
38
|
+
</VanTabbarItem>
|
39
|
+
<VanTabbarItem name="/shop.html" to="/shop.html">
|
40
|
+
<template #icon>
|
41
|
+
<img
|
42
|
+
width="20" height="20"
|
43
|
+
class="" :src="$route.path.startsWith('/shop.html') ? shop_active : shop" data-not-lazy
|
44
|
+
loading="lazy"
|
45
|
+
alt=""
|
46
|
+
>
|
47
|
+
</template>
|
48
|
+
<div title="商城" class="btntxt">
|
49
|
+
商城
|
50
|
+
</div>
|
51
|
+
</VanTabbarItem>
|
52
|
+
<VanTabbarItem name="/news.html" to="/news.html">
|
53
|
+
<template #icon>
|
54
|
+
<img class="" width="20" height="20" :src="$route.path === '/news.html' ? user_active : user" data-not-lazy loading="lazy" alt="">
|
55
|
+
</template>
|
56
|
+
<div title="资讯" class="btntxt">
|
57
|
+
资讯
|
58
|
+
</div>
|
59
|
+
</VanTabbarItem>
|
60
|
+
</VanTabbar>
|
61
|
+
</template>
|
62
|
+
|
63
|
+
<style lang="scss" scoped>
|
64
|
+
.btntxt {
|
65
|
+
width: 24px;
|
66
|
+
height: 17px;
|
67
|
+
font-size: 12px;
|
68
|
+
font-family: PingFangSC-Medium, PingFang SC;
|
69
|
+
font-weight: 500;
|
70
|
+
line-height: 17px;
|
71
|
+
}
|
72
|
+
|
73
|
+
:deep(.van-tabbar-item) {
|
74
|
+
margin: 0 10px;
|
75
|
+
}
|
76
|
+
</style>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-27 17:12:10
|
4
|
+
* @LastEditTime: 2023-09-27 17:12:14
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export const useAdStore = defineStore('ad', () => {
|
8
|
+
const showAd = ref(false)
|
9
|
+
const img_ad = ref('')
|
10
|
+
const img_btn = ref('')
|
11
|
+
|
12
|
+
return {
|
13
|
+
showAd,
|
14
|
+
img_ad,
|
15
|
+
img_btn,
|
16
|
+
}
|
17
|
+
})
|
18
|
+
|
19
|
+
if (import.meta.hot)
|
20
|
+
import.meta.hot.accept(acceptHMRUpdate(useAdStore, import.meta.hot))
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-01 12:03:44
|
4
|
+
* @LastEditTime: 2023-10-11 19:40:10
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export const useNavStore = defineStore('useNavStore', () => {
|
8
|
+
const logo_url = ref('')
|
9
|
+
const kj_logo_url = ref('')
|
10
|
+
const nav_arr = ref<NavItem[]>([])
|
11
|
+
|
12
|
+
const active_nav = ref('')
|
13
|
+
|
14
|
+
const seo = ref<SeoInfo>({
|
15
|
+
title: '',
|
16
|
+
keywords: '',
|
17
|
+
description: '',
|
18
|
+
})
|
19
|
+
|
20
|
+
return {
|
21
|
+
logo_url,
|
22
|
+
kj_logo_url,
|
23
|
+
nav_arr,
|
24
|
+
active_nav,
|
25
|
+
seo,
|
26
|
+
}
|
27
|
+
})
|
28
|
+
|
29
|
+
if (import.meta.hot)
|
30
|
+
import.meta.hot.accept(acceptHMRUpdate(useNavStore, import.meta.hot))
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-25 15:01:47
|
4
|
+
* @LastEditTime: 2023-09-27 12:00:49
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export const useShareStore = defineStore('useShareStore', {
|
8
|
+
state: () => {
|
9
|
+
const jssdkShareSign = ref({
|
10
|
+
timestamp: '',
|
11
|
+
nonceStr: '',
|
12
|
+
signature: '',
|
13
|
+
})
|
14
|
+
|
15
|
+
return {
|
16
|
+
jssdkShareSign,
|
17
|
+
}
|
18
|
+
},
|
19
|
+
})
|
20
|
+
|
21
|
+
if (import.meta.hot)
|
22
|
+
import.meta.hot.accept(acceptHMRUpdate(useShareStore, import.meta.hot))
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2022-08-12 16:31:53
|
4
|
+
* @LastEditTime: 2023-11-07 18:01:33
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { createVNode, render } from 'vue'
|
8
|
+
|
9
|
+
export function goDownload(android?: string, ios?: string) {
|
10
|
+
const { isApple } = useDevice()
|
11
|
+
if (isApple)
|
12
|
+
ios && window.open(ios)
|
13
|
+
|
14
|
+
else
|
15
|
+
android && window.open(android)
|
16
|
+
}
|
17
|
+
|
18
|
+
export function closeWindow() {
|
19
|
+
if (process.server)
|
20
|
+
return
|
21
|
+
|
22
|
+
// @ts-expect-error
|
23
|
+
if (typeof WeixinJSBridge !== 'undefined') {
|
24
|
+
// @ts-expect-error 微信浏览器关闭窗口
|
25
|
+
WeixinJSBridge.call('closeWindow')
|
26
|
+
}
|
27
|
+
|
28
|
+
// @ts-expect-error
|
29
|
+
if (typeof AlipayJSBridge !== 'undefined') {
|
30
|
+
// @ts-expect-error 支付宝浏览器关闭窗口
|
31
|
+
AlipayJSBridge.call('popWindow')
|
32
|
+
}
|
33
|
+
// 其他关闭窗口
|
34
|
+
window.close()
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
export async function showLoading() {
|
40
|
+
if (process.server)
|
41
|
+
return
|
42
|
+
|
43
|
+
showLoadingToast({
|
44
|
+
message: '加载中...',
|
45
|
+
forbidClick: true,
|
46
|
+
})
|
47
|
+
}
|
48
|
+
|
49
|
+
export function hideLoading() {
|
50
|
+
if (process.server)
|
51
|
+
return
|
52
|
+
|
53
|
+
closeToast()
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* 异步插入组件
|
57
|
+
* @param El 组件实例
|
58
|
+
*/
|
59
|
+
export function injectComponent(El: ReturnType<typeof defineComponent>) {
|
60
|
+
if (process.server)
|
61
|
+
return false
|
62
|
+
|
63
|
+
const appendTo = document.createElement('div')
|
64
|
+
|
65
|
+
const onDestroy = () => {
|
66
|
+
try {
|
67
|
+
render(null, appendTo)
|
68
|
+
}
|
69
|
+
catch (error) {
|
70
|
+
console.info('remove child error', error)
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
const vnode = createVNode(El, {
|
75
|
+
onDestroy,
|
76
|
+
})
|
77
|
+
render(vnode, appendTo)
|
78
|
+
|
79
|
+
appendTo.firstElementChild && document.body.appendChild(appendTo.firstElementChild)
|
80
|
+
|
81
|
+
return onDestroy
|
82
|
+
}
|
83
|
+
|
84
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
VITE_WEBSITE_PC = https://intranet-dev-web-new2.laiyouxi.com:1443
|
2
|
+
VITE_WEBSITE_MOBILE = https://intranet-dev-mweb-new2.laiyouxi.com:1443
|
3
|
+
|
4
|
+
/**
|
5
|
+
* todo 管理后台,后端接口地址,ssr 数据获取
|
6
|
+
*/
|
7
|
+
VITE_BACKEND_SERVER = https://ssr.api.com
|
8
|
+
/**
|
9
|
+
* todo 管理后台,后端接口地址,浏览器端调用
|
10
|
+
*/
|
11
|
+
VITE_BACKEND_SERVER_CLIENT = https://client.api.com
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// 日志等级
|
2
|
+
CONSOLA_LEVEL = 2
|
3
|
+
VITE_WEBSITE_PC = https://www.laiyouxi.com
|
4
|
+
VITE_WEBSITE_MOBILE = https://m.laiyouxi.com
|
5
|
+
|
6
|
+
/**
|
7
|
+
* todo 管理后台,后端接口地址,ssr 数据获取
|
8
|
+
*/
|
9
|
+
VITE_BACKEND_SERVER = https://ssr.api.com
|
10
|
+
/**
|
11
|
+
* todo 管理后台,后端接口地址,浏览器端调用
|
12
|
+
*/
|
13
|
+
VITE_BACKEND_SERVER_CLIENT = https://client.api.com
|
@@ -0,0 +1,11 @@
|
|
1
|
+
VITE_WEBSITE_PC = https://intranet-test-web-new2.laiyouxi.com:1443
|
2
|
+
VITE_WEBSITE_MOBILE = https://intranet-test-mweb-new2.laiyouxi.com:1443
|
3
|
+
|
4
|
+
/**
|
5
|
+
* todo 管理后台,后端接口地址,ssr 数据获取
|
6
|
+
*/
|
7
|
+
VITE_BACKEND_SERVER = https://ssr.api.com
|
8
|
+
/**
|
9
|
+
* todo 管理后台,后端接口地址,浏览器端调用
|
10
|
+
*/
|
11
|
+
VITE_BACKEND_SERVER_CLIENT = https://client.api.com
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-05-26 11:50:06
|
4
|
+
* @LastEditTime: 2023-11-08 10:44:03
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
declare global {
|
8
|
+
/**
|
9
|
+
* 环境变量
|
10
|
+
*/
|
11
|
+
interface ImportMetaEnv {
|
12
|
+
/**
|
13
|
+
* 管理后台,后端接口地址,ssr 数据获取
|
14
|
+
*/
|
15
|
+
VITE_BACKEND_SERVER: string
|
16
|
+
/**
|
17
|
+
* 管理后台,后端接口地址,浏览器端调用
|
18
|
+
*/
|
19
|
+
VITE_BACKEND_SERVER_CLIENT: string
|
20
|
+
/**
|
21
|
+
* 微信公众号 appid,用于网页授权登录,SDK 签名等
|
22
|
+
*/
|
23
|
+
VITE_WECHAT_APPID: string
|
24
|
+
|
25
|
+
/**
|
26
|
+
* 后台上传的资源前缀
|
27
|
+
*/
|
28
|
+
VITE_OSS_URL: string
|
29
|
+
|
30
|
+
/**
|
31
|
+
* PC 网址
|
32
|
+
*/
|
33
|
+
VITE_WEBSITE_PC: string
|
34
|
+
/**
|
35
|
+
* 移动端地址
|
36
|
+
*/
|
37
|
+
VITE_WEBSITE_MOBILE: string
|
38
|
+
|
39
|
+
/**
|
40
|
+
* 调试控制台
|
41
|
+
*/
|
42
|
+
VITE_VCONSOLE?: boolean
|
43
|
+
};
|
44
|
+
|
45
|
+
declare interface Window {
|
46
|
+
/**
|
47
|
+
* 注入到前端使用的环境变量
|
48
|
+
*/
|
49
|
+
__YOUNG_ENV__: ImportMetaEnv
|
50
|
+
/**
|
51
|
+
* 当前用户的 openid,用于 微信 jssdk 支付
|
52
|
+
*/
|
53
|
+
YOUNG_WECHAT_OPENID: string
|
54
|
+
};
|
55
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-06-12 15:00:07
|
4
|
+
* @LastEditTime: 2023-10-30 14:34:37
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import type { NuxtError } from '#app'
|
9
|
+
|
10
|
+
const props = defineProps<{
|
11
|
+
error: NuxtError
|
12
|
+
}>()
|
13
|
+
|
14
|
+
let timer: NodeJS.Timeout
|
15
|
+
|
16
|
+
const i = ref(5)
|
17
|
+
|
18
|
+
function clear() {
|
19
|
+
clearError()
|
20
|
+
clearInterval(timer)
|
21
|
+
location.replace('/')
|
22
|
+
}
|
23
|
+
|
24
|
+
onMounted(() => {
|
25
|
+
if (process.server)
|
26
|
+
return
|
27
|
+
|
28
|
+
const isDev = process.dev || window.__YOUNG_ENV__
|
29
|
+
? !!window.__YOUNG_ENV__.VITE_VCONSOLE
|
30
|
+
: location.href.includes('-dev-')
|
31
|
+
|| location.href.includes('-test-')
|
32
|
+
|
33
|
+
console.log(props.error)
|
34
|
+
if (isDev) {
|
35
|
+
console.log('开发模式,不自动清理')
|
36
|
+
const srcEl = document.createElement('script')
|
37
|
+
srcEl.src = '//g2021-cdn.laiyouxi.com/image/21Store/admin-img/vconsole.min.js'
|
38
|
+
document.body.appendChild(srcEl)
|
39
|
+
// @ts-expect-error
|
40
|
+
// eslint-disable-next-line no-new
|
41
|
+
new VConsole()
|
42
|
+
console.log(props.error)
|
43
|
+
return
|
44
|
+
}
|
45
|
+
timer = setInterval(() => {
|
46
|
+
i.value--
|
47
|
+
if (i.value === 0)
|
48
|
+
clear()
|
49
|
+
}, 1e3)
|
50
|
+
})
|
51
|
+
</script>
|
52
|
+
|
53
|
+
<template>
|
54
|
+
<div class="flex w-full h-full flex-col justify-center items-center">
|
55
|
+
<div class="text-5xl my-6">
|
56
|
+
{{ error.statusCode }}
|
57
|
+
</div>
|
58
|
+
<div class="text-lg my-2">
|
59
|
+
{{ error.statusMessage || error.message || '出错啦~' }}
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div class="mb-2">
|
63
|
+
{{ i }}s 后自动跳转首页
|
64
|
+
</div>
|
65
|
+
<ElButton @click="clear">
|
66
|
+
立即返回首页
|
67
|
+
</ElButton>
|
68
|
+
</div>
|
69
|
+
</template>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-11-01 10:13:50
|
4
|
+
* @LastEditTime: 2023-11-01 11:11:55
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import antfu from '@antfu/eslint-config'
|
8
|
+
|
9
|
+
export default antfu({
|
10
|
+
overrides: {
|
11
|
+
vue: {
|
12
|
+
'vue/valid-v-model': 'off',
|
13
|
+
},
|
14
|
+
typescript: {
|
15
|
+
'ts/no-use-before-define': 'off',
|
16
|
+
'ts/no-unused-vars': 'off',
|
17
|
+
'ts/ban-types': 'off',
|
18
|
+
'ts/ban-ts-comment': 'off',
|
19
|
+
},
|
20
|
+
},
|
21
|
+
rules: {
|
22
|
+
'no-console': 'off',
|
23
|
+
'node/prefer-global/process': 'off',
|
24
|
+
'unused-imports/no-unused-vars': 'off',
|
25
|
+
'no-throw-literal': 'off',
|
26
|
+
'antfu/consistent-list-newline': 'off',
|
27
|
+
'style/jsx-indent': 'off',
|
28
|
+
},
|
29
|
+
}, {
|
30
|
+
ignores: [
|
31
|
+
'public',
|
32
|
+
'utils/young-sdk',
|
33
|
+
],
|
34
|
+
})
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-09-27 14:15:48
|
4
|
+
* @LastEditTime: 2023-11-08 09:26:21
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import { deepClone } from '@bluesyoung/utils'
|
9
|
+
|
10
|
+
const route = useRoute()
|
11
|
+
|
12
|
+
const { logo_url, kj_logo_url, nav_arr, seo } = storeToRefs(useNavStore())
|
13
|
+
const { showAd, img_ad, img_btn } = storeToRefs(useAdStore())
|
14
|
+
|
15
|
+
const [
|
16
|
+
{ data: nav_data },
|
17
|
+
{ data: seo_info },
|
18
|
+
] = await Promise.all([
|
19
|
+
useFetch('/api/get_head_nav'),
|
20
|
+
useFetch('/api/get_seo_info', {
|
21
|
+
params: {
|
22
|
+
page: route.path,
|
23
|
+
},
|
24
|
+
}),
|
25
|
+
])
|
26
|
+
|
27
|
+
if (!nav_data.value || !seo_info.value)
|
28
|
+
throw createError('数据获取失败')
|
29
|
+
|
30
|
+
logo_url.value = getFullServerUrl(nav_data.value.logo_url)
|
31
|
+
kj_logo_url.value = getFullServerUrl(nav_data.value.kj_logo_url)
|
32
|
+
nav_arr.value = nav_data.value.nav_arr
|
33
|
+
showAd.value = nav_data.value.showAd
|
34
|
+
img_ad.value = nav_data.value.img_ad
|
35
|
+
img_btn.value = nav_data.value.img_btn
|
36
|
+
seo.value = deepClone(seo_info.value!)
|
37
|
+
|
38
|
+
useHead({
|
39
|
+
meta: [
|
40
|
+
{ name: 'keywords', content: seo.value.keywords },
|
41
|
+
],
|
42
|
+
})
|
43
|
+
|
44
|
+
useSeoMeta({
|
45
|
+
title: seo.value.title,
|
46
|
+
ogTitle: seo.value.title,
|
47
|
+
twitterTitle: seo.value.title,
|
48
|
+
description: seo.value.description,
|
49
|
+
ogDescription: seo.value.description,
|
50
|
+
twitterDescription: seo.value.description,
|
51
|
+
ogImage: logo_url.value,
|
52
|
+
twitterImage: logo_url.value,
|
53
|
+
twitterCard: 'summary_large_image',
|
54
|
+
ogUrl: nav_data.value.site_url,
|
55
|
+
ogType: 'website',
|
56
|
+
})
|
57
|
+
|
58
|
+
const isFull = computed(() => route.query.full || route.meta.full)
|
59
|
+
const bgColor = computed(() => (route.meta.bgColor as string) || '#fff')
|
60
|
+
</script>
|
61
|
+
|
62
|
+
<template>
|
63
|
+
<!-- PC 顶部导航栏 & 移动端首页导航栏 -->
|
64
|
+
<YoungHeader lt-md="!hidden" />
|
65
|
+
<!-- 移动端其他页面导航 -->
|
66
|
+
<MobileNavBar v-if="$route.meta.name" :title="$route.meta.name" />
|
67
|
+
|
68
|
+
<main
|
69
|
+
class="m-auto" :class="[showAd ? 'mt-160px min-h-[calc(100vh-160px)] lt-md:mt-80px lt-md:min-h-[calc(100vh-80px)]' : 'mt-80px min-h-[calc(100vh-80px)] lt-md:mt-44px min-h-[calc(100vh-44px)]']" :style="{
|
70
|
+
backgroundColor: bgColor,
|
71
|
+
}"
|
72
|
+
>
|
73
|
+
<div class="m-auto" lt-md="px-10px" :class="[isFull ? 'w-full' : 'container']">
|
74
|
+
<NuxtPage />
|
75
|
+
</div>
|
76
|
+
</main>
|
77
|
+
|
78
|
+
<!-- 底部 -->
|
79
|
+
<LazyYoungFooter lt-md="!hidden" />
|
80
|
+
</template>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-10-11 17:30:55
|
4
|
+
* @LastEditTime: 2023-11-08 10:56:14
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import { deepClone } from '@bluesyoung/utils'
|
9
|
+
|
10
|
+
const route = useRoute()
|
11
|
+
|
12
|
+
const { logo_url, kj_logo_url, nav_arr, seo } = storeToRefs(useNavStore())
|
13
|
+
const { showAd, img_ad, img_btn } = storeToRefs(useAdStore())
|
14
|
+
|
15
|
+
const [
|
16
|
+
{ data: nav_data },
|
17
|
+
{ data: seo_info },
|
18
|
+
] = await Promise.all([
|
19
|
+
useFetch('/api/get_head_nav'),
|
20
|
+
useFetch('/api/get_seo_info', {
|
21
|
+
params: {
|
22
|
+
page: route.path,
|
23
|
+
},
|
24
|
+
}),
|
25
|
+
])
|
26
|
+
|
27
|
+
if (!nav_data.value || !seo_info.value)
|
28
|
+
throw createError('数据获取失败')
|
29
|
+
|
30
|
+
logo_url.value = getFullServerUrl(nav_data.value.logo_url)
|
31
|
+
kj_logo_url.value = getFullServerUrl(nav_data.value.kj_logo_url)
|
32
|
+
nav_arr.value = nav_data.value.nav_arr
|
33
|
+
showAd.value = nav_data.value.showAd
|
34
|
+
img_ad.value = nav_data.value.img_ad
|
35
|
+
img_btn.value = nav_data.value.img_btn
|
36
|
+
seo.value = deepClone(seo_info.value!)
|
37
|
+
|
38
|
+
useHead({
|
39
|
+
meta: [
|
40
|
+
{ name: 'keywords', content: seo.value.keywords },
|
41
|
+
],
|
42
|
+
})
|
43
|
+
|
44
|
+
useSeoMeta({
|
45
|
+
title: seo.value.title,
|
46
|
+
ogTitle: seo.value.title,
|
47
|
+
twitterTitle: seo.value.title,
|
48
|
+
description: seo.value.description,
|
49
|
+
ogDescription: seo.value.description,
|
50
|
+
twitterDescription: seo.value.description,
|
51
|
+
ogImage: logo_url.value,
|
52
|
+
twitterImage: logo_url.value,
|
53
|
+
twitterCard: 'summary_large_image',
|
54
|
+
ogUrl: nav_data.value.site_url,
|
55
|
+
ogType: 'website',
|
56
|
+
})
|
57
|
+
|
58
|
+
const isFull = computed(() => route.query.full || route.meta.full)
|
59
|
+
</script>
|
60
|
+
|
61
|
+
<template>
|
62
|
+
<!-- PC 顶部导航栏 & 移动端首页导航栏 -->
|
63
|
+
<YoungHeader />
|
64
|
+
|
65
|
+
<main class="m-auto" :class="[showAd ? 'mt-160px min-h-[calc(100vh-160px)] lt-md:mt-80px lt-md:min-h-[calc(100vh-80px)]' : 'mt-80px min-h-[calc(100vh-80px)] lt-md:mt-44px min-h-[calc(100vh-44px)]']">
|
66
|
+
<div class="m-auto" lt-md="px-10px" :class="[isFull ? 'w-full' : 'container']">
|
67
|
+
<NuxtPage />
|
68
|
+
</div>
|
69
|
+
</main>
|
70
|
+
|
71
|
+
<!-- 底部 -->
|
72
|
+
<LazyYoungFooter />
|
73
|
+
<!-- 移动端 tabbar -->
|
74
|
+
<LazyYoungTabbar />
|
75
|
+
</template>
|