Ver código fonte

fix(分辨率): 修复错误

zengzhixiang 3 anos atrás
pai
commit
be92e783c6

+ 12 - 25
static/screenAndroid/WXtrialInterface.html

@@ -52,7 +52,7 @@
         class="phone-size-item {{? value.width === it.active.width && value.height === it.active.height }}active{{?}}"
         data-width="{{= value.width }}"
         data-height="{{= value.height }}"
-        data-id="{{= value.id }}""
+        data-id="{{= value.id }}"
       >
         <span>{{= value.width }}x{{= value.height }}</span>
       </div>
@@ -1588,16 +1588,6 @@
           $(e.currentTarget).parents('.dialog').removeClass('show');
         });
 
-      function getPhoneSizeList() {
-        $.ajax({
-          url: baseUrl + '/api/public/v5/shear/content',
-          headers: {
-            Authorization: token,
-          },
-          type: 'get',
-          dataType: 'json',
-        });
-      }
       // 分辨率列表
       window.phoneSizeList = [];
       // 当前生效的分辨率
@@ -1610,40 +1600,37 @@
 
       function getPhoneSizeList() {
         return $.ajax({
-          url: baseUrl + '/api/public/config/switch/getValue/toJSONObject',
+          url:
+            baseUrl + '/api/resources/v5/machine/resolution/getResolvingPower',
           headers: {
             Authorization: token,
           },
           type: 'get',
           dataType: 'json',
           data: {
-            configKey: 'cloud_phone_resolving_power',
+            userCardId,
           },
         }).then(function (response) {
           return response.data.map(function (v) {
             return {
+              id: v.id,
+              dpi: v.dpi,
               width: v.width || v.abscissa,
-              height: v.height || v.ordinate,
+              height: v.height || v.ordinate || v.high,
             };
           });
-          // [
-          //   // { width: 320, height: 240 },
-          //   // { width: 640, height: 480 },
-          //   { width: 375, height: 812 },
-          //   { width: 720, height: 1280 },
-
-          //   // { width: 1280, height: 720 },
-          //   // { width: 1080, height: 1920 },
-          // ];
         });
       }
 
       getPhoneSizeList().then(function (phoneSizeList) {
         window.phoneSizeList = phoneSizeList;
         const currentPhoneSize = window.phoneSizeList.find(function (v) {
-          return v.width ===  window.currentPhoneSize.width && v.height ===  window.currentPhoneSize.height;
+          return (
+            v.width === window.currentPhoneSize.width &&
+            v.height === window.currentPhoneSize.height
+          );
         });
-        window.currentPhoneSize = currentPhoneSize ||  window.currentPhoneSize
+        window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
         return updatePhoneSizeListHtml();
       });
 

+ 10 - 15
static/screenIos/WXtrialInterface.html

@@ -55,7 +55,7 @@
         class="phone-size-item {{? value.width === it.active.width && value.height === it.active.height }}active{{?}}"
         data-width="{{= value.width }}"
         data-height="{{= value.height }}"
-        data-id="{{= value.id }}""
+        data-id="{{= value.id }}"
       >
         <span>{{= value.width }}x{{= value.height }}</span>
       </div>
@@ -1376,16 +1376,6 @@
           $(e.currentTarget).parents('.dialog').removeClass('show');
         });
 
-      function getPhoneSizeList() {
-        $.ajax({
-          url: baseUrl + '/api/public/v5/shear/content',
-          headers: {
-            Authorization: token,
-          },
-          type: 'get',
-          dataType: 'json',
-        });
-      }
       // 分辨率列表
       window.phoneSizeList = [];
       // 当前生效的分辨率
@@ -1408,7 +1398,6 @@
           dataType: 'json',
           data: {
             userCardId,
-            // configKey: 'cloud_phone_resolving_power',
           },
         }).then(function (response) {
           return response.data.map(function (v) {
@@ -1425,9 +1414,12 @@
       getPhoneSizeList().then(function (phoneSizeList) {
         window.phoneSizeList = phoneSizeList;
         const currentPhoneSize = window.phoneSizeList.find(function (v) {
-          return v.width ===  window.currentPhoneSize.width && v.height ===  window.currentPhoneSize.height;
+          return (
+            v.width === window.currentPhoneSize.width &&
+            v.height === window.currentPhoneSize.height
+          );
         });
-        window.currentPhoneSize = currentPhoneSize ||  window.currentPhoneSize
+        window.currentPhoneSize = currentPhoneSize || window.currentPhoneSize;
         return updatePhoneSizeListHtml();
       });
 
@@ -1488,7 +1480,10 @@
       // });
       $('#phone-size-list').on('click', '.phone-size-item', function (e) {
         const data = $(e.currentTarget).data();
-        console.log("🚀 ~ file: WXtrialInterface.html ~ line 1494 ~ data", data)
+        console.log(
+          '🚀 ~ file: WXtrialInterface.html ~ line 1494 ~ data',
+          data,
+        );
         window.activePhoneSize = data;
         updatePhoneSizeListHtml();
         // setPhoneSize(data.width, data.height);