czt
3 天以前 2c3098821a1f3e9825b6903810675feddb135de2
dzhwk/index.html
@@ -111,7 +111,11 @@
   <script type="text/javascript" charset="utf-8">
      mui.init();
      // 先设置 APP 全局全屏(隐藏状态栏)
      plus.navigator.setFullscreen(true);
      mui.plusReady(function() {
         var user = JSON.parse(localStorage.getItem('user'));
         console.log(JSON.stringify(user));
         if (user) {
@@ -149,8 +153,40 @@
                  };
         localStorage.setItem('user', JSON.stringify(regInfo));
         var URL = url + "?sid=" + sid;
         var wv = plus.webview.create(URL);
         // var wv = plus.webview.create(URL);
         // wv.show();
          // 1. 全屏创建 Webview
         var wv = plus.webview.create(
             URL,
             'targetWebview', // 唯一id
             {
               top: '0px',      // 顶边距0
               bottom: '0px',   // 底边距0
               left: '0px',     // 左边距0
               right: '0px',    // 右边距0
               width: '100%',
               height: '100%',
               scrollIndicator: 'none', // 隐藏滚动条(可选)
               hardwareAccelerated: true // 开启硬件加速(Android)
             }
         );
           // 2. 显示 Webview
         wv.show();
           // 3. 可选:Webview 加载完成后再强制网页全屏
         wv.addEventListener('loaded', function() {
             // 注入JS让网页自身占满视口
             wv.evalJS(`
               document.documentElement.style.width = '100%';
               document.documentElement.style.height = '100%';
               document.body.style.width = '100%';
               document.body.style.height = '100%';
               document.body.style.margin = '0';
               document.body.style.padding = '0';
               document.body.style.overflow = 'hidden';
             `);
         });
      }
   </script>
</html>