rongweikang 2 years ago
commit 9e201ad45e

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

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

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

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

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

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

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

Loading…
Cancel
Save