|
|
|
|
@ -615,26 +615,31 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
);
|
|
|
|
|
this.setState({
|
|
|
|
|
Electricity: jsonStatus.battery,
|
|
|
|
|
matrixElectricity: jsonStatus.matrixBattery,
|
|
|
|
|
workStatus: jsonStatus.workStatus,
|
|
|
|
|
workMode: jsonStatus?.workMode,
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
fr200Electricity: jsonStatus.battery,
|
|
|
|
|
matrixElectricity: jsonStatus.matrixBattery,
|
|
|
|
|
workStatus: jsonStatus.workStatus,
|
|
|
|
|
workMode: jsonStatus?.workMode,
|
|
|
|
|
});
|
|
|
|
|
// this.setState({
|
|
|
|
|
// fr200Electricity: jsonStatus.battery,
|
|
|
|
|
// matrixElectricity: jsonStatus.matrixBattery,
|
|
|
|
|
// workStatus: jsonStatus.workStatus,
|
|
|
|
|
// workMode: jsonStatus?.workMode,
|
|
|
|
|
// });
|
|
|
|
|
// 判断是否在step == 2(护理中)
|
|
|
|
|
if (
|
|
|
|
|
this.state.step == 2 &&
|
|
|
|
|
jsonStatus.workStatus !== MODE_WORKING_ENUM.END
|
|
|
|
|
) {
|
|
|
|
|
this.updateDeviceSyncData({
|
|
|
|
|
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
|
|
|
|
|
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
|
|
|
|
|
});
|
|
|
|
|
this.updateDeviceSyncData(
|
|
|
|
|
{
|
|
|
|
|
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
|
|
|
|
|
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
|
|
|
|
|
},
|
|
|
|
|
jsonStatus
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (jsonStatus.workMode && this.state.step == 2) {
|
|
|
|
|
const { ActiveModeItem } = this.state;
|
|
|
|
|
const item = ActiveModeItem;
|
|
|
|
|
@ -647,16 +652,13 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// // 我忘记了为啥要这样传参... 埋坑了...
|
|
|
|
|
this.judgementWorkStatus(
|
|
|
|
|
jsonStatus.workStatus,
|
|
|
|
|
jsonStatus.workMode,
|
|
|
|
|
jsonStatus
|
|
|
|
|
);
|
|
|
|
|
if (jsonStatus.workMode && this.state.step == 2) {
|
|
|
|
|
// this.judgementModel(jsonStatus.workMode);
|
|
|
|
|
// that.data.startSettingCountDown = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据工作状态:执行逻辑
|
|
|
|
|
|
|
|
|
|
// if (jsonStatus.workMode && this.state.step == 2) {
|
|
|
|
|
// // this.judgementModel(jsonStatus.workMode);
|
|
|
|
|
// // that.data.startSettingCountDown = false;
|
|
|
|
|
// }
|
|
|
|
|
break;
|
|
|
|
|
//设备信息查询返回
|
|
|
|
|
case "InfoQuery":
|
|
|
|
|
@ -816,19 +818,19 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//待完善,以后同步设备数据到小程序的事件,在这个事件里判断是否需要更新页面(是否需要触发setData)
|
|
|
|
|
updateDeviceSyncData = (newData) => {
|
|
|
|
|
updateDeviceSyncData = (newData, jsonStatus) => {
|
|
|
|
|
DeviceSyncData = {
|
|
|
|
|
...DeviceSyncData,
|
|
|
|
|
...newData,
|
|
|
|
|
};
|
|
|
|
|
if (newData.hasOwnProperty("totalWorkingSeconds")) {
|
|
|
|
|
this.renderDeviceStatus.renderWorkTime();
|
|
|
|
|
this.renderDeviceStatus.renderWorkTime(jsonStatus);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 渲染页面时间状态
|
|
|
|
|
// 页面同步护理剩余时间
|
|
|
|
|
renderDeviceStatus = {
|
|
|
|
|
renderWorkTime: () => {
|
|
|
|
|
renderWorkTime: (jsonStatus) => {
|
|
|
|
|
const { totalWorkingMinutes, totalWorkingSeconds } = DeviceSyncData;
|
|
|
|
|
const { ActiveModeItem, currentTime } = this.state;
|
|
|
|
|
const totalTime = totalWorkingMinutes * 60 + totalWorkingSeconds;
|
|
|
|
|
@ -840,7 +842,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
const timeRemaining = sceneTime - hourMinSecToS(currentTime); // 小程序上已运行的总秒数
|
|
|
|
|
if (
|
|
|
|
|
Math.abs(timeRemaining - totalTime) >= 2 &&
|
|
|
|
|
Math.abs(timeRemaining - totalTime) >= 0 &&
|
|
|
|
|
this.state.step == 2 &&
|
|
|
|
|
this.state.facialMaskConnectStatus == 1
|
|
|
|
|
) {
|
|
|
|
|
@ -853,6 +855,14 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
ActiveModeItem,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Math.abs(timeRemaining - totalTime) < 0) {
|
|
|
|
|
this.judgementWorkStatus(
|
|
|
|
|
MODE_WORKING_ENUM.END,
|
|
|
|
|
jsonStatus.workMode,
|
|
|
|
|
jsonStatus
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -891,9 +901,8 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
// ActiveModeItem
|
|
|
|
|
let nowModeItem;
|
|
|
|
|
if (nWorkMode) {
|
|
|
|
|
const nowModeType = WORK_MODE_TYPE[nWorkMode];
|
|
|
|
|
nowModeItem = ModeList.find((item) => {
|
|
|
|
|
return item.model_type == nowModeType;
|
|
|
|
|
return item.modeType === nWorkMode;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
opts.workStatus = nWorkStatus;
|
|
|
|
|
@ -908,7 +917,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
isShowCountdown: false,
|
|
|
|
|
});
|
|
|
|
|
if (nowModeItem?.isStandMode && step == 2) {
|
|
|
|
|
opts.currentTime = nowModeItem.time;
|
|
|
|
|
opts.currentTime = nowModeItem.modeTime;
|
|
|
|
|
} else if (!nowModeItem?.isStandMode && step == 2) {
|
|
|
|
|
// fix: 启动非支架模式倒计时时,连上支架,仪器的状态变为standby
|
|
|
|
|
opts.step = 1;
|
|
|
|
|
@ -943,7 +952,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (nowModeItem) {
|
|
|
|
|
opts.currentTime = nowModeItem.time;
|
|
|
|
|
opts.currentTime = nowModeItem.modeTime;
|
|
|
|
|
}
|
|
|
|
|
// startSettingCountDown 用于标记打开了倒计时loading
|
|
|
|
|
if (!this.state.isShowCountdown) {
|
|
|
|
|
@ -999,7 +1008,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
currentTime: s_to_hms(timeRemaining),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.endnursing(null, true);
|
|
|
|
|
this.endnursing(true);
|
|
|
|
|
// this.rmWL200NursingHistory(this.state.WL200NursingHistory);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
@ -1048,7 +1057,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
* 结束护理
|
|
|
|
|
* param isAuto 是否仪器自动结束
|
|
|
|
|
*/
|
|
|
|
|
endnursing(e, isAuto) {
|
|
|
|
|
endnursing = (isAuto) => {
|
|
|
|
|
if (isAuto == true) {
|
|
|
|
|
// 仪器自动上报完成, 直接上报并跳转报告页
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|
@ -1062,16 +1071,9 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
// this.handleTimeCheck(that.endNurseFun)
|
|
|
|
|
} else {
|
|
|
|
|
// 手动点击结束, 弹出弹窗, 看看是否需要结束
|
|
|
|
|
this.setState({
|
|
|
|
|
popupType: "endPopup",
|
|
|
|
|
});
|
|
|
|
|
/*showModal({
|
|
|
|
|
t2: "是否结束护理?",
|
|
|
|
|
}).then(async () => {
|
|
|
|
|
this.handleTimeCheck(that.endNurseFun)
|
|
|
|
|
});*/
|
|
|
|
|
this.onEndPlan();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 设置自定义模式数据
|
|
|
|
|
setCustomModeData() {
|
|
|
|
|
@ -1436,6 +1438,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
Electricity,
|
|
|
|
|
errorTips,
|
|
|
|
|
isEndCarePlan,
|
|
|
|
|
currentTime,
|
|
|
|
|
} = this.state;
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
@ -1505,7 +1508,7 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
className="msg-tips-img"
|
|
|
|
|
src={require("../../img/tips.png")}
|
|
|
|
|
/>
|
|
|
|
|
<View className="msg-tips-content">{{ errorTips }}</View>
|
|
|
|
|
<View className="msg-tips-content">{errorTips}</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
@ -1513,27 +1516,17 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
|
|
|
|
|
<View className="iot-device">
|
|
|
|
|
<View className="item border-right">
|
|
|
|
|
<Text>护理时间:10:00</Text>
|
|
|
|
|
<Text>护理时间:{currentTime}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
<View className="item">
|
|
|
|
|
<Text>WE200电量:</Text>
|
|
|
|
|
<View className="value flex aitems">
|
|
|
|
|
{Electricity === 5 && (
|
|
|
|
|
<Block>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
{Electricity === 4 && (
|
|
|
|
|
{Electricity >= 4 && (
|
|
|
|
|
<Block>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
{Electricity === 3 && (
|
|
|
|
|
@ -1542,7 +1535,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
{Electricity === 2 && (
|
|
|
|
|
@ -1551,7 +1543,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
<View className="v1 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
{Electricity === 1 && (
|
|
|
|
|
@ -1560,7 +1551,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
{Electricity === 0 && (
|
|
|
|
|
@ -1569,7 +1559,6 @@ class IotCarePlan extends Component<any, any> {
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
<View className="v2 battery_icon"></View>
|
|
|
|
|
</Block>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
|