From b4db27528416ab6ca37f198698061dedcd93346d Mon Sep 17 00:00:00 2001 From: wangchenguang <728837162@qq.com> Date: Mon, 10 Apr 2023 14:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90pc=E5=92=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 13 +++- src/components/menuTree/index.vue | 14 ++++ src/layouts/header/index.vue | 110 +++++++++++++++++++++++---- src/layouts/navbar/index.vue | 18 ++--- src/pages/about/index.vue | 49 +++++++----- src/pages/article/index.vue | 12 ++- src/pages/column/index.vue | 25 +++--- src/pages/home/index.vue | 27 ++++--- src/pages/overviewLocation/index.vue | 6 ++ src/pages/overviewTrailer/index.vue | 3 + src/pages/sfel/index.vue | 2 +- src/pages/talent/index.vue | 36 +++++++++ src/setting.js | 3 +- 13 files changed, 243 insertions(+), 75 deletions(-) diff --git a/src/App.vue b/src/App.vue index bb6e4a7..83f5991 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,8 +19,8 @@ export default { window.addEventListener('beforeunload', () => { util.local.set(Setting.storeKey, this.$store.state); }); - - function IsPC() { + // 判断当前处于什么终端 true为PC端,false为手机端 + function IsPCModel() { var userAgentInfo = navigator.userAgent; var Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']; var flagPc = true; @@ -32,8 +32,15 @@ export default { } return flagPc; } - var flagZt = IsPC(); + var flagZt = IsPCModel(); this.$store.commit('updateModelType', flagZt) + window.onresize = () => { + if(document.body.clientWidth <= 1200) { + this.$store.commit('updateModelType', false) + }else { + this.$store.commit('updateModelType', true) + } + } } }; diff --git a/src/components/menuTree/index.vue b/src/components/menuTree/index.vue index 0ebde1c..650880d 100644 --- a/src/components/menuTree/index.vue +++ b/src/components/menuTree/index.vue @@ -32,4 +32,18 @@ export default { diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 992663c..36ca414 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -3,16 +3,36 @@ - -
- - -
- - - + + + +