From 819d2d0cdc3cfe0b6bbcd4144bb583551db38d64 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Thu, 14 Mar 2024 20:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.private.config.json | 7 - src/app.boot.js | 1 - src/app.config.ts | 2 +- src/app.tsx | 1 - src/moduleIOT/pages/iotCarePlan/FR200.less | 1 + src/moduleIOT/pages/iotCarePlan/FR200.tsx | 83 ++--- .../{iotCarePlan.less => WL200.less} | 0 .../{iotCarePlan.tsx => WL200.tsx} | 30 +- .../iotCarePlan/components/Footer/index.tsx | 6 +- .../components/ModeContent/FR200.less | 1 + .../components/ModeContent/FR200.tsx | 23 ++ .../ModeContent/{index.less => WL200.less} | 0 .../ModeContent/{index.tsx => WL200.tsx} | 2 +- .../components/ModeList/FR200.less | 1 + .../iotCarePlan/components/ModeList/FR200.tsx | 347 ++++++++++++++++++ .../ModeList/{index.less => WL200.less} | 0 .../ModeList/{index.tsx => WL200.tsx} | 3 +- src/pages/index/index.tsx | 4 +- src/pages/instrument/intro.tsx | 13 +- 19 files changed, 434 insertions(+), 91 deletions(-) delete mode 100644 project.private.config.json rename src/moduleIOT/pages/iotCarePlan/{iotCarePlan.less => WL200.less} (100%) rename src/moduleIOT/pages/iotCarePlan/{iotCarePlan.tsx => WL200.tsx} (99%) create mode 100644 src/moduleIOT/pages/iotCarePlan/components/ModeContent/FR200.less create mode 100644 src/moduleIOT/pages/iotCarePlan/components/ModeContent/FR200.tsx rename src/moduleIOT/pages/iotCarePlan/components/ModeContent/{index.less => WL200.less} (100%) rename src/moduleIOT/pages/iotCarePlan/components/ModeContent/{index.tsx => WL200.tsx} (99%) create mode 100644 src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.less create mode 100644 src/moduleIOT/pages/iotCarePlan/components/ModeList/FR200.tsx rename src/moduleIOT/pages/iotCarePlan/components/ModeList/{index.less => WL200.less} (100%) rename src/moduleIOT/pages/iotCarePlan/components/ModeList/{index.tsx => WL200.tsx} (99%) diff --git a/project.private.config.json b/project.private.config.json deleted file mode 100644 index 7ba271a..0000000 --- a/project.private.config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "setting": { - "compileHotReLoad": true, - "bigPackageSizeSupport": true - } -} \ No newline at end of file diff --git a/src/app.boot.js b/src/app.boot.js index a2f9302..c78d34c 100644 --- a/src/app.boot.js +++ b/src/app.boot.js @@ -24,7 +24,6 @@ class App extends Component { return; } - // go("/pages/iotCarePlan/iotCarePlan"); // go("/pages/instrument_clickin_upload/index"); // go("/pages/instrument/intro"); // Taro.switchTab({ diff --git a/src/app.config.ts b/src/app.config.ts index 07477fd..cd85c63 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -86,7 +86,7 @@ export default defineAppConfig({ { root: 'moduleIOT', pages: [ - "pages/iotCarePlan/iotCarePlan", + "pages/iotCarePlan/WL200", "pages/iotCarePlan/FR200", ] } diff --git a/src/app.tsx b/src/app.tsx index 17f46bc..fbadf61 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -27,7 +27,6 @@ class App extends Component { // 每次进入小程序,删除可能残留的同步状态 Taro.removeStorageSync("isSyncHistory"); - // go("/pages/iotCarePlan/iotCarePlan"); // go("/pages/instrument_clickin_upload/index"); // go("/pages/instrument/intro"); // Taro.switchTab({ diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.less b/src/moduleIOT/pages/iotCarePlan/FR200.less index e69de29..231581f 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.less +++ b/src/moduleIOT/pages/iotCarePlan/FR200.less @@ -0,0 +1 @@ +@import url(./WL200.less); diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index 439cd85..25eed0d 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -10,7 +10,7 @@ import React, { useState, } from "react"; -// import Echarts from "./components/Echart/index"; +import Echarts from "./components/Echart/index"; import { Block, View, @@ -38,14 +38,14 @@ import ConnectionBluetoot from "@/components/bluetoot/connection"; /* 本页组件 */ import ElectricityView from "./components/ElectricityView/index"; -import ModeListView from "./components/ModeList/index"; -import ModeContent from "./components/ModeContent/index"; +import ModeListView from "./components/ModeList/FR200"; +import ModeContent from "./components/ModeContent/FR200"; import Footer from "./components/Footer"; /* 本页组件 END */ import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI"; import { InstrumentInfo } from "@/utils/Interface"; -import "./iotCarePlan.less"; +import "./FR200.less"; import { notifyBLECharacteristicValueChange, @@ -75,27 +75,6 @@ let loadingTipsTimer: any = null; // 蓝牙连接提示 // 设备运行时间校准频率,每多少秒校准一次 const TIME_CALIBRATION_FREQUENCY = 5; -// 组合模式:分别对应的是哪几个模式类型 -// 黄光590nm -// 红光630nm -// 近红外光830nm - -// 模式类型中文名 -const WORK_MODE_Chinese_NAME = { - 强效舒缓: "powerfulSoothing", - 维稳修复: "Stability", // 黄光?近红外光? - 均色提亮: "Brighten", // 黄光?近红外光? - 紧致淡纹: "FirmSkin", // 黄光?近红外光? - 自定义: "MaskCustom", - 均色提亮Pro: "BrightenStand", - 紧致淡纹Pro: "FirmSkinStand", - 痘肌舒缓Pro: "SmallpoxSoothingPro", - 痘肌舒缓: "SmallpoxSoothing", - 混合Pro: "MixNursePro", - 混合: "MixNurse", - 头皮护理: "ScalpCare", -}; - const MODE_WORKING_ENUM = { STANDBY: "standby", // 待命 WORKING: "working", // 工作 @@ -125,12 +104,12 @@ let DeviceSyncData = { }; let deviceToolKitInstance = deviceToolKitInstanceFR200; -class IotCareWR200 extends Component { +class IotCarePlanFR200 extends Component { constructor(props) { super(props); this.state = { - name: "iotCarePlan", - title: "美容仪名字", // 页面标题 + name: "FR200", + title: "FR200", // 页面标题 // 当前设备 currentDevice: { name: "", @@ -171,8 +150,8 @@ class IotCareWR200 extends Component { // 模式列表 isSwitchActiveMode: false, // 是否显示弹窗切换模式 ModeList: [], - ModeType: "all", // all visor面罩 cabin舱体 yimeish医美 - modeClass: "", // 1面罩 2舱体 3医美 + ModeType: "all", // all + modeClass: "", // 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤 ActiveModeItem: {}, // 当前选中模式 SwitchActiveModeItem: {}, // 切换选中模式 ModeID: "mode_", // 模式KEY @@ -230,12 +209,22 @@ class IotCareWR200 extends Component { hadGotInstrumentHistoryData = false; // 是否已缓存仪器历史数据 hadLoadedPage = false; // 判断是否首次进入页面 + /** FR200模式类型:名称 */ + ModeTypeArray: string[] = [ + "all", + "Base", + "Zone", + "Permeation", + "Sensitive", + "Intelligence", + ]; + async onLoad() { // 保持屏幕常亮 Taro.setKeepScreenOn({ keepScreenOn: true, }); - this.getWL200NursingHistory(); + // this.getWL200NursingHistory(); this.initData(); } componentDidMount() {} @@ -250,7 +239,7 @@ class IotCareWR200 extends Component { return; } - this.getWL200NursingHistory(); + // this.getWL200NursingHistory(); // 重置初始值,每次进入页面重新检查面罩护理记录 this.hadCheckReport = false; this.hadGotInstrumentHistoryData = false; @@ -285,9 +274,6 @@ class IotCareWR200 extends Component { // 仅手机端初始化蓝牙 this.init(); } - - // 初始化蓝牙 - // this.init(); } getOption() { @@ -448,7 +434,7 @@ class IotCareWR200 extends Component { } let currentTime = data.modeTimeStr; - let modeArray = ["all", "visor", "cabin", "yimeish"]; + this.setState({ ActiveModeItem: data, activeModeID: data.id, @@ -456,7 +442,7 @@ class IotCareWR200 extends Component { currentServiceData, ModeStepIndex: 0, currentTime, - ModeType: modeArray[data.modeClass], + ModeType: this.ModeTypeArray[data.modeClass], }); setTimeout(() => { @@ -539,19 +525,16 @@ class IotCareWR200 extends Component { this.cancelModeSwitchBtn(); this.modeCurrentFun(SwitchActiveModeItem); - let modeArray = ["all", "visor", "cabin", "yimeish"]; this.setState({ - ModeType: modeArray[SwitchActiveModeItem.modeClass], + ModeType: this.ModeTypeArray[SwitchActiveModeItem.modeClass], }); }; stepNext = () => { - // //0未定义(全部) 1面罩模式 2舱体模式 3医美术后 - let modeArray = ["all", "visor", "cabin", "yimeish"]; let modeClass = this.state.ActiveModeItem.modeClass; this.workStatus = "pause"; this.setState({ - ModeType: modeArray[modeClass], + ModeType: this.ModeTypeArray[modeClass], isShowNurse: true, isStopNurse: true, step: 2, @@ -790,18 +773,6 @@ class IotCareWR200 extends Component { case "BleMatch": // 蓝牙相关指令 this.switchBLEMatch(jsonStatus); - // switch (jsonStatus.bleCommandType) { - // case 'SendMatchCode': - // if(jsonStatus.matchedSuccess){ - // //设备返回了蓝牙配对成功 - // }else{ - - // } - // break; - // default: - // break; - // } - break; //设备状态同步 case "DeviceStatusSync": @@ -2277,7 +2248,7 @@ class IotCareWR200 extends Component { /> )} - {/* */} +