Explorar o código

feat(分辨率调整): 获取云机分辨率

zengzhixiang %!s(int64=3) %!d(string=hai) anos
pai
achega
de2f654ab5

+ 13 - 0
static/screenAndroid/WXdraw.js

@@ -56,6 +56,11 @@ function doConnectDirectives() {
       },
     };
     wsss.send(JSON.stringify(pings2));
+    wsss.send(
+      JSON.stringify({
+        type: 'getPhoneSize',
+      }),
+    );
   };
   wsss.onerror = function (evt) {
     wsss.close();
@@ -157,6 +162,14 @@ function doConnectDirectives() {
       });
       return;
     }
+    if (result.type === 'getPhoneSize') {
+      console.log(result);
+      window.currentPhoneSize = {
+        width: result.data.width,
+        height: result.data.height,
+      };
+      return;
+    }
   };
 }
 $('body').on('click', function () {

+ 14 - 0
static/screenIos/WXdraw.js

@@ -65,6 +65,12 @@ function doConnectDirectives() {
       },
     };
     wsss.send(JSON.stringify(pings2));
+
+    wsss.send(
+      JSON.stringify({
+        type: 'getPhoneSize',
+      }),
+    );
   };
   wsss.onerror = function () {
     wsss.close();
@@ -169,6 +175,14 @@ function doConnectDirectives() {
       });
       return;
     }
+    if (result.type === 'getPhoneSize') {
+      console.log(result);
+      window.currentPhoneSize = {
+        width: result.data.width,
+        height: result.data.height,
+      };
+      return;
+    }
   };
 }
 $('body').on('click', function () {

+ 3 - 2
static/screenIos/css/WXtrialInterface.css

@@ -710,8 +710,9 @@ textarea {
   color: #fff;
   font-size: 4.2667vw;
   background-image: url('../../static/img/phone-size-active.png');
-  background-size: 73.8461% 100%;
-
+  background-size: 70% 100%;
+  background-position: center center;
+  background-repeat: no-repeat;
 }
 #box {
   display: flex;