소스 검색

feat(分辨率): 上报dpi

zengzhixiang 2 년 전
부모
커밋
bc4aeb6f32
2개의 변경된 파일26개의 추가작업 그리고 15개의 파일을 삭제
  1. 12 6
      static/screenAndroid/WXtrialInterface.html
  2. 14 9
      static/screenIos/WXtrialInterface.html

+ 12 - 6
static/screenAndroid/WXtrialInterface.html

@@ -413,7 +413,8 @@
       Module.onRuntimeInitialized = function () {
         isFinish = true;
       };
-      var timerInterval = null, timeInterval = 0;
+      var timerInterval = null,
+        timeInterval = 0;
       function connect(type) {
         $.ajax({
           url: baseUrl + '/api/resources/user/cloud/connect',
@@ -484,13 +485,13 @@
                   clearInterval(intervaler);
                   quit();
                 }, 3000);
-                timerInterval = clearTimeout()
-                return
+                timerInterval = clearTimeout();
+                return;
               }
               timerInterval = setTimeout(() => {
                 connect(type);
                 timeInterval += 1;
-              }, 3000)
+              }, 3000);
             } else {
               $.toast('画面异常,请重新进入', 'text');
               setTimeout(() => {
@@ -546,7 +547,7 @@
             setTimeout(() => {
               clearInterval(intervaler);
               quit();
-            }, 3000)
+            }, 3000);
           }
         }, 3000);
 
@@ -566,7 +567,7 @@
             setTimeout(() => {
               wsss.close();
               quit();
-            }, 3000)
+            }, 3000);
           }
         });
         ws.addEventListener('message', function (event) {
@@ -1700,8 +1701,10 @@
           JSON.stringify({
             type: 'setPhoneSize',
             data: {
+              id: config.id,
               width: config.width,
               height: config.height,
+              dpi: config.dpi,
             },
           }),
         );
@@ -1713,6 +1716,7 @@
               id: config.id,
               width: config.width,
               height: config.height,
+              dpi: config.dpi,
               desc: '分辨率修改', // 可选
             },
           }),
@@ -1729,8 +1733,10 @@
           contentType: 'application/json; charset=UTF-8',
           data: JSON.stringify({
             userCardId: window.userCardId,
+            // id: config.id,
             width: config.width,
             height: config.height,
+            dpi: config.dpi,
             resolvingPowerId: config.id,
           }),
         });

+ 14 - 9
static/screenIos/WXtrialInterface.html

@@ -433,8 +433,9 @@
       setTimeout(() => {
         getDataByKey(db, storeName, userCardId);
       }, 1000);
-      
-      var timerInterval = null, timeInterval = 0;
+
+      var timerInterval = null,
+        timeInterval = 0;
       function connect(type) {
         $.ajax({
           url: baseUrl + '/api/resources/user/cloud/connect',
@@ -501,21 +502,21 @@
             } else if (res.status === 5200) {
               if (timeInterval > 7) {
                 $.toast('网络异常,请稍后重试', 'text');
-                timerInterval = clearTimeout()
+                timerInterval = clearTimeout();
                 setTimeout(() => {
                   quit();
-                }, 3000)
-                return
+                }, 3000);
+                return;
               }
               timerInterval = setTimeout(() => {
                 connect(type);
                 timeInterval += 1;
-              }, 3000)
-            }  else {
+              }, 3000);
+            } else {
               $.toast('画面异常,请重新进入', 'text');
               setTimeout(() => {
                 quit();
-              }, 3000)
+              }, 3000);
             }
           },
         });
@@ -1489,8 +1490,10 @@
           JSON.stringify({
             type: 'setPhoneSize',
             data: {
+              id: config.id,
               width: config.width,
               height: config.height,
+              dpi: config.dpi,
             },
           }),
         );
@@ -1503,6 +1506,7 @@
               id: config.id,
               width: config.width,
               height: config.height,
+              dpi: config.dpi,
               desc: '分辨率修改', // 可选
             },
           }),
@@ -1520,9 +1524,10 @@
           contentType: 'application/json; charset=UTF-8',
           data: JSON.stringify({
             userCardId: window.userCardId,
+            resolvingPowerId: config.id,
             width: config.width,
             height: config.height,
-            resolvingPowerId: config.id,
+            dpi: config.dpi,
           }),
         });