lsc 2 年之前
父節點
當前提交
8bfd394406
共有 2 個文件被更改,包括 26 次插入18 次删除
  1. 0 11
      index.html
  2. 26 7
      js/Desktop/Onload.js

+ 0 - 11
index.html

@@ -46,17 +46,6 @@
         document.domain = document.domain.split(".").slice(-2).join(".");
     </script>
     <meta name="viewport" id="viewportMeta">
-    <script>
-        var initViewport = function (height,width) {
-            var metaEl = document.querySelector("#viewportMeta");
-            var content = "height=" + height + ",width=" + width + ",initial-scale=1.0,user-scalable=no";
-            metaEl.setAttribute('name', 'viewport');
-            metaEl.setAttribute('content', content);
-        }
-        var realHeight = window.innerHeight > window.innerWidth ? window.innerWidth : window.innerHeight
-        var realWidth = window.innerHeight > window.innerWidth ? window.innerHeight : window.innerWidth
-        initViewport(realHeight,realWidth);
-    </script>
 </head>
 
 <body scroll="no" class="U_MD_D_NotText Scrollbar" style="overflow: hidden;">

+ 26 - 7
js/Desktop/Onload.js

@@ -36,7 +36,26 @@ window.onload = function () {
     U.MD.U.L.login();
     //U.MD.D.isLogin();
     U.MD.D.fullscreen();
+    initViewport(realHeight, realWidth);
+    window.addEventListener('resize', () => {
+        var realHeight = window.innerHeight
+        var realWidth = window.innerWidth
+        initViewport(realHeight, realWidth);
+        // window.location.reload();
+    })
+}
+
+
+var initViewport = function (height, width) {
+    var metaEl = document.querySelector("#viewportMeta");
+    var content = "height=" + height + ",width=" + width + ",initial-scale=1.0,user-scalable=no";
+    metaEl.setAttribute('name', 'viewport');
+    metaEl.setAttribute('content', content);
+    document.body.style.width = width + 'px'
+    document.body.style.height = height + 'px'
 }
+var realHeight = window.innerHeight > window.innerWidth ? window.innerWidth : window.innerHeight
+var realWidth = window.innerHeight > window.innerWidth ? window.innerHeight : window.innerWidth
 
 
 US.Config = {
@@ -307,7 +326,7 @@ U.MD.D.getuser = function () {
                                 } else {
                                     if (res.value[0][0].organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
-                                    }else if (userInfo.organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263'){
+                                    } else if (userInfo.organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
                                         $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
                                     } else if (userInfo.organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
                                         // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
@@ -333,10 +352,10 @@ U.MD.D.getuser = function () {
                 }
             }, [], { "type": "GET", "withCredentials": true });
         }
-    }else{
+    } else {
         if (userInfo.organizeid == '91305d49-01ba-11ed-8c78-005056b86db4') {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/mingdeBg.png")'
-        }else if (userInfo.organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263'){
+        } else if (userInfo.organizeid == 'c7df0bd4-6e75-401a-a137-4e163aa62263') {
             $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/zhongshanBg.png")'
         } else if (userInfo.organizeid == '580aac24-a939-49f7-a75a-40a7b5af3a17') {
             // $("#U_MD_D_BG")[0].style.backgroundImage = 'url("/img/icon/longweiBg.png")'
@@ -367,15 +386,15 @@ U.MD.D.getuser = function () {
 //#endregion
 
 U.MD.D.fullscreen = function () {
-    if(document.body.offsetWidth < 1025){
+    if (document.body.offsetWidth < 1025) {
         U.UF.C.fullScreen()
     }
 
-    document.body.addEventListener('dblclick',()=>{
+    document.body.addEventListener('dblclick', () => {
         const isFullScreen = document.fullscreenElement
-        if(isFullScreen){
+        if (isFullScreen) {
             U.UF.C.cancelfullScreen()
-        }else{
+        } else {
             U.UF.C.fullScreen()
         }
     })