临时提交

master
blak-kong 2 years ago
parent 819d2d0cdc
commit 79dba2b6a1

@ -71,7 +71,7 @@ export const fr200DeviceControlCommand = {
work: { work: {
commandType: "DeviceControl", commandType: "DeviceControl",
workStatus: "working", workStatus: "working",
workMode: "face", workMode: "", // face
}, },
// 切换/进入水分测试 // 切换/进入水分测试
switchTestMode: { switchTestMode: {

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

@ -166,11 +166,14 @@ class IotCarePlanWL200 extends Component<any, any> {
/** 护理过程 END*/ /** 护理过程 END*/
// 模式列表 // 模式列表
isModeLock: false, // 模式锁定
isSwitchActiveMode: false, // 是否显示弹窗切换模式 isSwitchActiveMode: false, // 是否显示弹窗切换模式
ModeList: [], ModeList: [],
ModeType: "all", // all visor面罩 cabin舱体 yimeish医美 ModeType: "all", // all visor面罩 cabin舱体 yimeish医美
modeClass: "", // 1面罩 2舱体 3医美 modeClass: "", // 1面罩 2舱体 3医美
ActiveModeItem: {}, // 当前选中模式 ActiveModeItem: {
openSourceData: [],
}, // 当前选中模式
SwitchActiveModeItem: {}, // 切换选中模式 SwitchActiveModeItem: {}, // 切换选中模式
ModeID: "mode_", // 模式KEY ModeID: "mode_", // 模式KEY
activeModeID: "", // 当前选中模式ID:用于高亮 activeModeID: "", // 当前选中模式ID:用于高亮
@ -682,7 +685,7 @@ class IotCarePlanWL200 extends Component<any, any> {
this.setState({ this.setState({
isStandStatus: true, isStandStatus: true,
}); });
if (!this.state.isStandStatus && this.isRuning) { if (!this.state.isStandStatus && this.state.step === 2) {
// 断开连接直接暂停 // 断开连接直接暂停
this.judgementWorkStatus( this.judgementWorkStatus(
MODE_WORKING_ENUM.PAUSE, MODE_WORKING_ENUM.PAUSE,
@ -692,7 +695,7 @@ class IotCarePlanWL200 extends Component<any, any> {
} else { } else {
console.log("舱体支架断开连接"); console.log("舱体支架断开连接");
if (this.state.isStandStatus && this.isRuning) { if (this.state.isStandStatus && this.state.step === 2) {
// 断开连接直接暂停 // 断开连接直接暂停
this.judgementWorkStatus( this.judgementWorkStatus(
MODE_WORKING_ENUM.PAUSE, MODE_WORKING_ENUM.PAUSE,
@ -2023,6 +2026,13 @@ class IotCarePlanWL200 extends Component<any, any> {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.reLaunch({ url: "/pages/index/index" });
}; };
onModeLockOpen = async () => {
this.setState({ isModeLock: true });
};
onModeLockClose = async () => {
this.setState({ isModeLock: false });
};
render() { render() {
let { let {
title, title,
@ -2059,7 +2069,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isShowReReadRecordSave, isShowReReadRecordSave,
isFooterBtnDisabled, isFooterBtnDisabled,
isShowHistoryMsg, isShowHistoryMsg,
stepIndex, isModeLock,
} = this.state; } = this.state;
return ( return (
@ -2072,6 +2082,18 @@ class IotCarePlanWL200 extends Component<any, any> {
/> />
<View catchMove> <View catchMove>
<PopupAlert
isShow={isModeLock}
zIndex={10020}
myClassName="level-up"
title="提示"
content="该模式即将上线,敬请期待"
confirmButtonText="我知道了"
textAlgin="center"
isClose={false}
close={this.onModeLockClose}
confirm={this.onModeLockClose}
/>
<PopupInstrumentUploadTips <PopupInstrumentUploadTips
isShow={isFirstTipShow} isShow={isFirstTipShow}
zIndex={10020} zIndex={10020}
@ -2111,6 +2133,7 @@ class IotCarePlanWL200 extends Component<any, any> {
ModeType={ModeType} ModeType={ModeType}
onEmit={this.switchModeCurrentFun} onEmit={this.switchModeCurrentFun}
onEmitShowAll={this.openModeSwitch} onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/> />
} }
textAlgin="center" textAlgin="center"
@ -2120,7 +2143,7 @@ class IotCarePlanWL200 extends Component<any, any> {
confirm={this.confirmModeSwitchBtn} confirm={this.confirmModeSwitchBtn}
/> />
{ActiveModeItem.openSourceData && ( {ActiveModeItem.openSourceData.length > 0 && (
<PopupStepTips <PopupStepTips
isShow={isShowStepTips} isShow={isShowStepTips}
isLarge isLarge
@ -2259,7 +2282,7 @@ class IotCarePlanWL200 extends Component<any, any> {
<ElectricityView <ElectricityView
Electricity={Electricity} Electricity={Electricity}
matrixElectricity={matrixElectricity} matrixElectricity={matrixElectricity}
facialMaskConnectStatus={facialMaskConnectStatus} DeviceConnectStatus={facialMaskConnectStatus}
/> />
</View> </View>
</View> </View>
@ -2274,6 +2297,7 @@ class IotCarePlanWL200 extends Component<any, any> {
activeModeID={activeModeID} activeModeID={activeModeID}
onEmit={this.modeCurrentFun} onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch} onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/> />
)} )}

@ -7,13 +7,9 @@ import { useState, useEffect } from "react";
interface Props { interface Props {
Electricity: any; Electricity: any;
matrixElectricity: any; matrixElectricity: any;
facialMaskConnectStatus: any; DeviceConnectStatus: any;
} }
function Index({ function Index({ Electricity, matrixElectricity, DeviceConnectStatus }: Props) {
Electricity,
matrixElectricity,
facialMaskConnectStatus,
}: Props) {
return ( return (
<Block> <Block>
<View className="electricity-box"> <View className="electricity-box">
@ -62,7 +58,7 @@ function Index({
)} )}
</View> </View>
</View> */} </View> */}
{facialMaskConnectStatus === 1 && ( {DeviceConnectStatus === 1 && (
<Block> <Block>
<View className="item"> <View className="item">
<View className="label"> :</View> <View className="label"> :</View>

@ -8,7 +8,7 @@
height: 153rpx; height: 153rpx;
background: #ffffff; background: #ffffff;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21); box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
padding-bottom: env(safe-area-inset-bottom); // padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box; box-sizing: border-box;
.btn { .btn {
width: 690rpx; width: 690rpx;

@ -15,8 +15,21 @@ function Index({ isShowNurse, ActiveModeItem, ModeStepIndex }: Props) {
"630nm": "#CF231D", "630nm": "#CF231D",
"830nm": "#9C1D17", "830nm": "#9C1D17",
}; };
let [value, setValue] = useState("");
const add = () => {
useEffect(() => {
setValue(value + 1);
});
};
return ( return (
<Block>{isShowNurse && <View className="modelInfo-box"></View>}</Block> <Block>
<View onClick={add}>add</View>
<View>{value}</View>
{isShowNurse && <View className="modelInfo-box"></View>}
</Block>
); );
} }

@ -13,6 +13,7 @@ interface Props {
isPop: boolean; // 是否弹窗 isPop: boolean; // 是否弹窗
onEmit: Function; // 每次点击item回调事件和数据给父组件 onEmit: Function; // 每次点击item回调事件和数据给父组件
onEmitShowAll: Function; // 打开弹窗按钮 onEmitShowAll: Function; // 打开弹窗按钮
onModeLockOpen: Function; // 打开锁定弹窗
} }
function Index({ function Index({
isShowNurse, isShowNurse,
@ -23,6 +24,7 @@ function Index({
activeModeID, activeModeID,
onEmit, onEmit,
onEmitShowAll, onEmitShowAll,
onModeLockOpen,
}: Props) { }: Props) {
let BaseList = ModeList.filter((item) => item.modeClass === 1); // 基础护理 let BaseList = ModeList.filter((item) => item.modeClass === 1); // 基础护理
let ZoneList = ModeList.filter((item) => item.modeClass === 2); // 专区护理 let ZoneList = ModeList.filter((item) => item.modeClass === 2); // 专区护理
@ -31,6 +33,10 @@ function Index({
let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤 let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤
const onItemClick = (item) => { const onItemClick = (item) => {
if (item.lock) {
onModeLockOpen(); // 点击了锁定模式
return;
}
onEmit(item); onEmit(item);
}; };

@ -13,6 +13,7 @@ interface Props {
isPop: boolean; // 是否弹窗 isPop: boolean; // 是否弹窗
onEmit: Function; // 每次点击item回调事件和数据给父组件 onEmit: Function; // 每次点击item回调事件和数据给父组件
onEmitShowAll: Function; // 打开弹窗按钮 onEmitShowAll: Function; // 打开弹窗按钮
onModeLockOpen: Function; // 打开锁定弹窗
} }
function Index({ function Index({
isShowNurse, isShowNurse,
@ -23,20 +24,17 @@ function Index({
activeModeID, activeModeID,
onEmit, onEmit,
onEmitShowAll, onEmitShowAll,
onModeLockOpen,
}: Props) { }: Props) {
let VisorList = ModeList.filter((item) => item.modeClass === 1); // 面罩模式 let VisorList = ModeList.filter((item) => item.modeClass === 1); // 面罩模式
let CabinList = ModeList.filter((item) => item.modeClass === 2); // 舱体模式 let CabinList = ModeList.filter((item) => item.modeClass === 2); // 舱体模式
let YimeishList = ModeList.filter((item) => item.modeClass === 3); // 医美术后 let YimeishList = ModeList.filter((item) => item.modeClass === 3); // 医美术后
const yimeishClick = (item) => { const onItemClick = (item) => {
onEmit(item); if (item.isLock) {
}; onModeLockOpen();
return;
const cabinClick = (item) => { }
onEmit(item);
};
const visorClick = (item) => {
onEmit(item); onEmit(item);
}; };
@ -73,7 +71,7 @@ function Index({
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
})} })}
onClick={visorClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
> >
<View <View
className={classnames("new", { className={classnames("new", {
@ -128,7 +126,7 @@ function Index({
<View <View
key={"cabin_" + index} key={"cabin_" + index}
id={"cabin_" + item.id} id={"cabin_" + item.id}
onClick={cabinClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
})} })}
@ -186,7 +184,7 @@ function Index({
<View <View
key={"yimeish_" + index} key={"yimeish_" + index}
id={"yimeish_" + item.id} id={"yimeish_" + item.id}
onClick={yimeishClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
})} })}

@ -55,7 +55,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
secondClockImg: null, secondClockImg: null,
thirdClockImg: null, thirdClockImg: null,
}, },
// 现在选中的数据 // 现在选中的数据
currentInfo: { currentInfo: {
modeVideo: "", modeVideo: "",
@ -122,7 +122,6 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}; };
// 获取最新一条打卡记录 // 获取最新一条打卡记录
getLatestClockRecord = async () => { getLatestClockRecord = async () => {
let { punchInInfo } = this.state; let { punchInInfo } = this.state;
let res = await InstrumentInfo.apiClock.getLatestClockRecord(); let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) { if (res.data.code === 200) {
@ -190,7 +189,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
// 提交打卡 // 提交打卡
handleSubmit = async () => { handleSubmit = async () => {
let { punchInInfo,instrumentDetail } = this.state; let { punchInInfo, instrumentDetail } = this.state;
let obj = punchInInfo; let obj = punchInInfo;
if (obj.clockImageList.length === 0) { if (obj.clockImageList.length === 0) {
msg("至少上传一张图片"); msg("至少上传一张图片");
@ -236,9 +235,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
instrumentId: instrumentDetail.id, instrumentId: instrumentDetail.id,
}; };
// 上传护理完成的仪器ID // 上传护理完成的仪器ID
let instrumentRes = await InstrumentInfo.apiClock.addClockInstrument(params); let instrumentRes = await InstrumentInfo.apiClock.addClockInstrument(
console.log(instrumentRes,'添加仪器成功'); params
);
console.log(instrumentRes, "添加仪器成功");
let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas); let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas);
if (res.data.code === 200) { if (res.data.code === 200) {
msg("打卡成功"); msg("打卡成功");
@ -268,10 +269,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
videoLoadedMetaData = async () => {}; videoLoadedMetaData = async () => {};
handleTextareaInput = (e) => { handleTextareaInput = (e) => {
const punchInInfo = this.state.punchInInfo; const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo,clockContent: e.detail.value } }); this.setState({
punchInInfo: { ...punchInInfo, clockContent: e.detail.value },
});
}; };
onModeLockOpen = async () => { onModeLockOpen = async () => {
@ -324,23 +326,26 @@ export default class InstrumentClickInUpload extends Component<any, any> {
canvasId="compressImage" canvasId="compressImage"
type="2d" type="2d"
></Canvas> ></Canvas>
<PopupAlert
isShow={isModeLock} <View catchMove>
title="提示" <PopupAlert
content="该模式即将上线,敬请期待" isShow={isModeLock}
confirmButtonText="我知道了" title="提示"
textAlgin="center" content="该模式即将上线,敬请期待"
isClose={false} confirmButtonText="我知道了"
close={this.onModeLockClose} textAlgin="center"
confirm={this.onModeLockClose} isClose={false}
/> close={this.onModeLockClose}
<PopupInstrumentUploadTips confirm={this.onModeLockClose}
isShow={isTipShow} />
title="打卡介绍" <PopupInstrumentUploadTips
data={nurseInfo} isShow={isTipShow}
close={this.onTipShowClose} title="打卡介绍"
confirm={this.onTipShowClose} data={nurseInfo}
/> close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
</View>
<View className="infobox1 flex aitems jcenter"> <View className="infobox1 flex aitems jcenter">
<View className="img"> <View className="img">

Loading…
Cancel
Save