|
|
@ -82,7 +82,7 @@ Page({
|
|
|
|
// 连接指定设备
|
|
|
|
// 连接指定设备
|
|
|
|
// if(device.deviceId=="03:02:02:07:65:98"){
|
|
|
|
// 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:5C:B7"){
|
|
|
|
if(device.deviceId=="03:02:02:07:5B:41"){
|
|
|
|
if(device.deviceId=="03:02:02:07:62:3E"){
|
|
|
|
// if(device.deviceId=="03:02:02:07:5E:BE"){
|
|
|
|
// if(device.deviceId=="03:02:02:07:5E:BE"){
|
|
|
|
this.connectToDevice(device.deviceId);
|
|
|
|
this.connectToDevice(device.deviceId);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -311,12 +311,12 @@ Page({
|
|
|
|
console.log("接口需要的睡眠数据:",result);
|
|
|
|
console.log("接口需要的睡眠数据:",result);
|
|
|
|
|
|
|
|
|
|
|
|
// 从缓存中获取睡眠日期
|
|
|
|
// 从缓存中获取睡眠日期
|
|
|
|
let field = CommonUtil.commandToField(0x53);// 根据指令获取字段
|
|
|
|
// let field = CommonUtil.commandToField(0x53);// 根据指令获取字段
|
|
|
|
// console.log("field>>>:",field);
|
|
|
|
// // console.log("field>>>:",field);
|
|
|
|
let lastDate = HealthDataCache.getLastTimeField(field);
|
|
|
|
// let lastDate = HealthDataCache.getLastTimeField(field);
|
|
|
|
console.log("lastDate>>>:",lastDate);
|
|
|
|
// console.log("lastDate>>>:",lastDate);
|
|
|
|
let data = CommonUtil.removeBeforeDate(result,lastDate);
|
|
|
|
// let data = CommonUtil.removeBeforeDate(result,lastDate);
|
|
|
|
console.log("data:",data)
|
|
|
|
// console.log("data:",data)
|
|
|
|
// 更新缓存
|
|
|
|
// 更新缓存
|
|
|
|
HealthDataCache.updateSleepData(result[result.length-1].date);
|
|
|
|
HealthDataCache.updateSleepData(result[result.length-1].date);
|
|
|
|
// 调用接口传睡眠后,清空数据
|
|
|
|
// 调用接口传睡眠后,清空数据
|
|
|
@ -399,7 +399,7 @@ Page({
|
|
|
|
// const HRPacket = DataPacket.generateReadHRDataPacket();
|
|
|
|
// const HRPacket = DataPacket.generateReadHRDataPacket();
|
|
|
|
// SendCommandUtil.sendPackage(this.data.deviceId,HRPacket);
|
|
|
|
// SendCommandUtil.sendPackage(this.data.deviceId,HRPacket);
|
|
|
|
|
|
|
|
|
|
|
|
this.sendHealthCommand(0x66)
|
|
|
|
this.sendHealthCommand(0x53)
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -675,6 +675,10 @@ Page({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return parseInt(Y);
|
|
|
|
return parseInt(Y);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
testFoun(){
|
|
|
|
|
|
|
|
let state = CommonUtil.isNextDay("20250131","20250201");
|
|
|
|
|
|
|
|
console.log("state",state)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|