diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 9ef4754..1bafe36 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -67,482 +67,7 @@ import { import commandMap from "@/utils/commandMap"; import { Popup } from "@antmjs/vantui"; import { fr200BleCommand } from "@/components/bluetoot/connection/fr200"; -let datajson = { - ActiveModeItem: { - beganVideo: null, - combineData: [], - id: 154, - instrumentModel: "FR200", - instrumentType: 2, - isCabinMode: null, - isNew: 0, - lock: false, - lockCompanyTag: null, - lockCompanyTagArray: [], - lockWechatTag: null, - lockWechatTagArray: [], - modeBanner: "https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-3b7111f4ac41cf4a139fba4f0cc54f21_720w_20240314175626A632.jpg", - modeClass: 1, - modeDesc: "基础班脸部", - modeName: "基础班脸部", - modeTime: "00:02:00", - modeTimeStr: "02:00", - modeType: "face", - modeVideo: "https://flossom.yq-h5.cn/image//statics/2024/03/14/497728332_nb2-1-16_20240314175725A633.mp4", - openSourceData: [], - pauseVideo: null, - preparationVideo: null, - serviceData: null, - status: 0, - }, - currentServiceData: { - createBy: null, - createTime: "2024-03-15 14:15:14", - id: 169, - modeId: 154, - remark: null, - serviceEndTime: "00:02:00", - serviceEndTimeStr: "02:00", - serviceStartTime: "00:00:00", - serviceStartTimeStr: "00:00", - startSource: "https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-5363f74dedf1bb14baf92e09744e49c9_720w_20240314180057A635.gif", - startTimeArray: null, - stopSource: "https://flossom.yq-h5.cn/image//statics/2024/03/14/v2-0584e53b800e6ed28b4a228fedb8cb8d_720w_20240314180040A634.gif", - updateBy: null, - updateTime: null, - currentTime: "00:00", - }, - dataArray: [ - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 5, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "standby", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 211, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "standby", - }, { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 21, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 21, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "standby", - }, { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 251, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 321, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 271, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 219, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 271, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 421, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 251, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 231, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 211, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 261, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 261, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 721, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 121, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 321, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 221, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 216, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 212, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 211, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 721, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 121, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "working", - }, - ], - id: "2024-03-18 15:50:39", - instrumentId: 92, - instrumentName: "lzw的FR200测试", - jsonStatus: { - battery: 4, - commandType: "DeviceStatusSync", - deviceSyncStatusType: "onlySyncStatusToDevice", - gear: 1, - impedance: 21, - isCharging: false, - joulePerSecond: 1, - matrixBattery: 0, - nasolabialOrMandibularOutput: false, - partition: 0, - pointOutChangeSide: false, - totalWorkingMinutes: 2, - totalWorkingSeconds: 1, - workMode: "face", - workStatus: "standby", - }, - modeId: 154, - modeName: "基础班脸部", - workMode: "face", -} + const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200"); let deviceToolKitInstance = deviceToolKitInstanceFR200; @@ -628,7 +153,7 @@ class IotCarePlanFR200 extends Component { }, // 当前选中模式 SwitchActiveModeItem: {}, // 切换选中模式 ModeID: "mode_", // 模式KEY - activeModeID: "", // 当前选中模式ID:用于高亮 + activeModeID: "154", // 当前选中模式ID:用于高亮 ModeStepIndex: 0, // 当前护理功效步骤:每个步骤时间不定,所以时间另外计算,根据步骤显示 ModeStepTimeArray: [], // 护理功效时间步骤,用于切换显示GIF currentServiceData: { @@ -704,6 +229,13 @@ class IotCarePlanFR200 extends Component { BaseModeType: string[] = ["face", "eyes"]; async onLoad(option) { + console.log(option,'跳转过来的数据'); + if (option.modeId) { + this.setState({ activeModeID: option.modeId }) + setTimeout(() => { + console.log(this.state,'查看'); + }) + } // 保持屏幕常亮 Taro.setKeepScreenOn({ keepScreenOn: true, @@ -711,9 +243,7 @@ class IotCarePlanFR200 extends Component { this.initData(); this.getInstrumentClockSummary(); this.getInstrumentClockDetail(); - if (option.modeId) { - this.setState({ activeModeID: option.modeId }) - } + } componentDidMount() { } @@ -845,6 +375,7 @@ class IotCarePlanFR200 extends Component { instrumentId: id, }; let res = await InstrumentInfo.modeInfoList(params); + if (res.data.code === 200) { if (res.data.data.length > 0) { this.setState({ @@ -861,9 +392,9 @@ class IotCarePlanFR200 extends Component { } }) } - + let res1= res.data.data.find(e =>e.id == this.state.activeModeID) setTimeout(() => { - this.modeCurrentFun(res.data.data[0]); + this.modeCurrentFun(res1); }, 100); } else { this.setState({ ModeList: [] }); @@ -903,7 +434,7 @@ class IotCarePlanFR200 extends Component { /** 选中护理模式 */ modeCurrentFun = async (data, isNotCheck = false) => { - let { isShowNurse } = this.state; + let { isShowNurse,activeModeID } = this.state; // 护理检查改变模式,是否提示切换护理模式 // isNotCheck为真时,不进行校验,直接切换 this.tempModeCurrent = data; @@ -930,7 +461,7 @@ class IotCarePlanFR200 extends Component { } let currentTime = data.modeTimeStr; - + this.setState({ ActiveModeItem: data, activeModeID: data.id, @@ -946,6 +477,8 @@ class IotCarePlanFR200 extends Component { if (data.serviceData.length > 0) { this.setServiceTimeData(); } + + }); // 开发中,暂时允许直接切换 @@ -1032,6 +565,7 @@ class IotCarePlanFR200 extends Component { }; // 弹窗确定切换护理模式 confirmModeSwitchBtn = () => { + let { SwitchActiveModeItem } = this.state; this.cancelModeSwitchBtn(); this.modeCurrentFun(SwitchActiveModeItem); diff --git a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx index 48eb98d..c7dd603 100644 --- a/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx @@ -26,12 +26,14 @@ function Index({ onEmitShowAll, onModeLockOpen, }: Props) { + + let BaseList = ModeList.filter((item) => item.modeClass === 1); // 基础护理 let ZoneList = ModeList.filter((item) => item.modeClass === 2); // 专区护理 let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗 let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理 let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤 - + console.log(activeModeID,'查看id',BaseList,ModeList); const onItemClick = (item) => { if (item.lock) { onModeLockOpen(); // 点击了锁定模式 diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 92cb3e2..46e398e 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -294,21 +294,17 @@ export default class Recording extends Component { setStorageSync("instrument_detail", instrument); } }) - switch (item.jumpType) { - case 1: - this.One(item); - break; - case 2: - this.two(item); - break; - case 6: - this.three(item); - break; - default: - this.AllDevice(item); + + if ([1,2,3,4,5].includes(item.jumpType)) { + this.One(item); + } else if (item.jumpType === 0) { + this.two(item); + } else if (item.jumpType === 6) { + this.three(item); + } else { + this.AllDevice(item); } - // let report =false // go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report ); }