rongweikang 2 years ago
commit 9e201ad45e

@ -63,13 +63,14 @@ export const fr200DeviceControlCommand = {
* face: "01", 面部 * face: "01", 面部
* eyes: "02", 眼部 * eyes: "02", 眼部
* *
* nasolabialFold: "03", 法令纹 * nasolabialFold: "03", 法令纹Pro
* mandibularLine: "04", 下颌线 * mandibularLine: "04", 下颌线Pro
* led: "05", led * led: "05", led
* headLiftingPro: "09", 抬头纹Pro
*
* moistureTest: "06", 水分测试 * moistureTest: "06", 水分测试
* maskPenetration: "07",面膜促渗 * maskPenetration: "07",面膜促渗
* essence: "08", 精华模式 * essence: "08", 精华模式
* headLiftingPro: "09", 抬头纹Pro
* *
* neck: "0A", 颈纹 * neck: "0A", 颈纹
* partition: "11", 分区模式 废弃VM1001 * partition: "11", 分区模式 废弃VM1001

@ -347,7 +347,7 @@ class Instrument extends Component<any, any> {
// this.openBindingVisible(); // this.openBindingVisible();
msg("绑定成功"); msg("绑定成功");
setTimeout(() => { setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id); this.getInstrumentIntroInfo(channelInfo.id);
}, 500); }, 500);
} else if (code === 202) { } else if (code === 202) {
@ -384,6 +384,7 @@ class Instrument extends Component<any, any> {
Taro.setStorageSync("isScan", true); Taro.setStorageSync("isScan", true);
Taro.setStorageSync("serial", channelInfo.serialCode); Taro.setStorageSync("serial", channelInfo.serialCode);
Taro.switchTab({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
return;
// this.openBindingVisible(); // this.openBindingVisible();
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
this.changeBindBox(); this.changeBindBox();
@ -414,7 +415,7 @@ class Instrument extends Component<any, any> {
this.setState({ isVisibleBinding: false }); this.setState({ isVisibleBinding: false });
msg("绑定成功"); msg("绑定成功");
setTimeout(() => { setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id); this.getInstrumentIntroInfo(channelInfo.id);
}, 500); }, 500);
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
@ -444,7 +445,7 @@ class Instrument extends Component<any, any> {
if (data.code === 200) { if (data.code === 200) {
msg("换绑成功"); msg("换绑成功");
setTimeout(() => { setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setStorageSync("instrument_detail", channelInfo);
this.getInstrumentIntroInfo(channelInfo.id); this.getInstrumentIntroInfo(channelInfo.id);
}, 500); }, 500);
} }
@ -457,7 +458,7 @@ class Instrument extends Component<any, any> {
}); });
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
go("/instrument/pages/instrument/intro??customBack=true&id=" + id); go("/instrument/pages/instrument/intro?customBack=true&id=" + id);
} else { } else {
Taro.switchTab({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
} }

@ -67,6 +67,7 @@ class Intro extends Component<any, any> {
} }
componentDidMount() { componentDidMount() {
let strObj = getStorageSync("instrument_detail"); let strObj = getStorageSync("instrument_detail");
console.log("strObj", strObj);
if (strObj) { if (strObj) {
let instrument = strObj; let instrument = strObj;
this.getInstrumentInfo(instrument.id); this.getInstrumentInfo(instrument.id);

@ -67,482 +67,7 @@ import {
import commandMap from "@/utils/commandMap"; import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui"; import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200"; 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"); const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200");
let deviceToolKitInstance = deviceToolKitInstanceFR200; let deviceToolKitInstance = deviceToolKitInstanceFR200;
@ -618,6 +143,8 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 护理过程 END*/ /** 护理过程 END*/
// 模式列表 // 模式列表
TestModeStepIndex: 0,
currentWorkModeType: 1,
isModeLock: false, // 模式是否锁定 isModeLock: false, // 模式是否锁定
isSwitchActiveMode: false, // 是否显示弹窗切换模式 isSwitchActiveMode: false, // 是否显示弹窗切换模式
ModeList: [], ModeList: [],
@ -712,12 +239,12 @@ class IotCarePlanFR200 extends Component<any, any> {
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
if (option.modeId) { if (option.modeId) {
this.setState({ activeModeID: option.modeId }) this.setState({ activeModeID: option.modeId });
} }
} }
componentDidMount() { } componentDidMount() {}
componentWillUnmount() { } componentWillUnmount() {}
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
@ -840,6 +367,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
}; };
// 获取模式列表
GetModeList = async (id) => { GetModeList = async (id) => {
let params = { let params = {
instrumentId: id, instrumentId: id,
@ -848,19 +376,18 @@ class IotCarePlanFR200 extends Component<any, any> {
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
this.setState({ this.setState({
ActiveModeItem: res.data.data[0],
ModeList: res.data.data, ModeList: res.data.data,
}); });
if (this.state.activeModeID != '') { // if (this.state.activeModeID != "") {
this.state.ModeList.map(item => { // this.state.ModeList.map((item) => {
if (item.id === this.state.activeModeID) { // if (item.id === this.state.activeModeID) {
this.setState({ // this.setState({
ActiveModeItem: item // ActiveModeItem: item,
}); // });
} // }
}) // });
} // }
setTimeout(() => { setTimeout(() => {
this.modeCurrentFun(res.data.data[0]); this.modeCurrentFun(res.data.data[0]);
@ -901,7 +428,9 @@ class IotCarePlanFR200 extends Component<any, any> {
}, 0); }, 0);
} }
/** 选中护理模式 */ /**
* @name /
* */
modeCurrentFun = async (data, isNotCheck = false) => { modeCurrentFun = async (data, isNotCheck = false) => {
let { isShowNurse } = this.state; let { isShowNurse } = this.state;
// 护理检查改变模式,是否提示切换护理模式 // 护理检查改变模式,是否提示切换护理模式
@ -931,14 +460,26 @@ class IotCarePlanFR200 extends Component<any, any> {
let currentTime = data.modeTimeStr; let currentTime = data.modeTimeStr;
// 根据模式,动态设置底部按钮样式
let currentWorkModeType = 1;
if (data.modeType === "moistureTest") {
currentWorkModeType = 3;
} else if (
data.modeType === "maskPenetration" ||
data.modeType === "essence"
) {
currentWorkModeType = 2;
}
this.setState({ this.setState({
ActiveModeItem: data, ActiveModeItem: data,
activeModeID: data.id, activeModeID: data.id,
ModeID: "mode_" + data.id, ModeID: "mode_" + data.id,
currentServiceData, currentServiceData,
ModeStepIndex: 0, ModeStepIndex: 0,
currentTime,
ModeType: this.ModeTypeArray[data.modeClass], ModeType: this.ModeTypeArray[data.modeClass],
currentTime,
currentWorkModeType,
}); });
setTimeout(() => { setTimeout(() => {
@ -1059,12 +600,12 @@ class IotCarePlanFR200 extends Component<any, any> {
onStartNurse = async () => { onStartNurse = async () => {
this.stepNext(); this.stepNext();
setTimeout(() => { setTimeout(() => {
this.onNursingTap(); this.onNursingTap();
// 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗 // // 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗
let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3; // let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => { }); // this.showCountdownFun(downNum, () => {});
}, 500); }, 500);
// 如果检查失败,则报错 // 如果检查失败,则报错
this.onEmitErrorTips(); this.onEmitErrorTips();
@ -1084,7 +625,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
// 绘制能量图 // 绘制能量图
drawProwerPicture() { } drawProwerPicture() {}
/** 切换光照 */ /** 切换光照 */
onSwitchChange = async () => { onSwitchChange = async () => {
@ -1197,6 +738,18 @@ class IotCarePlanFR200 extends Component<any, any> {
case "working": case "working":
//设备的运行中状态 //设备的运行中状态
console.log("设备状态同步 运行中状态", jsonStatus); console.log("设备状态同步 运行中状态", jsonStatus);
if (jsonStatus.workMode === "moistureTest") {
// 水分测试
// teststatus:success
}
// 脸部模式
if (jsonStatus.workMode === "face") {
// impedance
// totalWorkingMinutes: 0
// totalWorkingSeconds: 24
}
// this.judgementWorkStatus( // this.judgementWorkStatus(
// MODE_WORKING_ENUM.WORKING, // MODE_WORKING_ENUM.WORKING,
// jsonStatus.workMode // jsonStatus.workMode
@ -1673,9 +1226,11 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
// 水分测试需要特殊处理 // 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") { if (ActiveModeItem.modeType === "moistureTest") {
sendParams.testStatus = "standby"; // 切换为准备 sendParams.testStatus = "standby"; // 切换为准备
if (isBtnClick) { if (isBtnClick) {
// 水分测试启动
sendParams.testStatus = "start"; // 点击开始再开始 sendParams.testStatus = "start"; // 点击开始再开始
} }
} }
@ -1946,7 +1501,10 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 获取小程序本地缓存的历史记录 */ /** 获取小程序本地缓存的历史记录 */
getFR200NursingHistory() { getFR200NursingHistory() {
this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
console.log(this.FR200NursingHistory, '获取本地数据++++++++++++++++++++++++++++++++++++++++++'); console.log(
this.FR200NursingHistory,
"获取本地数据++++++++++++++++++++++++++++++++++++++++++"
);
// 是否同步历史记录 // 是否同步历史记录
let isSyncHistory = Taro.getStorageSync("isSyncHistory"); let isSyncHistory = Taro.getStorageSync("isSyncHistory");
@ -2023,6 +1581,11 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
Taro.setStorageSync("FR200NursingHistory", params); Taro.setStorageSync("FR200NursingHistory", params);
console.log("更新updateFR200NursingHistory"); console.log("更新updateFR200NursingHistory");
// 基础模式可在这里调用函数更新图标Echarts
// 最新一条数据jsonStatus
// 注意事项只拿working状态
// todo
} else { } else {
this.setFR200NursingHistory(jsonStatus); this.setFR200NursingHistory(jsonStatus);
} }
@ -2061,29 +1624,31 @@ class IotCarePlanFR200 extends Component<any, any> {
todoPromise = async () => { todoPromise = async () => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
// 护理脸部 // 护理脸部
if (nowFR200NursingHistory.workMode === 'face') { if (nowFR200NursingHistory.workMode === "face") {
// 把working=工作中的状态数据筛选出来 // 把working=工作中的状态数据筛选出来
let filtered = nowFR200NursingHistory.dataArray.filter(item => item.workStatus === 'working'); let filtered = nowFR200NursingHistory.dataArray.filter(
(item) => item.workStatus === "working"
);
// 能量发数 // 能量发数
filtered = filtered.slice(0, 360); filtered = filtered.slice(0, 360);
// 脸部能量 // 脸部能量
let faceEnergy = 0 let faceEnergy = 0;
filtered.forEach(item => { filtered.forEach((item) => {
faceEnergy += item.joulePerSecond faceEnergy += item.joulePerSecond;
}) });
// 计算平均数 // 计算平均数
// let sum = filtered.reduce((accumulator, currentValue) => accumulator + currentValue.impedance, 0); // let sum = filtered.reduce((accumulator, currentValue) => accumulator + currentValue.impedance, 0);
// let average = sum / filtered.length; // let average = sum / filtered.length;
// 最大 // 最大
let max: any = Math.max(...filtered.map(item => item.impedance)); let max: any = Math.max(...filtered.map((item) => item.impedance));
max = this.determineTier(max) max = this.determineTier(max);
// 最小 // 最小
let min: any = Math.min(...filtered.map(item => item.impedance)); let min: any = Math.min(...filtered.map((item) => item.impedance));
min = this.determineTier(min) min = this.determineTier(min);
// 平均数最大等级处于2 // 平均数最大等级处于2
let average: any = max / 2 let average: any = max / 2;
average = this.determineTier(average) average = this.determineTier(average);
// 能量图里面的图谱每10秒为一个数组 // 能量图里面的图谱每10秒为一个数组
// 创建一个空数组用于存储分组后的结果 // 创建一个空数组用于存储分组后的结果
@ -2095,14 +1660,14 @@ class IotCarePlanFR200 extends Component<any, any> {
let group = filtered.slice(i, i + 10); let group = filtered.slice(i, i + 10);
// 找到组中最大的 name 值 // 找到组中最大的 name 值
let maxName = Math.max(...group.map(obj => obj.impedance)); let maxName = Math.max(...group.map((obj) => obj.impedance));
// 计算并存储每组的平均数 // 计算并存储每组的平均数
let average:any = this.determineTier(maxName / 2); let average: any = this.determineTier(maxName / 2);
// let average = maxName / 2; // let average = maxName / 2;
if(average >=1) { if (average >= 1) {
average=average-1 average = average - 1;
average=average *10 average = average * 10;
} }
// 将包含该组对象和平均数的对象添加到 groupedAa 数组中 // 将包含该组对象和平均数的对象添加到 groupedAa 数组中
groupedAa.push(average); groupedAa.push(average);
@ -2111,30 +1676,35 @@ class IotCarePlanFR200 extends Component<any, any> {
let nursingData = { let nursingData = {
// nursingTime:result, // nursingTime:result,
nursingData: JSON.stringify({ nursingData: JSON.stringify({
faceEnergy, max, min, average, groupedAa, filtered: filtered.length, workMode: nowFR200NursingHistory.workMode faceEnergy,
}) max,
} min,
average,
groupedAa,
filtered: filtered.length,
workMode: nowFR200NursingHistory.workMode,
}),
};
return nursingData return nursingData;
} else { } else {
let GearData = this.state.GearData; let GearData = this.state.GearData;
// 肌肤报告 // 肌肤报告
let Allnum = 0 let Allnum = 0;
GearData.forEach(e => { GearData.forEach((e) => {
Allnum = +e.forehead Allnum = +e.forehead;
}); });
// 向下取整 // 向下取整
Allnum = Math.floor(Allnum / 3); Allnum = Math.floor(Allnum / 3);
let nursingData = { let nursingData = {
nursingData: JSON.stringify({ nursingData: JSON.stringify({
Allnum, GearData Allnum,
}) GearData,
} }),
return nursingData };
return nursingData;
} }
};
}
// 计算挡位 // 计算挡位
determineTier = (sun) => { determineTier = (sun) => {
@ -2149,8 +1719,8 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
// 如果 sun 不在任何一档范围内,返回默认档或处理错误 // 如果 sun 不在任何一档范围内,返回默认档或处理错误
return '10'; return "10";
} };
/** 提交护理记录:完成护理后自动调用,会跳转页面 */ /** 提交护理记录:完成护理后自动调用,会跳转页面 */
PostNursingLogClock = async (data: any = null, isJump = true) => { PostNursingLogClock = async (data: any = null, isJump = true) => {
// todo 建议写一个Promise异步函数用 await 执行,在提交前处理好数据 // todo 建议写一个Promise异步函数用 await 执行,在提交前处理好数据
@ -2161,19 +1731,17 @@ class IotCarePlanFR200 extends Component<any, any> {
if (data) { if (data) {
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),
}; };
} }
let res1: any = await this.todoPromise() let res1: any = await this.todoPromise();
console.log(res1, '查看返回数据'); console.log(res1, "查看返回数据");
params = { ...params, ...res1 } params = { ...params, ...res1 };
let res: any = await InstrumentInfo.apiNursingLog.addLog(params); let res: any = await InstrumentInfo.apiNursingLog.addLog(params);
console.log("PostNursingLogClock", res); console.log("PostNursingLogClock", res);
if (res.data.code === 200) { if (res.data.code === 200) {
@ -2194,7 +1762,6 @@ class IotCarePlanFR200 extends Component<any, any> {
isShowNursingSuccess: false, isShowNursingSuccess: false,
}); });
this.goFaceReport(res1, ActiveModeItem.id); // 跳转 this.goFaceReport(res1, ActiveModeItem.id); // 跳转
}, 2000); }, 2000);
} }
@ -2352,30 +1919,36 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 完成护理提交:跳转护理报告页 */ /** 完成护理提交:跳转护理报告页 */
goFaceReport = (data, id) => { goFaceReport = (data, id) => {
let nursingData = JSON.parse(data.nursingData) let nursingData = JSON.parse(data.nursingData);
// 跳转前置空定时器,防止重复提交 // 跳转前置空定时器,防止重复提交
if (currentTimeTimer) clearInterval(currentTimeTimer); if (currentTimeTimer) clearInterval(currentTimeTimer);
if (['face', 'eyes', 'nasolabialFold', 'mandibularLine', 'headLiftingPro'].includes(nursingData.workMode)) { if (
[
"face",
"eyes",
"nasolabialFold",
"mandibularLine",
"headLiftingPro",
].includes(nursingData.workMode)
) {
let obj = { let obj = {
modeName: nursingData.modeName, modeName: nursingData.modeName,
data: nursingData data: nursingData,
} };
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=" +
id + id +
"&report=" + "&report=" +
report + "&obj=" + report +
JSON.stringify(obj) "&obj=" +
JSON.stringify(obj)
); );
} else if ("moistureTest" === nursingData.workMode) {
} else if ('moistureTest' === nursingData.workMode) { console.log("水分测试");
console.log('水分测试');
} else { } else {
go("/pages/face_report/face_report?id=" + this.state.currentDevice.id); go("/pages/face_report/face_report?id=" + this.state.currentDevice.id);
} }
}; };
// 完成配对 // 完成配对
@ -2477,6 +2050,7 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeStepIndex, ModeStepIndex,
currentServiceData, currentServiceData,
ActiveModeItem, ActiveModeItem,
currentWorkModeType,
isSwitchActiveMode, isSwitchActiveMode,
ModeID, ModeID,
activeModeID, activeModeID,
@ -2501,6 +2075,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isRuningTest, isRuningTest,
isShowHistoryMsg, isShowHistoryMsg,
isModeLock, isModeLock,
TestModeStepIndex,
} = this.state; } = this.state;
return ( return (
@ -2646,9 +2221,9 @@ class IotCarePlanFR200 extends Component<any, any> {
deviceInfo={currentDevice} deviceInfo={currentDevice}
close={this.connectionClose} close={this.connectionClose}
isDisconnect={!isConnectionBlutoot} isDisconnect={!isConnectionBlutoot}
offlineChange={() => { }} offlineChange={() => {}}
pairingChange={this.pairingChange} pairingChange={this.pairingChange}
upgradeFun={() => { }} upgradeFun={() => {}}
/> />
)} )}
@ -2744,12 +2319,15 @@ class IotCarePlanFR200 extends Component<any, any> {
)} )}
{ActiveModeItem.modeType === "moistureTest" && ( {ActiveModeItem.modeType === "moistureTest" && (
<WaterTest></WaterTest> <WaterTest
isRuningTest={isRuningTest}
TestModeStepIndex={TestModeStepIndex}
></WaterTest>
)} )}
</View> </View>
<Footer <Footer
currentWorkMode={ActiveModeItem.modeType} currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest} isRuningTest={isRuningTest}
isStopNurse={isStopNurse} isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse} onEmitStartNurse={this.onStartNurse}

@ -3,7 +3,7 @@ import "./FR200.less";
interface Props { interface Props {
// isShowNurse: boolean; // isShowNurse: boolean;
currentWorkMode: string; // 当前工作模式 currentWorkModeType: number; // 当前工作模式 1基础脸部等只有结束按钮 2.促渗,可以开始暂停和结束 3.水分测试
isStopNurse: boolean; isStopNurse: boolean;
isRuningTest: boolean; // 是否在运行测试 isRuningTest: boolean; // 是否在运行测试
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件 onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
@ -11,7 +11,7 @@ interface Props {
onEmitEndPlan: Function; onEmitEndPlan: Function;
} }
function Index({ function Index({
currentWorkMode, currentWorkModeType,
isStopNurse, isStopNurse,
isRuningTest, isRuningTest,
onEmitStartNurse, onEmitStartNurse,
@ -33,7 +33,7 @@ function Index({
return ( return (
<Block> <Block>
<View className="iot-footer"> <View className="iot-footer">
{currentWorkMode === "moistureTest" && ( {currentWorkModeType === 3 && (
<Block> <Block>
{!isRuningTest ? ( {!isRuningTest ? (
<View className="btn " onClick={onStartNurse}> <View className="btn " onClick={onStartNurse}>
@ -45,7 +45,7 @@ function Index({
</Block> </Block>
)} )}
{currentWorkMode !== "moistureTest" && ( {currentWorkModeType === 2 && (
<View className="switch-btn-box"> <View className="switch-btn-box">
<View className="btn-item border-right" onClick={onSwitchChange}> <View className="btn-item border-right" onClick={onSwitchChange}>
{isStopNurse ? ( {isStopNurse ? (
@ -79,6 +79,19 @@ function Index({
</View> </View>
</View> </View>
)} )}
{currentWorkModeType === 1 && (
<View className="switch-btn-box">
<View className="btn-item" onClick={onEndPlan}>
<Image
className="btn-icon"
src={require("@/img/iot/over_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</View>
</View>
)}
</View> </View>
</Block> </Block>
); );

@ -6,12 +6,11 @@ import { Popup, Progress, Slider } from "@antmjs/vantui";
import "./index.less"; import "./index.less";
interface Props { interface Props {
Electricity: any; isRuningTest: boolean; // 是否已开始水分测试
matrixElectricity: any; TestModeStepIndex: number; // 当前测试步骤
facialMaskConnectStatus: any;
} }
function Index() { function Index(isRuningTest, TestModeStepIndex) {
const stepIndex = 0; const stepIndex = 0;
const testIndex = 1; const testIndex = 1;
@ -33,53 +32,56 @@ function Index() {
}, },
]; ];
return ( return (
<Block> <Block>
<View> <View>
<View className='water_test'> {!isRuningTest && (
<View className='test_step flex aitems sb'> <View className="water_test">
<View className="test_step flex aitems sb">
{stepList.map((item, index) => { {stepList.map((item, index) => {
return ( return (
<View className='step_block flex aitems' key={index}> <View className="step_block flex aitems" key={index}>
<View className='step_top flex aitems'> <View className="step_top flex aitems">
<View className='drop'></View> <View className="drop"></View>
<View className='step_num'>{item.value}</View> <View className="step_num">{item.value}</View>
{index != 2 && <View className='line'></View>} {index != 2 && <View className="line"></View>}
</View> </View>
<View className='step_name'>{item.name}</View> <View className="step_name">{item.name}</View>
</View> </View>
); );
})} })}
</View> </View>
<View className='test_txt'> <View className="test_txt">
</View> </View>
</View> </View>
)}
<View className='testing'> {isRuningTest && (
<View className='testing_header flex aitems'> <View className="testing">
<View className="testing_header flex aitems">
{stepList.map((item, index) => { {stepList.map((item, index) => {
return ( return (
<View <View
className='items flex aitems jcenter' className="items flex aitems jcenter"
key={index} key={index}
style={stepIndex == index ? "background: #fff" : ""} style={stepIndex == index ? "background: #fff" : ""}
> >
{stepIndex > index && ( {stepIndex > index && (
<Image <Image
className='finish_img' className="finish_img"
src={require("@/img/full-scran.png")} src={require("@/img/full-scran.png")}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
)} )}
<View className='value'>{item.value}</View> <View className="value">{item.value}</View>
<View className='name'>{item.name}</View> <View className="name">{item.name}</View>
</View> </View>
); );
})} })}
</View> </View>
<View className='testing_content'> <View className="testing_content">
<View className='progress_box flex aitems'> <View className="progress_box flex aitems">
<View className='title'> <View className="title">
{stepList[stepIndex].name + "水分测试"} {stepList[stepIndex].name + "水分测试"}
</View> </View>
{/* <view class='progress_block flex aitems'> */} {/* <view class='progress_block flex aitems'> */}
@ -87,22 +89,22 @@ function Index() {
style={{ style={{
width: "300rpx", width: "300rpx",
}} }}
percentage='80' percentage="80"
strokeWidth='14' strokeWidth="14"
showPivot={false} showPivot={false}
color='#C2E5F3' color="#C2E5F3"
></Progress> ></Progress>
{stepList[stepIndex].finish && 80 >= 99 ? ( {stepList[stepIndex].finish && 80 >= 99 ? (
<Image <Image
className='finish_img' className="finish_img"
src={require("@/img/finished.png")} src={require("@/img/finished.png")}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
) : ( ) : (
<Image <Image
className='finish_img' className="finish_img"
src={require("@/img/no-finish.png")} src={require("@/img/no-finish.png")}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
)} )}
{/* </view> */} {/* </view> */}
@ -110,7 +112,7 @@ function Index() {
{/* <view class='tips' wx:if='{{!finish}}'> */} {/* <view class='tips' wx:if='{{!finish}}'> */}
{/* 请参考视频指引,将仪器紧贴<text style='color: #000000'>额头区域</text> */} {/* 请参考视频指引,将仪器紧贴<text style='color: #000000'>额头区域</text> */}
{/* </view> */} {/* </view> */}
<View className='tips flex sb'> <View className="tips flex sb">
<View> <View>
{(testIndex == 1 || testIndex == 2 || testIndex == 4) && ( {(testIndex == 1 || testIndex == 2 || testIndex == 4) && (
@ -129,10 +131,9 @@ function Index() {
</View> </View>
</View> </View>
</View> </View>
</View> )}
</View>
</Block>
</Block>
); );
} }

@ -674,11 +674,8 @@ class Index extends Component<any, any> {
} }
// 0已绑定 1未绑定 2已解绑 // 0已绑定 1未绑定 2已解绑
if (instrumentInfo.bindingStatus === 0) { if (instrumentInfo.bindingStatus === 0) {
setTimeout(() => {
this.isBindingSerial();
}, 100);
let isBind = this.state.instrumentList.find( let isBind = this.state.instrumentList.find(
(item) => item.id === instrumentInfo.id (item) => item.id === instrumentInfo.instrumentId
); );
if (isBind) { if (isBind) {
msg("序列号已绑定"); msg("序列号已绑定");
@ -688,7 +685,6 @@ class Index extends Component<any, any> {
BeforeBindingErrorText: "序列号已被其他用户绑定", BeforeBindingErrorText: "序列号已被其他用户绑定",
}); });
} }
return; return;
} else if ( } else if (
instrumentInfo.bindingStatus === 1 || instrumentInfo.bindingStatus === 1 ||
@ -749,7 +745,7 @@ class Index extends Component<any, any> {
msg("绑定成功"); msg("绑定成功");
let obj = unbindingInstrumentList.find( let obj = unbindingInstrumentList.find(
(item) => item.id === instrumentInfo.id (item) => item.id === instrumentInfo.instrumentId
); );
if (obj) { if (obj) {
setStorageSync("instrument_detail", obj); setStorageSync("instrument_detail", obj);
@ -757,8 +753,8 @@ class Index extends Component<any, any> {
setTimeout(() => { setTimeout(() => {
// 绑定成功后,先查询设备介绍页,有数据则跳转,没数据则刷新已绑定数据 // 绑定成功后,先查询设备介绍页,有数据则跳转,没数据则刷新已绑定数据
this.getInstrumentIntroInfo(instrumentInfo.id); this.getInstrumentIntroInfo(instrumentInfo.instrumentId);
}, 1000); }, 500);
return; return;
} else if (data.code === 204) { } else if (data.code === 204) {
this.setState({ this.setState({
@ -780,9 +776,10 @@ class Index extends Component<any, any> {
let res = await InstrumentInfo.instructionInfo({ let res = await InstrumentInfo.instructionInfo({
instrumentId: id, instrumentId: id,
}); });
console.log("res", res);
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
go("/instrument/pages/instrument/intro??customBack=true&id=" + id); go("/instrument/pages/instrument/intro?customBack=true&id=" + id);
} else { } else {
this.bindingInstrumentList(); this.bindingInstrumentList();
} }
@ -804,8 +801,13 @@ class Index extends Component<any, any> {
if (data.code === 200) { if (data.code === 200) {
msg("换绑成功"); msg("换绑成功");
setTimeout(() => { setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(instrumentInfo)); let obj = this.state.unbindingInstrumentList.find(
this.getInstrumentIntroInfo(instrumentInfo.id); (item) => item.id === instrumentInfo.instrumentId
);
if (obj) {
setStorageSync("instrument_detail", obj);
}
this.getInstrumentIntroInfo(instrumentInfo.instrumentId);
}, 500); }, 500);
} }
}; };

Loading…
Cancel
Save