diff --git a/app.vue b/app.vue index 3f2a699..8121ae2 100644 --- a/app.vue +++ b/app.vue @@ -9,6 +9,7 @@ import $api from '@/service/webRequest' import { useStore } from '~/store' import { useI18n } from 'vue-i18n' const { locale } = useI18n() +const router = useRouter() useSeoMeta({ title: '信阳第五人民医院', ogTitle: '信阳第五人民医院', @@ -17,6 +18,27 @@ useSeoMeta({ ogImage: 'https://example.com/image.png', twitterCard: 'summary_large_image', }) +//判断是PC还是手机端,跳转不同的页面 +const isMobile = ref(false) +onMounted(() => { + //checkIfMobile(); +}) +// 检查是否为移动设备的函数 +const checkIfMobile = () => { + // 判断是否是手机端 + const coMobile = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + if (coMobile) { + console.log('访问自手机端或平板'); + isMobile.value = true; + //sessionStorage.setItem('isMobile', '1'); + router.push('/phone_index') + } else { + console.log('访问自PC端'); + isMobile.value = false; + //sessionStorage.setItem('isMobile', '0'); + router.push('/') + } +}; diff --git a/components/AppHeader.vue b/components/AppHeader.vue index e00260e..ec7c7d3 100644 --- a/components/AppHeader.vue +++ b/components/AppHeader.vue @@ -1,10 +1,20 @@ diff --git a/nuxt.config.ts b/nuxt.config.ts index 78e2d17..16e4d62 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -3,7 +3,7 @@ import { defineNuxtConfig } from 'nuxt/config' export default defineNuxtConfig({ app: { - baseURL:'/web/', + baseURL:'/', }, nitro: { routeRules: { @@ -11,13 +11,13 @@ export default defineNuxtConfig({ } }, router: { - extendRoutes(routes, resolve) { - routes.push({ - name: 'index_info', - path: '/params/:param1', // * 表示可选的多个参数 - component: resolve(__dirname, 'pages/index_info.vue') - }); - } + // extendRoutes(routes, resolve) { + // routes.push({ + // name: 'index_info', + // path: '/params/:param1', // * 表示可选的多个参数 + // component: resolve(__dirname, 'pages/index_info.vue') + // }); + // } }, ssr: false, css: [ diff --git a/pages/index.vue b/pages/index.vue index 9dae2c8..899da08 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -22,7 +22,7 @@ 医院信息查询 Hospital information inquiry
- 请输入您要查询的内容 +
@@ -121,7 +121,7 @@ 通知公告
+ style="border:1px solid #000;padding: 10px 20px;border-radius: 50px;cursor: pointer;"> 查看更多
@@ -129,7 +129,7 @@
-
+
@@ -157,7 +157,7 @@ 医院动态
+ style="cursor: pointer;border: 1px solid #000;padding: 10px 20px;border-radius: 50px;"> 查看更多
@@ -165,7 +165,7 @@
-
+
@@ -200,7 +200,7 @@ -
+
@@ -259,7 +259,7 @@ -
+
26人高压氧舱 @@ -384,7 +384,7 @@ const onSlideChangeKK = (s) => { activedKKIndex.value = s.snapIndex; } onMounted(() => { - + }) diff --git a/pages/list/[id].vue b/pages/list/[id].vue new file mode 100644 index 0000000..652de27 --- /dev/null +++ b/pages/list/[id].vue @@ -0,0 +1,47 @@ + + + + diff --git a/pages/phone_index.vue b/pages/phone_index.vue new file mode 100644 index 0000000..69a7163 --- /dev/null +++ b/pages/phone_index.vue @@ -0,0 +1,569 @@ + + + + + diff --git a/pages/phone_list/[id].vue b/pages/phone_list/[id].vue new file mode 100644 index 0000000..cc2ea58 --- /dev/null +++ b/pages/phone_list/[id].vue @@ -0,0 +1,76 @@ + + + + + diff --git a/public/images/bbe.png b/public/images/bbe.png new file mode 100644 index 0000000..015f3f8 Binary files /dev/null and b/public/images/bbe.png differ diff --git a/public/images/bs1.png b/public/images/bs1.png new file mode 100644 index 0000000..f81d0af Binary files /dev/null and b/public/images/bs1.png differ diff --git a/public/images/home.png b/public/images/home.png new file mode 100644 index 0000000..2896fca Binary files /dev/null and b/public/images/home.png differ diff --git a/public/images/k3.png b/public/images/k3.png index 1f49c9b..28e404a 100644 Binary files a/public/images/k3.png and b/public/images/k3.png differ diff --git a/public/images/k4.png b/public/images/k4.png index 5d982e1..adbf12b 100644 Binary files a/public/images/k4.png and b/public/images/k4.png differ diff --git a/public/images/k5.png b/public/images/k5.png index 6c3c822..e9a07d8 100644 Binary files a/public/images/k5.png and b/public/images/k5.png differ diff --git a/public/images/k6.png b/public/images/k6.png index a0f08f4..4f157be 100644 Binary files a/public/images/k6.png and b/public/images/k6.png differ diff --git a/public/images/list-bg.png b/public/images/list-bg.png new file mode 100644 index 0000000..9e69d2e Binary files /dev/null and b/public/images/list-bg.png differ