hookehuyr

✨ feat: 细节调整,判断PC端访问适配

1 # port 1 # port
2 -VITE_PORT = 8108 2 +VITE_PORT = 8208
3 3
4 # 反向代理服务器地址 4 # 反向代理服务器地址
5 # VITE_PROXY_TARGET = http://voice.onwall.cn 5 # VITE_PROXY_TARGET = http://voice.onwall.cn
......
...@@ -2,18 +2,17 @@ ...@@ -2,18 +2,17 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-26 23:52:36 3 * @Date: 2022-05-26 23:52:36
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-08-29 14:00:58 5 + * @LastEditTime: 2022-08-30 06:13:04
6 * @FilePath: /data-table/src/App.vue 6 * @FilePath: /data-table/src/App.vue
7 * @Description: 7 * @Description:
8 --> 8 -->
9 <template> 9 <template>
10 - <!-- 页面缓存 --> 10 + <van-row v-if="is_pc">
11 - <!-- <router-view v-slot="{ Component, route }"> 11 + <van-col span="10" offset="7">
12 - <keep-alive :include="keepPages" :max="10"> 12 + <router-view></router-view>
13 - <component :is="Component" :key="route.name" /> 13 + </van-col>
14 - </keep-alive> 14 + </van-row>
15 - </router-view> --> 15 + <router-view v-else></router-view>
16 - <router-view></router-view>
17 </template> 16 </template>
18 17
19 <script setup> 18 <script setup>
...@@ -36,9 +35,9 @@ const keepPages = computed(() => store.getKeepPages) ...@@ -36,9 +35,9 @@ const keepPages = computed(() => store.getKeepPages)
36 35
37 // // TAG: 全局设置页面标题 36 // // TAG: 全局设置页面标题
38 // const $route = useRoute(); 37 // const $route = useRoute();
39 -// watchEffect( 38 +watchEffect(
40 -// () => useTitle($route.meta.title) 39 + () => useTitle('表单标题')
41 -// ) 40 +)
42 // 监听路由变化 41 // 监听路由变化
43 // 切换路由页面返回顶部 42 // 切换路由页面返回顶部
44 const $router = useRouter(); 43 const $router = useRouter();
...@@ -55,12 +54,10 @@ Toast.setDefaultOptions({ ...@@ -55,12 +54,10 @@ Toast.setDefaultOptions({
55 className: 'zIndex' 54 className: 'zIndex'
56 }); 55 });
57 56
57 +// web端判断
58 +const is_pc = computed(() => wxInfo().isPC)
59 +
58 onMounted(async () => { 60 onMounted(async () => {
59 - // web端访问跳转
60 - // const url = import.meta.env.VITE_MOBILE_URL;
61 - // if (!wxInfo().isMobile && !wxInfo().isWeiXin) {
62 - // location.href = url + location.hash;
63 - // }
64 // const { data } = await wxJsAPI(); 61 // const { data } = await wxJsAPI();
65 // data.jsApiList = apiList; 62 // data.jsApiList = apiList;
66 // wx.config(data); 63 // wx.config(data);
...@@ -81,6 +78,7 @@ body { ...@@ -81,6 +78,7 @@ body {
81 width: 100%; 78 width: 100%;
82 height: 100%; 79 height: 100%;
83 color: @base-font-color; 80 color: @base-font-color;
81 + background-color: #F7F8FA;
84 } 82 }
85 83
86 body { 84 body {
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
2 * @Author: hookehuyr hookehuyr@gmail.com 2 * @Author: hookehuyr hookehuyr@gmail.com
3 * @Date: 2022-05-31 12:06:19 3 * @Date: 2022-05-31 12:06:19
4 * @LastEditors: hookehuyr hookehuyr@gmail.com 4 * @LastEditors: hookehuyr hookehuyr@gmail.com
5 - * @LastEditTime: 2022-07-21 11:37:32 5 + * @LastEditTime: 2022-08-29 16:44:15
6 - * @FilePath: /front/src/main.js 6 + * @FilePath: /data-table/src/main.js
7 - * @Description: 7 + * @Description:
8 */ 8 */
9 import { createApp } from 'vue'; 9 import { createApp } from 'vue';
10 -import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, Collapse, CollapseItem } from 'vant'; 10 +import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, Collapse, CollapseItem, RadioGroup, Radio } from 'vant';
11 import router from './router'; 11 import router from './router';
12 import App from './App.vue'; 12 import App from './App.vue';
13 // import axios from './utils/axios'; 13 // import axios from './utils/axios';
...@@ -18,8 +18,11 @@ import { createPinia } from 'pinia'; ...@@ -18,8 +18,11 @@ import { createPinia } from 'pinia';
18 const pinia = createPinia(); 18 const pinia = createPinia();
19 const app = createApp(App); 19 const app = createApp(App);
20 20
21 +// 屏蔽警告信息
22 +app.config.warnHandler = () => null;
23 +
21 app.config.globalProperties.$http = axios; // 关键语句 24 app.config.globalProperties.$http = axios; // 关键语句
22 25
23 -app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem); 26 +app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem).use(Radio).use(RadioGroup);
24 27
25 app.mount('#app'); 28 app.mount('#app');
......
1 /* 1 /*
2 * @Date: 2022-04-18 15:59:42 2 * @Date: 2022-04-18 15:59:42
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-08-23 13:37:06 4 + * @LastEditTime: 2022-08-29 16:13:49
5 - * @FilePath: /front/src/utils/tools.js 5 + * @FilePath: /data-table/src/utils/tools.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
8 import dayjs from 'dayjs'; 8 import dayjs from 'dayjs';
...@@ -24,12 +24,14 @@ const wxInfo = () => { ...@@ -24,12 +24,14 @@ const wxInfo = () => {
24 let isIpad = u.indexOf('iPad') > -1; // iPad平台 24 let isIpad = u.indexOf('iPad') > -1; // iPad平台
25 let uAgent = navigator.userAgent.toLowerCase(); 25 let uAgent = navigator.userAgent.toLowerCase();
26 let isWeiXin = (uAgent.match(/MicroMessenger/i) == 'micromessenger') ? true : false; 26 let isWeiXin = (uAgent.match(/MicroMessenger/i) == 'micromessenger') ? true : false;
27 + let isPC = (uAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) ? false : true;
27 return { 28 return {
28 isAndroid, 29 isAndroid,
29 isiOS, 30 isiOS,
30 isWeiXin, 31 isWeiXin,
31 isMobile, 32 isMobile,
32 - isIpad 33 + isIpad,
34 + isPC
33 }; 35 };
34 }; 36 };
35 37
......