From 5ab117bc44c87a8ba5acf1c6809adbe34cb85daf Mon Sep 17 00:00:00 2001 From: sjchen <13418980720@163.com> Date: Thu, 13 Feb 2025 10:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9D=A1=E7=9C=A0=E6=95=B0=E6=8D=AE=E8=A1=A5?= =?UTF-8?q?=E5=85=A8=E5=A2=9E=E5=8A=A0=E8=B7=A8=E5=A4=A9=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index/index.js | 4 ++-- utils/CommonUtil.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/index/index.js b/index/index.js index 5e8fa3a..e813443 100644 --- a/index/index.js +++ b/index/index.js @@ -82,7 +82,7 @@ Page({ // 连接指定设备 // if(device.deviceId=="03:02:02:07:65:98"){ // if(device.deviceId=="03:02:02:07:5C:B7"){ - if(device.deviceId=="03:02:02:07:62:A3"){ + if(device.deviceId=="03:02:02:07:5B:41"){ // if(device.deviceId=="03:02:02:07:5E:BE"){ this.connectToDevice(device.deviceId); } @@ -399,7 +399,7 @@ Page({ // const HRPacket = DataPacket.generateReadHRDataPacket(); // SendCommandUtil.sendPackage(this.data.deviceId,HRPacket); - this.sendHealthCommand(0x53) + this.sendHealthCommand(0x66) }, diff --git a/utils/CommonUtil.js b/utils/CommonUtil.js index 0b726ff..911234f 100644 --- a/utils/CommonUtil.js +++ b/utils/CommonUtil.js @@ -372,6 +372,29 @@ const CommonUtil = { } } } + + // 表示隔天了 + if(nextMinute - currentMinute < 1){ + let currentDate = parseInt(data[i].yyyyMMdd); + let nextDate = parseInt(data[i + 1].yyyyMMdd); + if((nextDate - currentDate) == 1){ + for (let j = currentMinute + 1; j <= 1440; j++) { + result.push({ + minute: j, + status: 3, + yyyyMMdd: data[i].yyyyMMdd + }); + } + + for (let j = 0; j < nextMinute; j++) { + result.push({ + minute: j, + status: 3, + yyyyMMdd: data[i + 1].yyyyMMdd + }); + } + } + } } }