master
qsj 2 years ago
parent 8bbeb2065d
commit 21e61acb7d

@ -20,6 +20,7 @@ import {
Video, Video,
Input, Input,
Button, Button,
PageMeta
} from "@tarojs/components"; } from "@tarojs/components";
import { sendCommand } from "@/utils/bluetoothWXAPI"; import { sendCommand } from "@/utils/bluetoothWXAPI";
@ -98,6 +99,8 @@ class IotCarePlanFR200 extends Component<any, any> {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
textshow: false,
textscreen: 'portrait',
name: "FR200", name: "FR200",
title: "FR200", // 页面标题 title: "FR200", // 页面标题
// 当前设备 // 当前设备
@ -181,6 +184,7 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeType: "all", // all 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤 ModeType: "all", // all 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤
ActiveModeItem: { ActiveModeItem: {
openSourceData: [], openSourceData: [],
modeType:""
}, // 当前选中模式 }, // 当前选中模式
SwitchActiveModeItem: {}, // 切换选中模式 SwitchActiveModeItem: {}, // 切换选中模式
ModeID: "mode_", // 模式KEY ModeID: "mode_", // 模式KEY
@ -404,9 +408,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
@ -429,6 +433,11 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
async initData() { async initData() {
Taro.closeBluetoothAdapter({
complete: () => {
// this.openBluetoothAdapter();
},
});
let obj = getStorageSync("instrument_detail"); let obj = getStorageSync("instrument_detail");
if (obj) { if (obj) {
this.setState({ this.setState({
@ -436,10 +445,10 @@ class IotCarePlanFR200 extends Component<any, any> {
title: obj.name, title: obj.name,
}); });
await this.GetModeList(obj.id); await this.GetModeList(obj?.id);
// 如果不存在设备模式值,则判断为首次进入,弹窗提示 // 如果不存在设备模式值,则判断为首次进入,弹窗提示
let isFirstTipShow = getStorageSync("first_instrument_" + obj.id); let isFirstTipShow = getStorageSync("first_instrument_" + obj?.id);
if (!isFirstTipShow) { if (!isFirstTipShow) {
this.firstNurseInfo(); this.firstNurseInfo();
} }
@ -515,7 +524,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
if (this.state.activeModeID != "") { if (this.state.activeModeID != "") {
let res1 = res.data.data.find((e) => e.id == this.state.activeModeID); let res1 = res.data.data.find((e) => e?.id == this.state.activeModeID);
setTimeout(() => { setTimeout(() => {
this.modeCurrentFun(res1); this.modeCurrentFun(res1);
}, 100); }, 100);
@ -524,7 +533,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.modeCurrentFun(res.data.data[0]); this.modeCurrentFun(res.data.data[0]);
}, 100); }, 100);
} }
let res1 = res.data.data.find((e) => e.id == this.state.activeModeID); let res1 = res.data.data.find((e) => e?.id == this.state.activeModeID);
setTimeout(() => { setTimeout(() => {
this.modeCurrentFun(res1); this.modeCurrentFun(res1);
}, 100); }, 100);
@ -588,20 +597,20 @@ class IotCarePlanFR200 extends Component<any, any> {
// 根据模式,动态设置底部按钮样式 // 根据模式,动态设置底部按钮样式
let currentWorkModeType = 1; let currentWorkModeType = 1;
if (data.modeType === "moistureTest") { if (data?.modeType === "moistureTest") {
currentWorkModeType = 3; currentWorkModeType = 3;
} else if ( } else if (
data.modeType === "maskPenetration" || data?.modeType === "maskPenetration" ||
data.modeType === "essence" || data?.modeType === "essence" ||
data.modeType === "led" data?.modeType === "led"
) { ) {
currentWorkModeType = 2; currentWorkModeType = 2;
} }
this.setState({ this.setState({
ActiveModeItem: data, ActiveModeItem: data,
activeModeID: data.id, activeModeID: data?.id,
ModeID: "mode_" + data.id, ModeID: "mode_" + data?.id,
ModeStepIndex: 0, ModeStepIndex: 0,
waterStepIndex: 0, // 水分测试步骤 waterStepIndex: 0, // 水分测试步骤
EssenceStepIndex: 0, // 精华促渗步骤 EssenceStepIndex: 0, // 精华促渗步骤
@ -620,7 +629,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// FR200水分测试不可自动运行需手动点击开始测试手动启动检测 // FR200水分测试不可自动运行需手动点击开始测试手动启动检测
// 其他模式可以自动运行 // 其他模式可以自动运行
if (data.modeType !== "moistureTest") { if (data?.modeType !== "moistureTest") {
setTimeout(() => { setTimeout(() => {
this.onNursingTap("switch"); this.onNursingTap("switch");
}, 800); }, 800);
@ -680,8 +689,8 @@ class IotCarePlanFR200 extends Component<any, any> {
switchModeCurrentFun = async (data) => { switchModeCurrentFun = async (data) => {
this.setState({ this.setState({
SwitchActiveModeItem: data, SwitchActiveModeItem: data,
activeModeID: data.id, activeModeID: data?.id,
ModeID: "mode_" + data.id, ModeID: "mode_" + data?.id,
}); });
}; };
// 打开模式切换弹窗 // 打开模式切换弹窗
@ -748,9 +757,9 @@ class IotCarePlanFR200 extends Component<any, any> {
let params: any = {}; let params: any = {};
params = { params = {
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem?.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
nursingTime: s_to_hms(this.elapsedTime), nursingTime: s_to_hms(this.elapsedTime),
nursingData: JSON.stringify({ nursingData: JSON.stringify({
@ -777,8 +786,8 @@ class IotCarePlanFR200 extends Component<any, any> {
this.moistureTest( this.moistureTest(
params.nursingData, params.nursingData,
formattedDate, formattedDate,
ActiveModeItem.id, ActiveModeItem?.id,
currentDevice.id currentDevice?.id
); );
}, 2000); }, 2000);
}; };
@ -851,6 +860,10 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试"); this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
}); });
}; };
ontextshow() {
let textshow = this.state.textshow
this.setState({ textshow: !textshow })
}
updata() { updata() {
let that = this; let that = this;
let stop = 0; let stop = 0;
@ -884,7 +897,16 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
full() { full() {
let landscape = this.state.textscreen
if (landscape === 'landscape') {
this.setState({ textscreen: 'portrait' })
} else {
this.setState({ textscreen: 'landscape' })
}
// return 'landscape'
this.setState({ isFullScreen: !this.state.isFullScreen }); this.setState({ isFullScreen: !this.state.isFullScreen });
console.log(this.state.textscreen,1111);
} }
/** 切换光照 */ /** 切换光照 */
@ -892,7 +914,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let { isStopNurse, ActiveModeItem } = this.state; let { isStopNurse, ActiveModeItem } = this.state;
console.log("切换光照,", ActiveModeItem); console.log("切换光照,", ActiveModeItem);
if (ActiveModeItem.modeType === "led") { if (ActiveModeItem?.modeType === "led") {
this.onSwitchChangeLED(); this.onSwitchChangeLED();
return; return;
} }
@ -947,7 +969,7 @@ class IotCarePlanFR200 extends Component<any, any> {
*/ */
openStepTips = () => { openStepTips = () => {
let isFirstEntryModeNot = getStorageSync( let isFirstEntryModeNot = getStorageSync(
"isFirstEntryMode_" + this.state.currentDevice.id "isFirstEntryMode_" + this.state.currentDevice?.id
); );
// 1.如果没有持久化不再提示,每次进入都会弹窗提示 // 1.如果没有持久化不再提示,每次进入都会弹窗提示
if (!isFirstEntryModeNot) { if (!isFirstEntryModeNot) {
@ -959,7 +981,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
closeStepTips = (data) => { closeStepTips = (data) => {
if (data.isLocal) { if (data.isLocal) {
setStorageSync("isFirstEntryMode_" + this.state.currentDevice.id, true); // 关闭首次进入弹窗 setStorageSync("isFirstEntryMode_" + this.state.currentDevice?.id, true); // 关闭首次进入弹窗
} }
this.setState({ isShowStepTips: false }); this.setState({ isShowStepTips: false });
}; };
@ -1075,7 +1097,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let nowModeItem; let nowModeItem;
if (nWorkMode) { if (nWorkMode) {
nowModeItem = ModeList.find((item) => { nowModeItem = ModeList.find((item) => {
return item.modeType === nWorkMode; return item?.modeType === nWorkMode;
}); });
} }
opts.workStatus = nWorkStatus; opts.workStatus = nWorkStatus;
@ -1215,9 +1237,9 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
// 根据不同的模式,切换步骤到下一步 // 根据不同的模式,切换步骤到下一步
if (ActiveModeItem.modeType === "essence") { if (ActiveModeItem?.modeType === "essence") {
this.essencePenetrationNext(); this.essencePenetrationNext();
} else if (ActiveModeItem.modeType === "maskPenetration") { } else if (ActiveModeItem?.modeType === "maskPenetration") {
this.maskPenetrationNext(); this.maskPenetrationNext();
} }
} else { } else {
@ -1378,7 +1400,7 @@ class IotCarePlanFR200 extends Component<any, any> {
const { ActiveModeItem, currentGear } = this.state; const { ActiveModeItem, currentGear } = this.state;
let sendParams: any = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem?.modeType, // 使用模式
workStatus: "working", workStatus: "working",
gear: currentGear, gear: currentGear,
}; };
@ -1427,7 +1449,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let sendParams: any = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem?.modeType, // 使用模式
workStatus: "working", workStatus: "working",
gear: gear, gear: gear,
}; };
@ -1452,7 +1474,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let sendParams: any = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem?.modeType, // 使用模式
workStatus: "working", workStatus: "working",
gear: currentGear, gear: currentGear,
}; };
@ -1499,13 +1521,13 @@ class IotCarePlanFR200 extends Component<any, any> {
let sendParams: any = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem?.modeType, // 使用模式
workStatus: newWorkStatus, workStatus: newWorkStatus,
}; };
// 水分测试需要特殊处理 // 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动 // 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") { if (ActiveModeItem?.modeType === "moistureTest") {
let that = this; let that = this;
sendParams.testStatus = "standby"; // 切换为准备 sendParams.testStatus = "standby"; // 切换为准备
@ -1523,8 +1545,8 @@ class IotCarePlanFR200 extends Component<any, any> {
// 面膜促渗和精华促渗 // 面膜促渗和精华促渗
if ( if (
ActiveModeItem.modeType === "maskPenetration" || ActiveModeItem?.modeType === "maskPenetration" ||
ActiveModeItem.modeType === "essence" ActiveModeItem?.modeType === "essence"
) { ) {
sendParams.gear = this.state.currentGear; // 点击开始再开始 sendParams.gear = this.state.currentGear; // 点击开始再开始
} }
@ -1702,7 +1724,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 仪器缓存模式,判断是否存在于现有模式中 // 仪器缓存模式,判断是否存在于现有模式中
let recordModeItem = ModeList.find((item) => { let recordModeItem = ModeList.find((item) => {
return item.id == FR200NursingHistory.modeId; return item?.id == FR200NursingHistory.modeId;
}); });
if (!FR200NursingHistory || !recordModeItem) { if (!FR200NursingHistory || !recordModeItem) {
console.log("仪器有数据, 但是缓存没有数据, 忽略"); console.log("仪器有数据, 但是缓存没有数据, 忽略");
@ -1723,7 +1745,7 @@ class IotCarePlanFR200 extends Component<any, any> {
!workStatus !workStatus
) { ) {
// 判断id是否一致, 一致的话则生成护理报表 // 判断id是否一致, 一致的话则生成护理报表
if (jsonStatus.id == FR200NursingHistory.id) { if (jsonStatus?.id == FR200NursingHistory?.id) {
console.log("id一致, 设备没有运行/已完成/待机"); console.log("id一致, 设备没有运行/已完成/待机");
let totalSeconds = jsonStatus.totalSeconds; // 从仪器上获取的使用时间 let totalSeconds = jsonStatus.totalSeconds; // 从仪器上获取的使用时间
@ -1744,9 +1766,9 @@ class IotCarePlanFR200 extends Component<any, any> {
: s_to_hms(this.elapsedTime); : s_to_hms(this.elapsedTime);
let params = { let params = {
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem?.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
nursingTime: timeValue, nursingTime: timeValue,
}; };
@ -1757,9 +1779,9 @@ class IotCarePlanFR200 extends Component<any, any> {
} else { } else {
// ID不一致同步异常统一提交一分钟 // ID不一致同步异常统一提交一分钟
let params = { let params = {
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem?.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
nursingTime: "00:01:00", nursingTime: "00:01:00",
}; };
@ -1772,7 +1794,7 @@ class IotCarePlanFR200 extends Component<any, any> {
console.log("id一致, 设备运行中或暂停"); console.log("id一致, 设备运行中或暂停");
// 5.判断设备状态-运行中 // 5.判断设备状态-运行中
// 同步时间 // 同步时间
if (jsonStatus.id == FR200NursingHistory.id) { if (jsonStatus?.id == FR200NursingHistory?.id) {
if (FR200NursingHistory.currentTime) { if (FR200NursingHistory.currentTime) {
this.isRuning = true; this.isRuning = true;
this.resetTimer(); this.resetTimer();
@ -1800,8 +1822,8 @@ class IotCarePlanFR200 extends Component<any, any> {
videoTime: this.FR200NursingHistory.videoTime, videoTime: this.FR200NursingHistory.videoTime,
tempModeCurrent: ActiveModeItem, tempModeCurrent: ActiveModeItem,
ActiveModeItem: ActiveModeItem, ActiveModeItem: ActiveModeItem,
activeModeID: ActiveModeItem.id, activeModeID: ActiveModeItem?.id,
ModeID: "mode_" + ActiveModeItem.id, ModeID: "mode_" + ActiveModeItem?.id,
currentTime: this.FR200NursingHistory.currentTime, currentTime: this.FR200NursingHistory.currentTime,
}); });
} }
@ -1812,9 +1834,9 @@ class IotCarePlanFR200 extends Component<any, any> {
const params = { const params = {
createDate: dayjs().format("YYYY-MM-DD"), createDate: dayjs().format("YYYY-MM-DD"),
workMode: jsonStatus.workMode, workMode: jsonStatus.workMode,
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem?.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
id: dayjs().format("YYYY-MM-DD HH:mm:ss"), id: dayjs().format("YYYY-MM-DD HH:mm:ss"),
neededTotalSeconds: jsonStatus.neededTotalSeconds, neededTotalSeconds: jsonStatus.neededTotalSeconds,
@ -1844,7 +1866,7 @@ class IotCarePlanFR200 extends Component<any, any> {
params.dataArray.push(jsonStatus); params.dataArray.push(jsonStatus);
params.jsonStatus = jsonStatus; params.jsonStatus = jsonStatus;
params.workMode = jsonStatus?.workMode; params.workMode = jsonStatus?.workMode;
params.modeId = this.state.ActiveModeItem.id; params.modeId = this.state.ActiveModeItem?.id;
params.modeName = this.state.ActiveModeItem.modeName; params.modeName = this.state.ActiveModeItem.modeName;
console.log(jsonStatus, 555555555555); console.log(jsonStatus, 555555555555);
@ -1852,7 +1874,7 @@ class IotCarePlanFR200 extends Component<any, any> {
} else { } else {
params.jsonStatus = jsonStatus; params.jsonStatus = jsonStatus;
params.workMode = jsonStatus?.workMode; params.workMode = jsonStatus?.workMode;
params.modeId = data.id; params.modeId = data?.id;
params.modeName = data.modeName; params.modeName = data.modeName;
} }
@ -2002,9 +2024,9 @@ class IotCarePlanFR200 extends Component<any, any> {
params = data; params = data;
} else { } else {
params = { params = {
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
modeId: ActiveModeItem.id, modeId: ActiveModeItem?.id,
modeName: ActiveModeItem.modeName, modeName: ActiveModeItem.modeName,
nursingTime: s_to_hms(this.elapsedTime), nursingTime: s_to_hms(this.elapsedTime),
}; };
@ -2019,7 +2041,7 @@ class IotCarePlanFR200 extends Component<any, any> {
console.log("PostNursingLogClock", res2); console.log("PostNursingLogClock", res2);
if (res2.data.code === 200) { if (res2.data.code === 200) {
let params = { let params = {
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
}; };
// 上传护理完成的仪器ID // 上传护理完成的仪器ID
let res = await InstrumentInfo.apiClock.addClockInstrument(params); let res = await InstrumentInfo.apiClock.addClockInstrument(params);
@ -2037,9 +2059,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.goFaceReport( this.goFaceReport(
res1, res1,
ActiveModeItem.id, ActiveModeItem?.id,
res2.data.data, res2.data.data,
currentDevice.id currentDevice?.id
); // 跳转 ); // 跳转
}, 2000); }, 2000);
} }
@ -2162,11 +2184,11 @@ class IotCarePlanFR200 extends Component<any, any> {
let report = true; let report = true;
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
ids + ids +
"&report=" + "&report=" +
report + report +
"&obj=" + "&obj=" +
JSON.stringify(obj) JSON.stringify(obj)
); );
} else if ("moistureTest" === nursingData.workMode) { } else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试"); console.log("水分测试");
@ -2177,11 +2199,11 @@ class IotCarePlanFR200 extends Component<any, any> {
go( go(
"/recoding/pages/face_report/face_report?id=" + "/recoding/pages/face_report/face_report?id=" +
deviceid + deviceid +
"&recordId=" + "&recordId=" +
currentDevice + currentDevice +
"&report=" + "&report=" +
report report
); );
} }
}; };
@ -2230,13 +2252,13 @@ class IotCarePlanFR200 extends Component<any, any> {
firstNurseInfo = async () => { firstNurseInfo = async () => {
let { currentDevice } = this.state; let { currentDevice } = this.state;
let res = await InstrumentInfo.firstNurseInfo({ let res = await InstrumentInfo.firstNurseInfo({
instrumentId: currentDevice.id, instrumentId: currentDevice?.id,
}); });
console.log(res, "接口"); console.log(res, "接口");
if (res.data.code === 200) { if (res.data.code === 200) {
let isFirstTipShow = getStorageSync( let isFirstTipShow = getStorageSync(
"first_instrument_" + currentDevice.id "first_instrument_" + currentDevice?.id
); );
console.log(isFirstTipShow, "查看返回值"); console.log(isFirstTipShow, "查看返回值");
@ -2246,7 +2268,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({ nurseInfo: res.data.data, isFirstTipShow: true }); this.setState({ nurseInfo: res.data.data, isFirstTipShow: true });
} }
setStorageSync("first_instrument_" + currentDevice.id, true); setStorageSync("first_instrument_" + currentDevice?.id, true);
} else { } else {
this.setState({ nurseInfo: res.data.data }); this.setState({ nurseInfo: res.data.data });
} }
@ -2256,7 +2278,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({ isFirstTipShow: true }); this.setState({ isFirstTipShow: true });
}; };
onTipShowClose = async () => { onTipShowClose = async () => {
setStorageSync("first_instrument_" + this.state.currentDevice.id, true); setStorageSync("first_instrument_" + this.state.currentDevice?.id, true);
this.setState({ isFirstTipShow: false }); this.setState({ isFirstTipShow: false });
}; };
/** 初次护理信息弹窗 END */ /** 初次护理信息弹窗 END */
@ -2308,6 +2330,7 @@ class IotCarePlanFR200 extends Component<any, any> {
render() { render() {
let { let {
title, title,
textshow,
isConnectShow, isConnectShow,
GearData, GearData,
waterStepList, waterStepList,
@ -2335,6 +2358,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isNotEnoughTime, isNotEnoughTime,
isShowNursingSuccess, isShowNursingSuccess,
currentDevice, currentDevice,
textscreen,
isConnectionBlutoot, isConnectionBlutoot,
isShowTipsSave, isShowTipsSave,
isFirstTipShow, isFirstTipShow,
@ -2354,13 +2378,16 @@ class IotCarePlanFR200 extends Component<any, any> {
return ( return (
<Block> <Block>
<Navbar <PageMeta pageOrientation={textscreen}></PageMeta>
titleSlot={title}
isBack <Block>
isCustomBack <Navbar
customBack={this.customBack} titleSlot={title}
/> isBack
{!isFullScreen && ( isCustomBack
customBack={this.customBack}
/>
<View> <View>
<View catchMove> <View catchMove>
<PopupAlert <PopupAlert
@ -2434,51 +2461,54 @@ class IotCarePlanFR200 extends Component<any, any> {
<View> <View>
<View className="iot-main"> <View className="iot-main">
<View className="banner-box">
<View>
<Video
className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
<Image
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
</View>
<View className="fr200-iot-device"> {isFullScreen &&
<View className="item"> <View className="banner-box">
<Text className="device-time"> <View>
<Text className="time">{currentTime}</Text> <Video
</Text> className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
<Image
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
</View> </View>
<View className="line" />
<View className="item"> <View className="fr200-iot-device">
<Text className="gear">{currentGear}</Text> <View className="item">
<Text className="device-time">
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className="line" />
<View className="item">
<Text className="gear">{currentGear}</Text>
</View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/>
</View> </View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/>
</View> </View>
</View> }
{ModeList.length > 0 && ( {ModeList.length > 0 && isFullScreen&&(
<ModeListView <ModeListView
isPop={false} isPop={false}
isShowNurse={isShowNurse} isShowNurse={isShowNurse}
@ -2494,49 +2524,59 @@ class IotCarePlanFR200 extends Component<any, any> {
<button onClick={this.updata.bind(this)}> </button> <button onClick={this.updata.bind(this)}> </button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */} {/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
{(ActiveModeItem?.modeType === "maskPenetration" ||
ActiveModeItem?.modeType === "essence") &&isFullScreen&&(
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
)}
{ActiveModeItem?.modeType === "moistureTest" && isFullScreen&&(
<WaterTest
isRuningTest={isRuningTest}
stepList={waterStepList}
stepIndex={waterStepIndex}
></WaterTest>
)}
<View className={classnames({ show: showEcharts })}> <View className={classnames({ show: showEcharts })}>
<Echarts <Echarts
series={series} series={series}
full={this.full.bind(this)} full={this.full.bind(this)}
></Echarts> ></Echarts>
<EchartsFullScean {/* <EchartsFullScean
series={series} series={series}
full={this.full} full={this.full}
></EchartsFullScean> ></EchartsFullScean> */}
</View> </View>
</View>
{(ActiveModeItem.modeType === "maskPenetration" || {isFullScreen &&
ActiveModeItem.modeType === "essence") && ( <Footer
<Gears currentWorkModeType={currentWorkModeType}
onEmitMinus={this.handleMinus} isRuningTest={isRuningTest}
onEmitAdd={this.handleAdd} isStopNurse={isStopNurse}
GearData={GearData} onEmitStartNurse={this.onStartNurse}
></Gears> onEmitSwitchChange={this.onSwitchChange}
)} onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
/>
}
{ActiveModeItem.modeType === "moistureTest" && (
<WaterTest
isRuningTest={isRuningTest}
stepList={waterStepList}
stepIndex={waterStepIndex}
></WaterTest>
)}
</View>
<Footer
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse}
onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
/>
</View> </View>
</View> </View>
)}
{isFullScreen && ( {/*
<View> <View>
<button onClick={this.updata.bind(this)}> </button> <button onClick={this.updata.bind(this)}> </button>
@ -2544,8 +2584,20 @@ class IotCarePlanFR200 extends Component<any, any> {
series={series} series={series}
full={this.full} full={this.full}
></EchartsFullScean> ></EchartsFullScean>
</View> </View> */}
)}
</Block>
{/* <View
style="position:fixed;width:100vw;height:100vh"
>
<button onClick={this.full.bind(this)}> </button>
<Echarts
series={series}
full={this.full.bind(this)}
></Echarts>
</View> */}
</Block> </Block>
); );
} }

@ -130,7 +130,7 @@ export default class BluetoothContainer {
} }
// 2.判断工作状态是否与选中仪器一致 // 2.判断工作状态是否与选中仪器一致
if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) { if (jsonStatus?.workMode === this.that.state.ActiveModeItem?.modeType) {
if (this.that.state.workMode !== jsonStatus?.workMode) { if (this.that.state.workMode !== jsonStatus?.workMode) {
this.that.setState({ this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
@ -184,7 +184,7 @@ export default class BluetoothContainer {
return; return;
} }
if (jsonStatus?.workMode === this.that.state.ActiveModeItem.modeType) { if (jsonStatus?.workMode === this.that.state.ActiveModeItem?.modeType) {
this.that.setState({ this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存 workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
}); });
@ -212,7 +212,7 @@ export default class BluetoothContainer {
) { ) {
const { ActiveModeItem } = this.that.state; const { ActiveModeItem } = this.that.state;
const item = ActiveModeItem; const item = ActiveModeItem;
if (jsonStatus.workMode !== item.modeType) { if (jsonStatus.workMode !== item?.modeType) {
// clearTimeout(loadingTipsTimer); // clearTimeout(loadingTipsTimer);
this.that.setState({ this.that.setState({
isShowCountdown: false, isShowCountdown: false,

@ -157,6 +157,8 @@ function Index({ series, full }: Props) {
const updata = useCallback((res) => { const updata = useCallback((res) => {
let option = JSON.parse(JSON.stringify(options)) let option = JSON.parse(JSON.stringify(options))
option.series = JSON.parse(JSON.stringify(res)) option.series = JSON.parse(JSON.stringify(res))
console.log(echartsRef,'echartsRefechartsRefechartsRef');
// 更新图表数据 // 更新图表数据
setNewOptions(option) setNewOptions(option)
}, []) }, [])

@ -1149,7 +1149,8 @@ class Index extends Component<any, any> {
return ( return (
<Block> <Block>
{/* <PageMeta pageOrientation="landscape"> */} {/* <PageMeta pageOrientation="landscape"> </PageMeta> */}
{/* <View> */}
<View catchMove> <View catchMove>
<PopupAlert <PopupAlert
isShow={isCommonError} isShow={isCommonError}
@ -1500,8 +1501,8 @@ class Index extends Component<any, any> {
</Popup> </Popup>
{/* </PageMeta> */} {/* </View>
{/* <View <View
style="position:fixed;width:100vw;height:100vh" style="position:fixed;width:100vw;height:100vh"
onClick={this.goTest} onClick={this.goTest}
> >

Loading…
Cancel
Save