|
|
|
|
@ -122,6 +122,36 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
{ name: "左脸颊", forehead: 6, Total: 10 },
|
|
|
|
|
{ name: "右脸颊", forehead: 2, Total: 10 },
|
|
|
|
|
],
|
|
|
|
|
stepList: [
|
|
|
|
|
{
|
|
|
|
|
value: "Step1",
|
|
|
|
|
name: "额头",
|
|
|
|
|
finish: false,
|
|
|
|
|
schedule: 0,
|
|
|
|
|
color: "#c2e5f3",
|
|
|
|
|
forehead: 0,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: "Step2",
|
|
|
|
|
name: "左脸颊",
|
|
|
|
|
finish: false,
|
|
|
|
|
schedule: 0,
|
|
|
|
|
color: "#c2e5f3",
|
|
|
|
|
forehead: 0,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: "Step3",
|
|
|
|
|
name: "右脸颊",
|
|
|
|
|
finish: false,
|
|
|
|
|
schedule: 0,
|
|
|
|
|
color: "#c2e5f3",
|
|
|
|
|
forehead: 0,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
stepIndex: 0,
|
|
|
|
|
// 进度条定时器
|
|
|
|
|
timerIdSchedule: null,
|
|
|
|
|
timerIdSuccess: null,
|
|
|
|
|
|
|
|
|
|
gear: { gear: 1 },
|
|
|
|
|
currentShowDialog: "",
|
|
|
|
|
@ -133,7 +163,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
/** 连接设备 End */
|
|
|
|
|
|
|
|
|
|
/** 护理过程 */
|
|
|
|
|
isRuningTest: false, // 是否正在测试
|
|
|
|
|
isRuningTest: 1, // 是否正在测试
|
|
|
|
|
isShowStepTips: false, // 是否显示介绍步骤弹窗
|
|
|
|
|
isConnectionBlutoot: true, // 是否已连接蓝牙
|
|
|
|
|
isShowNurse: true, // 是否开始并显示护理 FR200默认已经开始准备护理
|
|
|
|
|
@ -578,6 +608,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
this.handleWorkStatus(false, MODE_WORKING_ENUM.STANDBY);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 开始护理按钮:点击开始,页面进行到下一步 */
|
|
|
|
|
onStartNurse = async () => {
|
|
|
|
|
this.stepNext();
|
|
|
|
|
@ -592,6 +623,42 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
// 如果检查失败,则报错
|
|
|
|
|
this.onEmitErrorTips();
|
|
|
|
|
};
|
|
|
|
|
/** 完成护理,跳转到水分 */
|
|
|
|
|
onsuccess = async () => {
|
|
|
|
|
let stepList = this.state.stepList;
|
|
|
|
|
this.setState({
|
|
|
|
|
isShowNursingSuccess: true,
|
|
|
|
|
});
|
|
|
|
|
// return;
|
|
|
|
|
let { currentDevice, ActiveModeItem } = this.state;
|
|
|
|
|
let params = {};
|
|
|
|
|
let nursingData = {
|
|
|
|
|
nursingData: JSON.stringify({
|
|
|
|
|
GearData: [...stepList],
|
|
|
|
|
}),
|
|
|
|
|
};
|
|
|
|
|
params = {
|
|
|
|
|
instrumentId: currentDevice.id,
|
|
|
|
|
instrumentName: currentDevice.name,
|
|
|
|
|
modeId: ActiveModeItem.id,
|
|
|
|
|
modeName: ActiveModeItem.modeName,
|
|
|
|
|
nursingTime: s_to_hms(this.elapsedTime),
|
|
|
|
|
};
|
|
|
|
|
params = { ...params, ...nursingData };
|
|
|
|
|
let res: any = await InstrumentInfo.apiNursingLog.addLog(
|
|
|
|
|
JSON.stringify(params)
|
|
|
|
|
);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.setState({
|
|
|
|
|
isShowNursingSuccess: false,
|
|
|
|
|
});
|
|
|
|
|
go(
|
|
|
|
|
`/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${s_to_hms(
|
|
|
|
|
this.elapsedTime
|
|
|
|
|
)}&modeId=${ActiveModeItem.id}`
|
|
|
|
|
);
|
|
|
|
|
}, 2000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @name 不可切换光照提示
|
|
|
|
|
@ -721,11 +788,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
break;
|
|
|
|
|
case "working":
|
|
|
|
|
//设备的运行中状态
|
|
|
|
|
console.log("设备状态同步 运行中状态", jsonStatus);
|
|
|
|
|
if (jsonStatus.workMode === "moistureTest") {
|
|
|
|
|
// 水分测试
|
|
|
|
|
// teststatus:success
|
|
|
|
|
}
|
|
|
|
|
console.log("设备状态同步 运行中状态", jsonStatus.workMode);
|
|
|
|
|
|
|
|
|
|
// 脸部模式
|
|
|
|
|
if (jsonStatus.workMode === "face") {
|
|
|
|
|
@ -742,6 +805,59 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (jsonStatus.workMode === "moistureTest") {
|
|
|
|
|
if ("success" === jsonStatus.testStatus) {
|
|
|
|
|
let stepList = this.state.stepList;
|
|
|
|
|
let stepIndex = this.state.stepIndex;
|
|
|
|
|
let timerIdSuccess = this.state.timerIdSuccess;
|
|
|
|
|
let timerIdSchedule = this.state.timerIdSchedule;
|
|
|
|
|
|
|
|
|
|
if (stepList[stepIndex].finish) {
|
|
|
|
|
stepList[stepIndex].forehead = jsonStatus.waterLevel;
|
|
|
|
|
if (stepIndex === 2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
isRuningTest: 4,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
isRuningTest: 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clearTimeout(timerIdSuccess);
|
|
|
|
|
clearTimeout(timerIdSchedule);
|
|
|
|
|
console.log("成功拿到", jsonStatus, stepIndex);
|
|
|
|
|
let num = stepIndex;
|
|
|
|
|
if (stepIndex < 2) {
|
|
|
|
|
num = stepIndex + 1;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
timerIdSuccess: null,
|
|
|
|
|
timerIdSchedule: null,
|
|
|
|
|
stepIndex: num,
|
|
|
|
|
stepList,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
let stepList = this.state.stepList;
|
|
|
|
|
let stepIndex = this.state.stepIndex;
|
|
|
|
|
let timerIdSuccess = this.state.timerIdSuccess;
|
|
|
|
|
let timerIdSchedule = this.state.timerIdSchedule;
|
|
|
|
|
if (stepList[stepIndex].finish) {
|
|
|
|
|
clearTimeout(timerIdSuccess);
|
|
|
|
|
clearTimeout(timerIdSchedule);
|
|
|
|
|
stepList[stepIndex].schedule = 0;
|
|
|
|
|
stepList[stepIndex].finish = false;
|
|
|
|
|
this.setState({
|
|
|
|
|
stepList,
|
|
|
|
|
isRuningTest: 3,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 水分测试
|
|
|
|
|
// testStatus:success
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(
|
|
|
|
|
"jsonStatus?.workMode === this.state.ActiveModeItem.modeType",
|
|
|
|
|
jsonStatus?.workMode === this.state.ActiveModeItem.modeType
|
|
|
|
|
@ -1206,14 +1322,38 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
workMode: ActiveModeItem.modeType, // 使用模式
|
|
|
|
|
workStatus: newWorkStatus,
|
|
|
|
|
};
|
|
|
|
|
console.log(ActiveModeItem, "查看工作状态");
|
|
|
|
|
|
|
|
|
|
// 水分测试需要特殊处理
|
|
|
|
|
// 水分测试准备 水分测试工作 水分测试启动
|
|
|
|
|
if (ActiveModeItem.modeType === "moistureTest") {
|
|
|
|
|
sendParams.testStatus = "standby"; // 切换为准备
|
|
|
|
|
let stepList = this.state.stepList;
|
|
|
|
|
let stepIndex = this.state.stepIndex;
|
|
|
|
|
let timerIdSchedule = this.state.timerIdSchedule;
|
|
|
|
|
let timerIdSuccess = this.state.timerIdSuccess;
|
|
|
|
|
if (isBtnClick) {
|
|
|
|
|
timerIdSchedule = setTimeout(function () {
|
|
|
|
|
stepList[stepIndex].schedule = 100;
|
|
|
|
|
|
|
|
|
|
timerIdSuccess = setTimeout(function () {
|
|
|
|
|
stepList[stepIndex].finish = true;
|
|
|
|
|
this.setState({
|
|
|
|
|
stepList,
|
|
|
|
|
});
|
|
|
|
|
}, 2000);
|
|
|
|
|
this.setState({
|
|
|
|
|
stepList,
|
|
|
|
|
timerIdSuccess,
|
|
|
|
|
});
|
|
|
|
|
}, 3000);
|
|
|
|
|
this.setState({
|
|
|
|
|
isRuningTest: 2,
|
|
|
|
|
timerIdSchedule,
|
|
|
|
|
});
|
|
|
|
|
// 水分测试启动
|
|
|
|
|
sendParams.testStatus = "start"; // 点击开始再开始
|
|
|
|
|
console.log("点击开始", isBtnClick);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1243,7 +1383,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
*/
|
|
|
|
|
onNursingTap(type = "") {
|
|
|
|
|
// 如果已禁止运行,则停止执行后续逻辑
|
|
|
|
|
if (this.state.isRuningTest) return;
|
|
|
|
|
if (this.state.isRuningTest === 2) return;
|
|
|
|
|
// 防止多次点击
|
|
|
|
|
if (this.state.hadClickStart) return;
|
|
|
|
|
this.setState({
|
|
|
|
|
@ -1588,13 +1728,6 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
Taro.removeStorageSync("FR200NursingHistory");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// todoPromise = () => {
|
|
|
|
|
// return new Promise<void>((resolve, reject) => {
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// resolve();
|
|
|
|
|
// });
|
|
|
|
|
// });
|
|
|
|
|
// };
|
|
|
|
|
// 脸部one
|
|
|
|
|
todoPromise = async () => {
|
|
|
|
|
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
|
|
|
|
|
@ -2021,6 +2154,8 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
title,
|
|
|
|
|
isConnectShow,
|
|
|
|
|
GearData,
|
|
|
|
|
stepList,
|
|
|
|
|
stepIndex,
|
|
|
|
|
isShowStepTips,
|
|
|
|
|
isShowNurse,
|
|
|
|
|
isStopNurse,
|
|
|
|
|
@ -2294,6 +2429,8 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
<WaterTest
|
|
|
|
|
isRuningTest={isRuningTest}
|
|
|
|
|
TestModeStepIndex={TestModeStepIndex}
|
|
|
|
|
stepList={stepList}
|
|
|
|
|
stepIndex={stepIndex}
|
|
|
|
|
></WaterTest>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
@ -2305,6 +2442,7 @@ class IotCarePlanFR200 extends Component<any, any> {
|
|
|
|
|
onEmitStartNurse={this.onStartNurse}
|
|
|
|
|
onEmitSwitchChange={this.onSwitchChange}
|
|
|
|
|
onEmitEndPlan={this.onEndPlan}
|
|
|
|
|
onsuccess={this.onsuccess}
|
|
|
|
|
/>
|
|
|
|
|
</View>
|
|
|
|
|
</Block>
|
|
|
|
|
|