Browse Source

IOS崩溃时,返回项目概况页面

yunxing 3 years ago
parent
commit
1b737eb1d4
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/views/overview/MapView.vue

+ 3 - 5
src/views/overview/MapView.vue

@@ -586,14 +586,12 @@ export default {
   watch: {
     '$route.params.floor': {
       handler(floor) {
-        // IOS崩溃时,会重新走逻辑,无floor参数, 执行退出页面
+        // IOS崩溃时,会重新走逻辑,无floor参数, 返回项目概况页面
         if (!floor) {
             console.error('IOS崩溃,无floor')
-            window.webkit && webkit.messageHandlers.cordova_iab.postMessage(
-                JSON.stringify({method: 'close',})
-            )
+            this.$router.replace('/')
             return
-        }  
+        }
         this.$nextTick(() => {
           this.floorid = floor.FloorId;
           this.floorName = floor.FloorName;