Преглед на файлове

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

zengzhixiang преди 3 години
родител
ревизия
de2f654ab5
променени са 3 файла, в които са добавени 30 реда и са изтрити 2 реда
  1. 13 0
      static/screenAndroid/WXdraw.js
  2. 14 0
      static/screenIos/WXdraw.js
  3. 3 2
      static/screenIos/css/WXtrialInterface.css

+ 13 - 0
static/screenAndroid/WXdraw.js

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

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

@@ -710,8 +710,9 @@ textarea {
   color: #fff;
   color: #fff;
   font-size: 4.2667vw;
   font-size: 4.2667vw;
   background-image: url('../../static/img/phone-size-active.png');
   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 {
 #box {
   display: flex;
   display: flex;