Browse Source

酌情自动跳转到pc端

任一存 2 years ago
parent
commit
523468226a
3 changed files with 6 additions and 1 deletions
  1. 1 1
      .env
  2. 2 0
      public/index.html
  3. 3 0
      src/main.js

+ 1 - 1
.env

@@ -1,4 +1,4 @@
 VUE_APP_CDN_PATH=/goodsData/
-# VUE_APP_SWKK_PATH=http://192.168.20.16:8081/index.html#/1
 VUE_APP_SCENE_CODE_FLOOR_1=KJ-aigSkgvRWR
 VUE_APP_SCENE_CODE_FLOOR_2=KJ-ufjLwlSXba
+VUE_APP_PC_URL=http://zzbbh.4dage.com/YHT/index.html

+ 2 - 0
public/index.html

@@ -9,6 +9,7 @@
   </head>
   
   <body>
+    <!-- 四维看看 -->
     <script src="//4dkk.4dage.com/v4/sdk/4.2.0/kankan-sdk-deps.js"></script>
     <script src="//4dkk.4dage.com/v4/sdk/4.2.0/kankan-sdk.js"></script>
 
@@ -31,6 +32,7 @@
       type="text/javascript"
     ></script> -->
 
+    <!-- 全景看看 -->
     <link
       rel="stylesheet"
       href="<%= BASE_URL %>static/lib/iconfontQJ/iconfont.css"

+ 3 - 0
src/main.js

@@ -28,6 +28,9 @@ if (uaInfo.browser && uaInfo.browser.name === 'WeChat') {
 if (uaInfo.browser && uaInfo.browser.name === 'Safari') {
   Vue.prototype.$isSafari = true
 }
+if (uaInfo.device.type !== 'mobile' && window.innerWidth > window.innerHeight) {
+  location.replace(process.env.VUE_APP_PC_URL)
+}
 
 Vue.prototype.$globalConfig = globalConfig
 Vue.prototype.$cdnPath = process.env.VUE_APP_CDN_PATH