create-young-proj 0.13.0 → 1.1.0-alpha.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 +256 -0
- package/README.md +38 -25
- package/build.config.ts +22 -0
- package/eslint.config.js +35 -0
- package/package.json +10 -15
- package/src/index.ts +366 -0
- package/template-admin-server/_nvmrc +1 -0
- package/template-nuxt-admin/.vscode/settings.json +20 -6
- package/template-nuxt-admin/Dockerfile +3 -3
- package/template-nuxt-admin/README.md +23 -16
- package/template-nuxt-admin/_nvmrc +1 -0
- package/template-nuxt-admin/app.vue +10 -2
- package/template-nuxt-admin/boot.mjs +7 -7
- package/template-nuxt-admin/components/TopSearch.vue +1 -2
- package/template-nuxt-admin/components/YoungChangePassword.vue +2 -5
- package/template-nuxt-admin/components/YoungCodeInput.vue +1 -2
- package/template-nuxt-admin/components/YoungEditor.vue +81 -0
- package/template-nuxt-admin/components/ZenMode.vue +21 -0
- package/template-nuxt-admin/components/layout/NavBar.vue +3 -2
- package/template-nuxt-admin/composables/api.ts +7 -15
- package/template-nuxt-admin/composables/icon.ts +1 -3
- package/template-nuxt-admin/composables/nav.ts +11 -1
- package/template-nuxt-admin/composables/user.ts +3 -1
- package/template-nuxt-admin/env.d.ts +8 -8
- package/template-nuxt-admin/eslint.config.js +33 -0
- package/template-nuxt-admin/layouts/default.vue +45 -7
- package/template-nuxt-admin/middleware/auth.global.ts +2 -5
- package/template-nuxt-admin/nuxt.config.ts +21 -21
- package/template-nuxt-admin/package.json +8 -9
- package/template-nuxt-admin/pages/system/api.vue +1 -3
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +1 -8
- package/template-nuxt-admin/pages/system/menuList.vue +4 -6
- package/template-nuxt-admin/pages/system/role.vue +1 -2
- package/template-nuxt-admin/pages/system/user.vue +1 -3
- 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/server/plugins/env.ts +3 -2
- package/template-nuxt-admin/server/utils/index.ts +1 -1
- package/template-nuxt-admin/typings/global.d.ts +6 -6
- package/template-nuxt-admin/typings/system.d.ts +55 -54
- package/template-nuxt-admin/typings/user.d.ts +12 -12
- package/template-nuxt-admin/utils/tool.ts +4 -8
- package/template-nuxt-admin/yarn.lock +1913 -2002
- 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/README.md +117 -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/.vscode/settings.json +20 -6
- package/template-uni-app/README.md +5 -0
- package/template-uni-app/_nvmrc +1 -0
- package/template-uni-app/eslint.config.js +35 -0
- package/template-uni-app/package.json +22 -21
- package/template-uni-app/pnpm-lock.yaml +2557 -1543
- package/template-uni-app/src/env.d.ts +6 -6
- package/template-uni-app/src/typings/global.d.ts +1 -1
- package/template-uni-app/src/utils/modal.ts +2 -2
- package/template-uni-app/tsconfig.json +3 -3
- package/tsconfig.json +11 -0
- package/dist/index.mjs +0 -51
- package/template-nuxt-admin/.eslintrc +0 -14
- package/template-uni-app/.vscode/.server-controller-port.log +0 -5
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -43
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -10
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -15
- package/template-uni-app/dist/dev/mp-weixin/app.js +0 -92
- package/template-uni-app/dist/dev/mp-weixin/app.json +0 -51
- package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -2378
- package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -13
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -9166
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +0 -81
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -108
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -55
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -88
- package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -21
- package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -29
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -6
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +0 -56
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -9
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +0 -98
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -4
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -125
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -37
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +0 -50
- package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -5
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.js +0 -22
- package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -3
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -1
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +0 -55
- package/template-uni-app/dist/dev/mp-weixin/project.private.config.json +0 -6
- package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/index.js +0 -8
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -13
- package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -14
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -78
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -83
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -27
@@ -0,0 +1,100 @@
|
|
1
|
+
<!--
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-05-26 16:12:47
|
4
|
+
* @LastEditTime: 2023-11-02 17:18:29
|
5
|
+
* @Description:
|
6
|
+
-->
|
7
|
+
<script lang="ts" setup>
|
8
|
+
import type SwiperClass from 'swiper/types/swiper-class'
|
9
|
+
|
10
|
+
const props = defineProps<{
|
11
|
+
banners: BannerItem[]
|
12
|
+
hideTitle?: boolean
|
13
|
+
preload?: boolean
|
14
|
+
}>()
|
15
|
+
|
16
|
+
const swiperContainer = ref<SwiperClass>()
|
17
|
+
const swiperRef = ref<any>({})
|
18
|
+
|
19
|
+
function videoPlay() {
|
20
|
+
swiperContainer.value?.autoplay?.stop?.()
|
21
|
+
}
|
22
|
+
function videoPause() {
|
23
|
+
swiperContainer?.value?.autoplay?.start?.()
|
24
|
+
}
|
25
|
+
|
26
|
+
function onSwiper(swiper: SwiperClass) {
|
27
|
+
swiperContainer.value = swiper
|
28
|
+
}
|
29
|
+
|
30
|
+
const autoPlay = computed(() => props.banners.length > 1)
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<template>
|
34
|
+
<Swiper
|
35
|
+
v-if="banners.length > 0" ref="swiperContainer" class="text-center relative"
|
36
|
+
:slides-per-view="1" :pagination="autoPlay ? { clickable: true } : false" :scrollbar="{ draggable: true }"
|
37
|
+
:modules="[SwiperAutoplay, SwiperEffectCreative, SwiperNavigation, SwiperPagination]" :allow-touch-move="true"
|
38
|
+
:loop="autoPlay" :autoplay="autoPlay" :observer="true" :observe-parents="true" @swiper="(s) => onSwiper(s)"
|
39
|
+
>
|
40
|
+
<SwiperSlide
|
41
|
+
v-for="(banner, index) in banners" :key="`${index}dase3wtgfdv`" :swiper-ref="swiperRef"
|
42
|
+
>
|
43
|
+
<video
|
44
|
+
v-if="banner.is_video" class="w-full mx-auto" controls :src="getFullServerUrl(banner.img_url)" :poster="getFullServerUrl(`${banner.img_url}?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,ar_auto`, false)"
|
45
|
+
webkit-playsinline="webkit-playsinline"
|
46
|
+
playsinline
|
47
|
+
@play="videoPlay" @pause="videoPause"
|
48
|
+
/>
|
49
|
+
<img
|
50
|
+
v-else class="w-full h-full"
|
51
|
+
:src="getFullServerUrl(banner.img_url)"
|
52
|
+
alt=""
|
53
|
+
referrerpolicy="no-referrer"
|
54
|
+
:class="{ 'cursor-pointer': banner.android_url || banner.ios_url }"
|
55
|
+
:loading="index === 0 ? preload ? 'eager' : 'lazy' : 'lazy'"
|
56
|
+
data-not-lazy
|
57
|
+
@click="goDownload(banner.android_url, banner.ios_url)"
|
58
|
+
>
|
59
|
+
<div
|
60
|
+
v-if="!hideTitle && banner.title"
|
61
|
+
class="absolute top-0 bg-white opacity-80 w-full text-18px font-500 text-[#333] lh-27px py-20px text-left indent"
|
62
|
+
lt-md="hidden"
|
63
|
+
>
|
64
|
+
{{ banner.title }}
|
65
|
+
</div>
|
66
|
+
</SwiperSlide>
|
67
|
+
</Swiper>
|
68
|
+
</template>
|
69
|
+
|
70
|
+
<style scoped>
|
71
|
+
:deep(.swiper-pagination) {
|
72
|
+
position: absolute;
|
73
|
+
left: 0;
|
74
|
+
bottom: 10px;
|
75
|
+
width: 100%;
|
76
|
+
z-index: 11;
|
77
|
+
}
|
78
|
+
|
79
|
+
:deep(.swiper-pagination-bullet) {
|
80
|
+
width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
|
81
|
+
height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
|
82
|
+
display: inline-block;
|
83
|
+
border-radius: 50%;
|
84
|
+
background: var(--swiper-pagination-bullet-inactive-color, #000);
|
85
|
+
opacity: var(--swiper-pagination-bullet-inactive-opacity, .4);
|
86
|
+
@apply m-1 cursor-pointer;
|
87
|
+
}
|
88
|
+
|
89
|
+
:deep(.swiper-pagination-bullet-active) {
|
90
|
+
background: #007aff;
|
91
|
+
}
|
92
|
+
|
93
|
+
:deep(.swiper-wrapper) {
|
94
|
+
@apply flex items-center;
|
95
|
+
}
|
96
|
+
|
97
|
+
:deep(.swiper-scrollbar) {
|
98
|
+
display: none;
|
99
|
+
}
|
100
|
+
</style>
|
@@ -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
|
+
})
|