Browse Source

量表详情单页不阻止PC

zhouna 3 years ago
parent
commit
1739c657ef
1 changed files with 14 additions and 2 deletions
  1. 14 2
      src/App.vue

+ 14 - 2
src/App.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <p class="pc-enter" v-if="!isMobile">请在手机端访问</p>
+    <p class="pc-enter" v-if="!isMobile&&!isScaleShow">请在手机端访问</p>
     <div v-else id="app">
         <router-view/>
         <portal-target name="notification-outlet"></portal-target>
@@ -17,10 +17,22 @@
     data:()=>{
       return{
         isMobile:/(iPhone|iPad|iPod|iOS|Android|SymbianOS|Windows Phone)/i.test(navigator.appVersion),
+        isScaleShow:false,
+      }
+    },
+    watch:{
+      $route(to,from){
+        console.log(to,from)
+        if(to.path!=="/ScaleShow"){
+          this.isScaleShow = false;
+        }
       }
     },
     mounted(){
-      if(!this.isMobile){
+      const isShow = this.$route.path==="/ScaleShow";
+      this.isScaleShow = isShow;
+      //console.log(isScaleShow,this.$route)
+      if(!this.isMobile&&!isShow){
         return;
       }
       (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {