Browse Source

Merge branch 'develop/3.2.4' of http://60.205.190.38:9000/zhaoheqing/wxmini into develop/3.2.4

Damon 7 months ago
parent
commit
c44026f4fb
3 changed files with 10 additions and 8 deletions
  1. 3 3
      devices/bluetooth/bt_cmd.js
  2. 6 4
      pages/index/index.js
  3. 1 1
      pages/piano/wallpaper/wallpaper.js

+ 3 - 3
devices/bluetooth/bt_cmd.js

@@ -126,9 +126,9 @@ class BtCmd {
         if (time > 0) {
         if (time > 0) {
             let day = (60 * 60)
             let day = (60 * 60)
             let hour = 60
             let hour = 60
-            const hours = Math.floor(time / day);
-            const minutes = Math.floor((time % day) / hour);
-            const seconds = Math.floor((time % day % hour));
+            const hours = time / day;
+            const minutes = (time % day) / hour;
+            const seconds = (time % day % hour);
             // 将小时、分钟和秒转换为16进制字符串并转为大写
             // 将小时、分钟和秒转换为16进制字符串并转为大写
             //            console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
             //            console.log(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`);
             console.log("休眠:", hour, minutes, seconds)
             console.log("休眠:", hour, minutes, seconds)

+ 6 - 4
pages/index/index.js

@@ -134,7 +134,7 @@ Page({
       try {
       try {
         var list = JSON.parse(l);
         var list = JSON.parse(l);
         that.updateDeviceList(list, true);
         that.updateDeviceList(list, true);
-      } catch (e) {}
+      } catch (e) { }
       // that.tryConnectBle()
       // that.tryConnectBle()
     }
     }
 
 
@@ -916,8 +916,8 @@ Page({
       deviceId: newDevice.deviceId,
       deviceId: newDevice.deviceId,
       name: newDevice.name,
       name: newDevice.name,
       state: "online",
       state: "online",
-      ProdModel: newDevice.ProdModel,
-      clientType: newDevice.ProdModel,
+      ProdModel: newDevice.ProdModel || newDevice.clientType,
+      clientType: newDevice.clientType || newDevice.ProdModel,
       devName: newDevice.name,
       devName: newDevice.name,
       mac: newDevice.mac,
       mac: newDevice.mac,
       img: newDevice.img,
       img: newDevice.img,
@@ -980,7 +980,9 @@ Page({
 
 
   ///更新列表排序
   ///更新列表排序
   updateDeviceList(deviceList, isInit) {
   updateDeviceList(deviceList, isInit) {
-    if (deviceList.length == 0) {
+    console.log("更新设备列表0:", deviceList);
+
+    if (deviceList.length <= 0) {
       return;
       return;
     }
     }
 
 

+ 1 - 1
pages/piano/wallpaper/wallpaper.js

@@ -96,7 +96,7 @@ Page({
               cropScale: '1:1', // 裁剪比例
               cropScale: '1:1', // 裁剪比例
               success(res) {
               success(res) {
                 console.log(res)
                 console.log(res)
-                that.convertImageToRGB565(res)
+                that.convertImageToRGB565(res.tempFilePath)
               }
               }
             })
             })
           }
           }