fix:修复切换模式bug,自动启动倒计时

master
blak-kong 2 years ago
parent 2b2a8dca58
commit df99d57457

@ -414,14 +414,22 @@ class IotCarePlan extends Component<any, any> {
/** 选中护理模式 */ /** 选中护理模式 */
modeCurrentFun = async (data, isNotCheck = false) => { modeCurrentFun = async (data, isNotCheck = false) => {
// 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data;
// 仅在未开始护理前,切换模式的时候提示模式弹窗 // 仅在未开始护理前,切换模式的时候提示模式弹窗
if (!this.state.isShowNurse) { if (!this.state.isShowNurse) {
this.openStepTips(); this.openStepTips();
} }
// 护理检查改变模式,是否提示切换护理模式 // 如果按钮不可点击则报错,内部自带检查底部按钮函数
// isNotCheck为真时不进行校验直接切换 this.onEmitErrorTips();
this.tempModeCurrent = data; if (!isNotCheck) {
let isReturn = this.modeRuningChange();
if (isReturn) return;
}
let { isShowNurse } = this.state; let { isShowNurse } = this.state;
let currentServiceData = { let currentServiceData = {
startSource: "", startSource: "",
@ -441,13 +449,6 @@ class IotCarePlan extends Component<any, any> {
currentTime, currentTime,
}); });
// 如果按钮不可点击则报错,内部自带检查底部按钮函数
this.onEmitErrorTips();
if (!isNotCheck) {
let isReturn = this.modeRuningChange();
if (isReturn) return;
}
setTimeout(() => { setTimeout(() => {
// 设置时间组合 // 设置时间组合
if (data.serviceData.length > 0) { if (data.serviceData.length > 0) {
@ -463,11 +464,10 @@ class IotCarePlan extends Component<any, any> {
if (isShowNurse) { if (isShowNurse) {
if (!this.footerIsDisabled()) { if (!this.footerIsDisabled()) {
this.stepNext(); // 如果切换模式,则不执行开始逻辑 this.stepNext(); // 如果切换模式,则不执行开始逻辑
return; setTimeout(() => {
this.onNursingTap("switch");
}, 800);
} }
setTimeout(() => {
this.onNursingTap("switch");
}, 800);
} }
}; };
/** 设备运行中切换模式 */ /** 设备运行中切换模式 */
@ -1314,11 +1314,11 @@ class IotCarePlan extends Component<any, any> {
const { ActiveModeItem, isStandStatus, facialMaskConnectStatus } = const { ActiveModeItem, isStandStatus, facialMaskConnectStatus } =
this.state; this.state;
if (isStandStatus === 1 && ActiveModeItem.isCabinMode === 0) { if (isStandStatus === true && ActiveModeItem.isCabinMode === 0) {
console.log("已连接舱体,只可选择舱体模式"); console.log("已连接舱体,只可选择舱体模式");
return; return;
} }
if (isStandStatus === 0 && ActiveModeItem.isCabinMode === 1) { if (isStandStatus === false && ActiveModeItem.isCabinMode === 1) {
console.log("未连接舱体!"); console.log("未连接舱体!");
return; return;
} }

Loading…
Cancel
Save