|
|
|
|
@ -66,6 +66,7 @@ import commandMap from "@/utils/commandMap";
|
|
|
|
|
import { Popup } from "@antmjs/vantui";
|
|
|
|
|
|
|
|
|
|
const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200");
|
|
|
|
|
let deviceToolKitInstance = deviceToolKitInstanceFR200;
|
|
|
|
|
|
|
|
|
|
let currentTimeTimer: any = null; // 当前项目时间定时器
|
|
|
|
|
let CountdownTimer: any = null;
|
|
|
|
|
@ -102,7 +103,6 @@ let DeviceSyncData = {
|
|
|
|
|
totalWorkingMinutes: 0,
|
|
|
|
|
totalWorkingSeconds: 0,
|
|
|
|
|
};
|
|
|
|
|
let deviceToolKitInstance = deviceToolKitInstanceFR200;
|
|
|
|
|
|
|
|
|
|
class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
@ -121,7 +121,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
basicModeList: [], //模式列表
|
|
|
|
|
modelActiveIndex: 0, //模式下标
|
|
|
|
|
sliderProgress: 22,
|
|
|
|
|
facialMaskConnectStatus: 1, // 面罩连接状态 0未连接 1已连接
|
|
|
|
|
DeviceConnectStatus: 1, // 面罩连接状态 0未连接 1已连接
|
|
|
|
|
Electricity: 4, // WL200电量
|
|
|
|
|
matrixElectricity: 4, // WE200发箍电量
|
|
|
|
|
|
|
|
|
|
@ -129,7 +129,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
gear: { gear: 1 },
|
|
|
|
|
currentShowDialog: "",
|
|
|
|
|
step: 1, // 1:选择模式并播放视频, 2:护理中
|
|
|
|
|
showVideoPlayBtn: true, // 视频播放按钮
|
|
|
|
|
duration: 0, // 视频总时长
|
|
|
|
|
hadShowBreakTips: false, // 是否展示过支架断开提示
|
|
|
|
|
@ -148,11 +147,14 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
/** 护理过程 END*/
|
|
|
|
|
|
|
|
|
|
// 模式列表
|
|
|
|
|
isModeLock: false, // 模式是否锁定
|
|
|
|
|
isSwitchActiveMode: false, // 是否显示弹窗切换模式
|
|
|
|
|
ModeList: [],
|
|
|
|
|
ModeType: "all", // all
|
|
|
|
|
modeClass: "", // 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤
|
|
|
|
|
ActiveModeItem: {}, // 当前选中模式
|
|
|
|
|
ActiveModeItem: {
|
|
|
|
|
openSourceData: [],
|
|
|
|
|
}, // 当前选中模式
|
|
|
|
|
SwitchActiveModeItem: {}, // 切换选中模式
|
|
|
|
|
ModeID: "mode_", // 模式KEY
|
|
|
|
|
activeModeID: "", // 当前选中模式ID:用于高亮
|
|
|
|
|
@ -164,8 +166,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
stopSource: "",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 模式组合
|
|
|
|
|
isCombineSuccess: false, // 组合模式是否设置成功
|
|
|
|
|
// 倒计时
|
|
|
|
|
isShowCountdown: false, // 倒计时弹窗
|
|
|
|
|
countdown: 3,
|
|
|
|
|
@ -209,6 +209,17 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
hadGotInstrumentHistoryData = false; // 是否已缓存仪器历史数据
|
|
|
|
|
hadLoadedPage = false; // 判断是否首次进入页面
|
|
|
|
|
|
|
|
|
|
// FR200同步状态
|
|
|
|
|
FR200Status: any = {
|
|
|
|
|
gear: 1, // 1-5 挡位
|
|
|
|
|
isCharging: false, // 是否充电
|
|
|
|
|
joulePerSecond: 0, // 每秒焦耳 0-10
|
|
|
|
|
nasolabialOrMandibularOutput: false, // 鼻唇或下颌输出
|
|
|
|
|
partition: 0, // 分割?
|
|
|
|
|
pointOutChangeSide: false, // 交叉输出点
|
|
|
|
|
impedance: 107, // 阻抗?
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** FR200模式类型:名称 */
|
|
|
|
|
ModeTypeArray: string[] = [
|
|
|
|
|
"all",
|
|
|
|
|
@ -450,10 +461,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
if (data.serviceData.length > 0) {
|
|
|
|
|
this.setServiceTimeData();
|
|
|
|
|
}
|
|
|
|
|
// 存在组合模式时,设置组合模式
|
|
|
|
|
if (data.combineData.length > 0) {
|
|
|
|
|
this.setCustomMaskData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 如果是正在运行中切换,则直接准备运行
|
|
|
|
|
@ -480,7 +487,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.state.step == 2 && this.state.facialMaskConnectStatus == 1) {
|
|
|
|
|
if (this.isRuning === true && this.state.DeviceConnectStatus == 1) {
|
|
|
|
|
// 提示切换护理模式
|
|
|
|
|
if (this.isCheckNurseTime()) {
|
|
|
|
|
// 满足时间条件,提示是否保存部分护理记录
|
|
|
|
|
@ -533,11 +540,11 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
stepNext = () => {
|
|
|
|
|
let modeClass = this.state.ActiveModeItem.modeClass;
|
|
|
|
|
this.workStatus = "pause";
|
|
|
|
|
this.isRuning = true; // 暂停也是运行中
|
|
|
|
|
this.setState({
|
|
|
|
|
ModeType: this.ModeTypeArray[modeClass],
|
|
|
|
|
isShowNurse: true,
|
|
|
|
|
isStopNurse: true,
|
|
|
|
|
step: 2,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
@ -565,7 +572,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @name 不可切换光照提示
|
|
|
|
|
* @description isCabinMode是否舱体模式。 0.检测面罩与舱体是否仍在连接中,需要分离 1.检测是否连接失败,需要重新连接
|
|
|
|
|
* @description 检测紧贴肌肤
|
|
|
|
|
*/
|
|
|
|
|
onEmitErrorTips = async () => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
@ -574,13 +581,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
// 按钮不可点击时,提示报错
|
|
|
|
|
let isDisabled = this.footerIsDisabled();
|
|
|
|
|
if (isDisabled) {
|
|
|
|
|
if (ActiveModeItem.isCabinMode === 0) {
|
|
|
|
|
this.showTips("检测到面罩与舱体仍在连接中,该模式需要分离面罩和舱体");
|
|
|
|
|
} else {
|
|
|
|
|
this.showTips(
|
|
|
|
|
"检测到面罩与舱体未连接成功,请确认面罩是否和舱体连接并接通舱体电源"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
@ -626,119 +627,19 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
this.setState({ isShowStepTips: false });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 蓝牙相关 */
|
|
|
|
|
/** 蓝牙连接相关 */
|
|
|
|
|
switchBLEMatch = (jsonStatus: any) => {
|
|
|
|
|
console.log("蓝牙相关", jsonStatus);
|
|
|
|
|
let { ActiveModeItem } = this.state;
|
|
|
|
|
|
|
|
|
|
console.log("蓝牙连接相关", jsonStatus);
|
|
|
|
|
switch (jsonStatus.bleCommandType) {
|
|
|
|
|
// 如果设备配对链接发送配对码的时候,设备应答小程序配对码是否正确。
|
|
|
|
|
case "SendMatchCode":
|
|
|
|
|
if (jsonStatus.matchedSuccess) {
|
|
|
|
|
console.log("设备配对成功");
|
|
|
|
|
this.setState({
|
|
|
|
|
facialMaskConnectStatus: 1,
|
|
|
|
|
DeviceConnectStatus: 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
// 设备状态主动上报,这种指令是主机主动上报某个附属设备断开或者连上了
|
|
|
|
|
case "BleStatusSync":
|
|
|
|
|
console.log("BleStatusSync 附属设备状态主动上报", jsonStatus);
|
|
|
|
|
switch (jsonStatus.connectMessage?.deviceName) {
|
|
|
|
|
case "WL200":
|
|
|
|
|
if (jsonStatus.connectMessage?.connectType == "CONNECTED") {
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
facialMaskConnectStatus: 0, // 蓝牙断开
|
|
|
|
|
isFooterBtnDisabled: false, // 蓝牙断开所以不可点击
|
|
|
|
|
});
|
|
|
|
|
// 断开连接直接暂停:会自动暂停定时器
|
|
|
|
|
this.judgementWorkStatus(
|
|
|
|
|
MODE_WORKING_ENUM.PAUSE,
|
|
|
|
|
ActiveModeItem?.modeType
|
|
|
|
|
);
|
|
|
|
|
// 设备断开时,给定一个断开时间
|
|
|
|
|
ActiveModeItem.breakTimeStr = this.state.currentTime;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
// 附属设备是否连接支架
|
|
|
|
|
case "Stand":
|
|
|
|
|
if (jsonStatus.connectMessage?.connectType == "CONNECTED") {
|
|
|
|
|
console.log("舱体支架连接");
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: true,
|
|
|
|
|
});
|
|
|
|
|
if (!this.state.isStandStatus && this.isRuning) {
|
|
|
|
|
// 断开连接直接暂停
|
|
|
|
|
this.judgementWorkStatus(
|
|
|
|
|
MODE_WORKING_ENUM.PAUSE,
|
|
|
|
|
ActiveModeItem?.modeType
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
console.log("舱体支架断开连接");
|
|
|
|
|
|
|
|
|
|
if (this.state.isStandStatus && this.isRuning) {
|
|
|
|
|
// 断开连接直接暂停
|
|
|
|
|
this.judgementWorkStatus(
|
|
|
|
|
MODE_WORKING_ENUM.PAUSE,
|
|
|
|
|
ActiveModeItem?.modeType
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 设备断开时,给定一个断开时间
|
|
|
|
|
ActiveModeItem.breakTimeStr = this.state.currentTime;
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: false,
|
|
|
|
|
isStopNurse: true,
|
|
|
|
|
ActiveModeItem,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.onEmitErrorTips();
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.footerIsDisabled();
|
|
|
|
|
}, 100);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
console.log("监听到到设备连接状态改变 this.footerIsDisabled()");
|
|
|
|
|
this.footerIsDisabled(); // 判断底部运行按钮是否可点击
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
//小程序主动问主机,现在链接了哪些附属设备,这时候主机给小程序的回复消息
|
|
|
|
|
case "QueryMatchStatus":
|
|
|
|
|
console.log("QueryMatchStatus 设备回复小程序", jsonStatus);
|
|
|
|
|
|
|
|
|
|
const isStandDevice = jsonStatus?.subDeviceList?.includes("Stand");
|
|
|
|
|
deviceToolKitInstance = deviceToolKitInstanceFR200;
|
|
|
|
|
console.log("支架是否链接", isStandDevice);
|
|
|
|
|
this.setState({
|
|
|
|
|
isStandStatus: isStandDevice,
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.footerIsDisabled();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 连上面罩后, 获取仪器记录, 与缓存信息对比
|
|
|
|
|
if (!this.hadGotInstrumentHistoryData) {
|
|
|
|
|
// 查询护理记录
|
|
|
|
|
this.getInstrumentHistoryData();
|
|
|
|
|
|
|
|
|
|
// 查询仪器状态
|
|
|
|
|
const queryDeviceArrayBuffer = deviceToolKitInstance.toBleCommand(
|
|
|
|
|
bleCommandSamples.queryDeviceStatus as any
|
|
|
|
|
);
|
|
|
|
|
console.log("发送查询设备指令 获取仪器状态");
|
|
|
|
|
sendCommand({
|
|
|
|
|
value: queryDeviceArrayBuffer,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -776,16 +677,18 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
break;
|
|
|
|
|
//设备状态同步
|
|
|
|
|
case "DeviceStatusSync":
|
|
|
|
|
console.log("设备状态同步", jsonStatus);
|
|
|
|
|
switch (jsonStatus.workStatus) {
|
|
|
|
|
case "standby":
|
|
|
|
|
//设备的待机状态 可能workMode字段为空
|
|
|
|
|
console.log("设备状态同步 待机状态", jsonStatus);
|
|
|
|
|
break;
|
|
|
|
|
case "pause":
|
|
|
|
|
//设备的暂停状态
|
|
|
|
|
console.log("设备状态同步 暂停状态", jsonStatus);
|
|
|
|
|
break;
|
|
|
|
|
case "working":
|
|
|
|
|
//设备的运行中状态
|
|
|
|
|
console.log("设备状态同步 运行中状态", jsonStatus);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
@ -954,8 +857,8 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
sceneTime > totalTime &&
|
|
|
|
|
this.state.step == 2 &&
|
|
|
|
|
this.state.facialMaskConnectStatus == 1
|
|
|
|
|
this.isRuning === true &&
|
|
|
|
|
this.state.DeviceConnectStatus == 1
|
|
|
|
|
) {
|
|
|
|
|
// 界面倒计时同步设备时间
|
|
|
|
|
const t = sceneTime - totalTime; // 场景时间 - 已运行时间 = 剩余时间
|
|
|
|
|
@ -999,7 +902,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
* params 工作状态 工作模式 响应状态
|
|
|
|
|
*/
|
|
|
|
|
judgementWorkStatus(nWorkStatus, nWorkMode) {
|
|
|
|
|
const { step, workMode, ActiveModeItem, ModeList } = this.state;
|
|
|
|
|
const { workMode, ActiveModeItem, ModeList } = this.state;
|
|
|
|
|
const opts: any = {};
|
|
|
|
|
// ActiveModeItem
|
|
|
|
|
let nowModeItem;
|
|
|
|
|
@ -1026,11 +929,11 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
this.setState({
|
|
|
|
|
isShowCountdown: false,
|
|
|
|
|
});
|
|
|
|
|
if (nowModeItem?.isCabinMode && step == 2) {
|
|
|
|
|
if (nowModeItem?.isCabinMode && this.isRuning === true) {
|
|
|
|
|
opts.currentTime = nowCurrentTime;
|
|
|
|
|
} else if (!nowModeItem?.isCabinMode && step == 2) {
|
|
|
|
|
} else if (!nowModeItem?.isCabinMode && this.isRuning === true) {
|
|
|
|
|
// fix: 启动非支架模式倒计时时,连上支架,仪器的状态变为standby
|
|
|
|
|
opts.step = 1;
|
|
|
|
|
this.isRuning === false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
setting: () => {
|
|
|
|
|
@ -1038,14 +941,14 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
this.setState({
|
|
|
|
|
hadShowBreakTips: false,
|
|
|
|
|
});
|
|
|
|
|
if (step != 2 && !ActiveModeItem.isCabinMode) {
|
|
|
|
|
opts.step = 2;
|
|
|
|
|
if (this.isRuning === false && !ActiveModeItem.isCabinMode) {
|
|
|
|
|
this.isRuning = true;
|
|
|
|
|
this.setState({
|
|
|
|
|
title: "正在护理",
|
|
|
|
|
isStopNurse: false,
|
|
|
|
|
});
|
|
|
|
|
} else if (step != 2 && ActiveModeItem.isCabinMode) {
|
|
|
|
|
opts.step = 2;
|
|
|
|
|
} else if (this.isRuning === false && ActiveModeItem.isCabinMode) {
|
|
|
|
|
this.isRuning = true;
|
|
|
|
|
// this.setState({
|
|
|
|
|
// title: "正在护理",
|
|
|
|
|
// });
|
|
|
|
|
@ -1066,11 +969,11 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
working: () => {
|
|
|
|
|
if (this.state.facialMaskConnectStatus != 1) {
|
|
|
|
|
if (this.state.DeviceConnectStatus != 1) {
|
|
|
|
|
opts.workStatus = MODE_WORKING_ENUM.STANDBY;
|
|
|
|
|
opts.step = 1;
|
|
|
|
|
} else if (step != 2) {
|
|
|
|
|
opts.step = 2;
|
|
|
|
|
this.isRuning = false;
|
|
|
|
|
} else if (this.isRuning === false) {
|
|
|
|
|
this.isRuning = false;
|
|
|
|
|
this.setState({
|
|
|
|
|
title: "正在护理",
|
|
|
|
|
isStopNurse: false,
|
|
|
|
|
@ -1140,8 +1043,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
currentTimeTimer && clearInterval(currentTimeTimer);
|
|
|
|
|
currentTimeTimer = setInterval(() => {
|
|
|
|
|
let {
|
|
|
|
|
step,
|
|
|
|
|
facialMaskConnectStatus,
|
|
|
|
|
DeviceConnectStatus,
|
|
|
|
|
currentTime,
|
|
|
|
|
ModeStepTimeArray,
|
|
|
|
|
ModeStepIndex,
|
|
|
|
|
@ -1149,8 +1051,8 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
} = this.state;
|
|
|
|
|
if (
|
|
|
|
|
this.workStatus == MODE_WORKING_ENUM.WORKING &&
|
|
|
|
|
step == 2 &&
|
|
|
|
|
facialMaskConnectStatus == 1
|
|
|
|
|
this.isRuning &&
|
|
|
|
|
DeviceConnectStatus == 1
|
|
|
|
|
) {
|
|
|
|
|
let totalSeconds = ActiveModeItem?.breakTimeStr
|
|
|
|
|
? minSecToS(ActiveModeItem.breakTimeStr)
|
|
|
|
|
@ -1220,23 +1122,15 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
// 检测并控制工作状态
|
|
|
|
|
handleWorkStatus = (isBtnClick: boolean, workStatus) => {
|
|
|
|
|
const { facialMaskConnectStatus, isStandStatus, ActiveModeItem } =
|
|
|
|
|
this.state;
|
|
|
|
|
const { DeviceConnectStatus, ActiveModeItem } = this.state;
|
|
|
|
|
let newWorkStatus =
|
|
|
|
|
workStatus ||
|
|
|
|
|
(this.workStatus == MODE_WORKING_ENUM.WORKING ? "pause" : "working");
|
|
|
|
|
if (isBtnClick && newWorkStatus == "working") {
|
|
|
|
|
// 舱体模式
|
|
|
|
|
if (ActiveModeItem.isCabinMode === 1 && !isStandStatus) {
|
|
|
|
|
this.showTips(
|
|
|
|
|
`检测到舱体未连接成功,请确认面罩开机后与舱体连接,并接通舱体电源`
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 非舱体模式
|
|
|
|
|
if (!ActiveModeItem.isCabinMode && facialMaskConnectStatus != 1) {
|
|
|
|
|
console.log("facialMaskConnectStatus", facialMaskConnectStatus);
|
|
|
|
|
this.showTips("检测到面罩未连接成功,请确认面罩开机并佩戴");
|
|
|
|
|
// todo FR200 不判断舱体,判断肌肤
|
|
|
|
|
if (!ActiveModeItem.isCabinMode && DeviceConnectStatus != 1) {
|
|
|
|
|
console.log("DeviceConnectStatus", DeviceConnectStatus);
|
|
|
|
|
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后点击重新检测");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1280,48 +1174,11 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
});
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
const { ActiveModeItem, isStandStatus, facialMaskConnectStatus } =
|
|
|
|
|
this.state;
|
|
|
|
|
const { ActiveModeItem, DeviceConnectStatus } = this.state;
|
|
|
|
|
|
|
|
|
|
if (isStandStatus === true && ActiveModeItem.isCabinMode === 0) {
|
|
|
|
|
console.log("已连接舱体,只可选择舱体模式");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isStandStatus === false && ActiveModeItem.isCabinMode === 1) {
|
|
|
|
|
console.log("未连接舱体!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.info(
|
|
|
|
|
commandMap.WL200Command,
|
|
|
|
|
"点击开始护理按钮",
|
|
|
|
|
`当前模式: ${ActiveModeItem.modeType}`,
|
|
|
|
|
`当前面罩状态:${facialMaskConnectStatus}`,
|
|
|
|
|
`当前仪器模式:${this.workStatus}`
|
|
|
|
|
);
|
|
|
|
|
console.log(ActiveModeItem);
|
|
|
|
|
console.log("isStandStatus:" + isStandStatus);
|
|
|
|
|
|
|
|
|
|
if (facialMaskConnectStatus != 1) {
|
|
|
|
|
console.log("facialMaskConnectStatus 开始处", facialMaskConnectStatus);
|
|
|
|
|
this.showTips("检测到面罩未连接成功,请确认面罩开机并佩戴");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 如果是强效舒缓,需要判断是否连接支架
|
|
|
|
|
if (ActiveModeItem.isCabinMode && !isStandStatus) {
|
|
|
|
|
this.showTips(
|
|
|
|
|
`检测到舱体未连接成功,请确认面罩开机后与舱体连接,并接通舱体电源`
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
} else if (!ActiveModeItem.isCabinMode && isStandStatus) {
|
|
|
|
|
this.showTips(`检测到面罩仍和舱体连接中,请分离后切换`);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
ActiveModeItem.modeType === "MaskCustom" &&
|
|
|
|
|
!this.state.isCombineSuccess
|
|
|
|
|
) {
|
|
|
|
|
this.showTips(`${ActiveModeItem.modeName}模式设置失败,请联系小助手`);
|
|
|
|
|
if (DeviceConnectStatus != 1) {
|
|
|
|
|
console.log("DeviceConnectStatus 开始处", DeviceConnectStatus);
|
|
|
|
|
this.showTips("检测到FR200未连接成功,请确认FR200开机并佩戴");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1424,6 +1281,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
isFooterBtnDisabled: false,
|
|
|
|
|
});
|
|
|
|
|
if (this.workJsonStatus.workMode) {
|
|
|
|
|
// FR200可能要判断是否水分测试 Test
|
|
|
|
|
console.log("this.workJsonStatus.workMode", this.workJsonStatus.workMode);
|
|
|
|
|
if (this.workJsonStatus.workMode.indexOf("Stand") > -1) {
|
|
|
|
|
console.log(
|
|
|
|
|
@ -1471,7 +1329,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
console.log("workStatus", workStatus);
|
|
|
|
|
console.log("jsonStatus", jsonStatus, this.workJsonStatus);
|
|
|
|
|
console.log("currentTime", WL200NursingHistory.currentTime);
|
|
|
|
|
console.log("isStandStatus", this.state.isStandStatus);
|
|
|
|
|
|
|
|
|
|
let historyElapsedTime =
|
|
|
|
|
minSecToS(recordModeItem.modeTimeStr) -
|
|
|
|
|
@ -1539,9 +1396,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
// 同步时间
|
|
|
|
|
if (jsonStatus.id == WL200NursingHistory.id) {
|
|
|
|
|
if (WL200NursingHistory.currentTime) {
|
|
|
|
|
this.setState({
|
|
|
|
|
step: 2,
|
|
|
|
|
});
|
|
|
|
|
this.isRuning = true;
|
|
|
|
|
this.resetTimer();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1572,10 +1427,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
if (ActiveModeItem.serviceData.length > 0) {
|
|
|
|
|
this.setServiceTimeData();
|
|
|
|
|
}
|
|
|
|
|
// 存在组合模式时,设置组合模式
|
|
|
|
|
if (ActiveModeItem.combineData.length > 0) {
|
|
|
|
|
this.setCustomMaskData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1771,43 +1622,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
});
|
|
|
|
|
return modesArray;
|
|
|
|
|
};
|
|
|
|
|
setCustomMaskData() {
|
|
|
|
|
console.log("================");
|
|
|
|
|
console.log("setCustomMaskData");
|
|
|
|
|
console.log("================");
|
|
|
|
|
|
|
|
|
|
// modesArray 发送组合模式数组指令到设备存储
|
|
|
|
|
let modesArray = this.getCustomModesArray();
|
|
|
|
|
console.log("组合模式modesArray", modesArray);
|
|
|
|
|
|
|
|
|
|
let customModeSetCommand = {
|
|
|
|
|
commandType: "InfoQuery",
|
|
|
|
|
infoQueryType: "customModeSet",
|
|
|
|
|
modesArray,
|
|
|
|
|
};
|
|
|
|
|
let commandBuffer = deviceToolKitInstance.toBleCommand(
|
|
|
|
|
customModeSetCommand as any
|
|
|
|
|
);
|
|
|
|
|
sendCommand({
|
|
|
|
|
value: commandBuffer,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
console.info("发送切换组合模式指令成功", res);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 发送启动组合模式指令
|
|
|
|
|
startCombinationMode() {
|
|
|
|
|
const jsonCommand = {
|
|
|
|
|
commandType: "DeviceControl",
|
|
|
|
|
workStatus: "working",
|
|
|
|
|
workMode: "MaskCustom",
|
|
|
|
|
};
|
|
|
|
|
let commandBuffer = deviceToolKitInstance.toBleCommand(jsonCommand as any);
|
|
|
|
|
sendCommand({
|
|
|
|
|
value: commandBuffer,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
console.info("发送启动组合模式指令成功 参数为 =>", jsonCommand);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 护理的错误提示
|
|
|
|
|
showTips(ctx) {
|
|
|
|
|
@ -1960,20 +1774,11 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
* @returns 返回true则禁用
|
|
|
|
|
*/
|
|
|
|
|
footerIsDisabled = () => {
|
|
|
|
|
let { isStandStatus } = this.state;
|
|
|
|
|
let isCanClick = isStandStatus
|
|
|
|
|
? this.tempModeCurrent?.isCabinMode === 1
|
|
|
|
|
: this.tempModeCurrent?.isCabinMode === 0;
|
|
|
|
|
// 如果舱体状态和模式类型不相等,则禁用
|
|
|
|
|
let isFooterBtnDisabled = false;
|
|
|
|
|
|
|
|
|
|
if (!isCanClick) {
|
|
|
|
|
isFooterBtnDisabled = true;
|
|
|
|
|
}
|
|
|
|
|
console.log("isCanClick", isCanClick);
|
|
|
|
|
console.log("isFooterBtnDisabled", isFooterBtnDisabled);
|
|
|
|
|
// 仅在值变化时更新state
|
|
|
|
|
// if (isFooterBtnDisabled !== this.state.isFooterBtnDisabled) {
|
|
|
|
|
// if () {
|
|
|
|
|
// isFooterBtnDisabled = true;
|
|
|
|
|
// }
|
|
|
|
|
this.setState({
|
|
|
|
|
isFooterBtnDisabled: isFooterBtnDisabled,
|
|
|
|
|
});
|
|
|
|
|
@ -1986,6 +1791,13 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
Taro.reLaunch({ url: "/pages/index/index" });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onModeLockOpen = async () => {
|
|
|
|
|
this.setState({ isModeLock: true });
|
|
|
|
|
};
|
|
|
|
|
onModeLockClose = async () => {
|
|
|
|
|
this.setState({ isModeLock: false });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {
|
|
|
|
|
title,
|
|
|
|
|
@ -1998,7 +1810,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
ModeStepIndex,
|
|
|
|
|
currentServiceData,
|
|
|
|
|
ActiveModeItem,
|
|
|
|
|
SwitchActiveModeItem,
|
|
|
|
|
isSwitchActiveMode,
|
|
|
|
|
ModeID,
|
|
|
|
|
activeModeID,
|
|
|
|
|
@ -2009,7 +1820,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
errorTips,
|
|
|
|
|
isEndCarePlan,
|
|
|
|
|
currentTime,
|
|
|
|
|
facialMaskConnectStatus,
|
|
|
|
|
DeviceConnectStatus,
|
|
|
|
|
isShowErrorTipsText,
|
|
|
|
|
errorTipsText,
|
|
|
|
|
isNotEnoughTime,
|
|
|
|
|
@ -2022,7 +1833,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
isShowReReadRecordSave,
|
|
|
|
|
isFooterBtnDisabled,
|
|
|
|
|
isShowHistoryMsg,
|
|
|
|
|
stepIndex,
|
|
|
|
|
isModeLock,
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@ -2035,6 +1846,17 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<View catchMove>
|
|
|
|
|
<PopupAlert
|
|
|
|
|
isShow={isModeLock}
|
|
|
|
|
zIndex={10020}
|
|
|
|
|
myClassName="level-up"
|
|
|
|
|
title="提示"
|
|
|
|
|
content="该模式即将上线,敬请期待"
|
|
|
|
|
confirmButtonText="我知道了"
|
|
|
|
|
textAlgin="center"
|
|
|
|
|
close={this.onModeLockClose}
|
|
|
|
|
confirm={this.onModeLockClose}
|
|
|
|
|
/>
|
|
|
|
|
<PopupInstrumentUploadTips
|
|
|
|
|
isShow={isFirstTipShow}
|
|
|
|
|
zIndex={10020}
|
|
|
|
|
@ -2074,6 +1896,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
ModeType={ModeType}
|
|
|
|
|
onEmit={this.switchModeCurrentFun}
|
|
|
|
|
onEmitShowAll={this.openModeSwitch}
|
|
|
|
|
onModeLockOpen={this.onModeLockOpen}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
textAlgin="center"
|
|
|
|
|
@ -2083,7 +1906,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
confirm={this.confirmModeSwitchBtn}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
{ActiveModeItem.openSourceData && (
|
|
|
|
|
{ActiveModeItem.openSourceData.length > 0 && (
|
|
|
|
|
<PopupStepTips
|
|
|
|
|
isShow={isShowStepTips}
|
|
|
|
|
isLarge
|
|
|
|
|
@ -2222,7 +2045,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
<ElectricityView
|
|
|
|
|
Electricity={Electricity}
|
|
|
|
|
matrixElectricity={matrixElectricity}
|
|
|
|
|
facialMaskConnectStatus={facialMaskConnectStatus}
|
|
|
|
|
DeviceConnectStatus={DeviceConnectStatus}
|
|
|
|
|
/>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
@ -2237,6 +2060,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
activeModeID={activeModeID}
|
|
|
|
|
onEmit={this.modeCurrentFun}
|
|
|
|
|
onEmitShowAll={this.openModeSwitch}
|
|
|
|
|
onModeLockOpen={this.onModeLockOpen}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|