Procházet zdrojové kódy

修改新出现的3d模式动不了的问题

57862207 před 1 rokem
rodič
revize
4310aa9831
2 změnil soubory, kde provedl 11 přidání a 10 odebrání
  1. 3 3
      src/main.js
  2. 8 7
      src/store/modules/common/mutations.js

+ 3 - 3
src/main.js

@@ -10,13 +10,13 @@ Vue.config.productionTip = false;
 
 var strUrl=window.location.href;
 var strIp = "";
-if(strUrl.indexOf("172.16.50.4")!=-1)
+if(strUrl.indexOf("47.102.97.214")!=-1)
 {
-  strIp = "172.16.50.4:19703";
+  strIp = "47.102.97.214";
 }
 else
 {
-  strIp = "47.102.97.214";
+  strIp = "172.16.50.4:19703";
 }
 
 Vue.use(

+ 8 - 7
src/store/modules/common/mutations.js

@@ -85,7 +85,7 @@ export default {
     state.isOpen3d = data;
   },
   toggle3dStatus(state) {
-    var element = document.getElementById('house-player');
+    var element = document.getElementById('house-player').parentNode;
     state.isOpen3d = !state.isOpen3d;
     
     if (state.isOpen3d) {
@@ -94,14 +94,15 @@ export default {
         window.sdkInstance.changeMode('panorama');
         let player = document.getElementById('player')
         player.appendChild(element)
-        element.style.width = window.innderWidth+'px';
-        element.style.height = window.innderHeight+'px';
+        var elementChild = document.getElementById('house-player');
+        elementChild.style.width = window.innderWidth+'px';
+        elementChild.style.height = window.innderHeight+'px';
         window.renderWidth = window.innderWidth;
         window.renderHeight = window.innderHeight;
-        element.width = (window.innderWidth * 2);
-        element.height = (window.innderHeight * 2);
-        element.style.marginLeft = '0px';
-        element.style.marginTop = '0px';
+        elementChild.width = (window.innderWidth * 2);
+        elementChild.height = (window.innderHeight * 2);
+        elementChild.style.marginLeft = '0px';
+        elementChild.style.marginTop = '0px';
       })
       sessionStorage.setItem('3dMode', 1)
     } else {