fix:倒计时的定时器刷新显示失败

master
blak-kong 2 years ago
parent 9b93ce8c0a
commit 11f5aed2dc

@ -134,7 +134,6 @@ class IotCarePlan extends Component<any, any> {
modelActiveIndex: 0, //模式下标 modelActiveIndex: 0, //模式下标
sliderProgress: 22, sliderProgress: 22,
facialMaskConnectStatus: 1, // 面罩连接状态 0未连接 1已连接 facialMaskConnectStatus: 1, // 面罩连接状态 0未连接 1已连接
workStatus: "", // 工作状态
Electricity: 4, // WL200电量 Electricity: 4, // WL200电量
matrixElectricity: 4, // WE200发箍电量 matrixElectricity: 4, // WE200发箍电量
@ -471,7 +470,6 @@ class IotCarePlan extends Component<any, any> {
ModeType: modeArray[modeClass], ModeType: modeArray[modeClass],
isShowNurse: true, isShowNurse: true,
isStopNurse: true, isStopNurse: true,
workStatus: "pause",
step: 2, step: 2,
}); });
@ -837,14 +835,8 @@ class IotCarePlan extends Component<any, any> {
* params * params
*/ */
judgementWorkStatus(nWorkStatus, nWorkMode, jsonStatus) { judgementWorkStatus(nWorkStatus, nWorkMode, jsonStatus) {
const { const { step, isStandStatus, workMode, ActiveModeItem, ModeList } =
workStatus, this.state;
step,
isStandStatus,
workMode,
ActiveModeItem,
ModeList,
} = this.state;
const opts: any = {}; const opts: any = {};
// ActiveModeItem // ActiveModeItem
let nowModeItem; let nowModeItem;
@ -981,7 +973,6 @@ class IotCarePlan extends Component<any, any> {
currentTimeTimer && clearInterval(currentTimeTimer); currentTimeTimer && clearInterval(currentTimeTimer);
currentTimeTimer = setInterval(() => { currentTimeTimer = setInterval(() => {
let { let {
workStatus,
step, step,
facialMaskConnectStatus, facialMaskConnectStatus,
currentTime, currentTime,
@ -989,9 +980,9 @@ class IotCarePlan extends Component<any, any> {
ModeStepIndex, ModeStepIndex,
ActiveModeItem, ActiveModeItem,
} = this.state; } = this.state;
console.log("resetTimer workStatus", workStatus); console.log("resetTimer workStatus", this.workStatus);
if ( if (
workStatus == MODE_WORKING_ENUM.WORKING && this.workStatus == MODE_WORKING_ENUM.WORKING &&
step == 2 && step == 2 &&
facialMaskConnectStatus == 1 facialMaskConnectStatus == 1
) { ) {
@ -1118,12 +1109,8 @@ class IotCarePlan extends Component<any, any> {
}); });
}, 500); }, 500);
const { const { ActiveModeItem, isStandStatus, facialMaskConnectStatus } =
ActiveModeItem, this.state;
workStatus,
isStandStatus,
facialMaskConnectStatus,
} = this.state;
if (isStandStatus === 1 && ActiveModeItem.isCabinMode === 0) { if (isStandStatus === 1 && ActiveModeItem.isCabinMode === 0) {
console.log("已连接舱体,只可选择舱体模式"); console.log("已连接舱体,只可选择舱体模式");
@ -1139,14 +1126,14 @@ class IotCarePlan extends Component<any, any> {
"点击开始护理按钮", "点击开始护理按钮",
`当前模式: ${ActiveModeItem.modeType}`, `当前模式: ${ActiveModeItem.modeType}`,
`当前面罩状态:${facialMaskConnectStatus}`, `当前面罩状态:${facialMaskConnectStatus}`,
`当前仪器模式:${workStatus}` `当前仪器模式:${this.workStatus}`
); );
console.log(ActiveModeItem); console.log(ActiveModeItem);
console.log("isStandStatus:" + isStandStatus); console.log("isStandStatus:" + isStandStatus);
console.log( console.log(
workStatus !== MODE_WORKING_ENUM.WORKING && this.workStatus !== MODE_WORKING_ENUM.WORKING &&
workStatus !== MODE_WORKING_ENUM.STANDBY && this.workStatus !== MODE_WORKING_ENUM.STANDBY &&
workStatus !== MODE_WORKING_ENUM.PAUSE this.workStatus !== MODE_WORKING_ENUM.PAUSE
); );
if (facialMaskConnectStatus != 1) { if (facialMaskConnectStatus != 1) {
@ -1171,11 +1158,13 @@ class IotCarePlan extends Component<any, any> {
this.showTips(`${ActiveModeItem.modeName}模式设置失败,请联系小助手`); this.showTips(`${ActiveModeItem.modeName}模式设置失败,请联系小助手`);
return; return;
} }
// 开始执行护理
this.handleWorkStatus(true, MODE_WORKING_ENUM.WORKING);
let downNum = CountDownTime[ActiveModeItem.modeName] || 3; let downNum = CountDownTime[ActiveModeItem.modeName] || 3;
console.log("downNum", downNum);
this.showCountdownFun(downNum, () => {}); // 倒计时弹窗 this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
// 开始执行护理
this.handleWorkStatus(true, MODE_WORKING_ENUM.WORKING);
} }
// 结束护理? // 结束护理?

Loading…
Cancel
Save