rongweikang 2 years ago
commit ab7e221405

@ -37,6 +37,11 @@ class App extends Component<PropsWithChildren> {
onError(error) { onError(error) {
console.log("error 错误捕获", error); console.log("error 错误捕获", error);
} }
onUnload() {
console.log("App onUnload");
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
}
// 对应 onShow // 对应 onShow
componentDidShow() {} componentDidShow() {}

@ -59,8 +59,10 @@ export const fr200DeviceControlCommand = {
/** /**
* '进入水分测试模式' = 'switchTestMode', * '进入水分测试模式' = 'switchTestMode',
* '启动水分测试模式' = 'startTestMode', * '启动水分测试模式' = 'startTestMode',
*
* face: "01", 面部 * face: "01", 面部
* eyes: "02", 脸部 * eyes: "02", 眼部
*
* nasolabialFold: "03", 法令纹 * nasolabialFold: "03", 法令纹
* mandibularLine: "04", 下颌线 * mandibularLine: "04", 下颌线
* led: "05", led * led: "05", led
@ -68,6 +70,7 @@ export const fr200DeviceControlCommand = {
* maskPenetration: "07",面膜促渗 * maskPenetration: "07",面膜促渗
* essence: "08", 精华模式 * essence: "08", 精华模式
* headLiftingPro: "09", 抬头纹Pro * headLiftingPro: "09", 抬头纹Pro
*
* neck: "0A", 颈纹 * neck: "0A", 颈纹
* partition: "11", 分区模式 废弃VM1001 * partition: "11", 分区模式 废弃VM1001
* ignore: "255", 不改变/无模式 * ignore: "255", 不改变/无模式

@ -86,6 +86,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
error, error,
isDisconnect, isDisconnect,
} = this.props; } = this.props;
console.log("data connection", data, data.bluetoothConnecting);
return ( return (
<Block> <Block>
@ -113,7 +114,16 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View> </View>
<View className="device-popup-content-box"> <View className="device-popup-content-box">
{!this.isImage(data.bluetoothConnecting) ? ( {!this.isImage(data.bluetoothConnecting) ? (
<Video className="videos" src={data.bluetoothConnecting} /> <Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={encodeURIComponent(data.bluetoothConnecting)}
/>
) : ( ) : (
<Image <Image
className="images" className="images"
@ -199,7 +209,16 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View> </View>
<View className="device-popup-content-box"> <View className="device-popup-content-box">
{!this.isImage(data.bluetoothClosed) ? ( {!this.isImage(data.bluetoothClosed) ? (
<Video className="videos" src={data.bluetoothClosed} /> <Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={data.bluetoothClosed}
/>
) : ( ) : (
<Image <Image
className="images" className="images"
@ -239,7 +258,16 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View> </View>
<View className="device-popup-content-box"> <View className="device-popup-content-box">
{!this.isImage(data.bluetoothConnectFail) ? ( {!this.isImage(data.bluetoothConnectFail) ? (
<Video className="videos" src={data.bluetoothConnectFail} /> <Video
className="videos"
autoplay
loop
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
playBtnPosition="center"
src={data.bluetoothConnectFail}
/>
) : ( ) : (
<Image <Image
className="images" className="images"

@ -71,11 +71,12 @@ export default class Index extends Component {
console.log("url", url); console.log("url", url);
this.setSelected(index); this.setSelected(index);
if (url === "pages/index/index") { Taro.switchTab({ url: "/" + url });
Taro.reLaunch({ url: "/" + url }); // if (url === "pages/index/index") {
} else { // Taro.reLaunch({ url: "/" + url });
Taro.switchTab({ url: "/" + url }); // } else {
} // Taro.switchTab({ url: "/" + url });
// }
} }
setSelected(idx: number) { setSelected(idx: number) {

@ -4,6 +4,15 @@ import { Component, PropsWithChildren, useEffect, useState } from "react";
// import { InstrumentInfo } from "../../utils/Interface"; // import { InstrumentInfo } from "../../utils/Interface";
/*** redux ***/
import { connect } from "react-redux";
import {
setInstrument,
setSerial,
setInstrumentName,
} from "@/store/features/instrument";
/*** redux end ***/
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
// 引入 Swiper, SwiperItem 组件 // 引入 Swiper, SwiperItem 组件
import { import {
@ -32,7 +41,7 @@ import NoDataComponent from "@/components/base/nodata";
import "./instrument.less"; import "./instrument.less";
export default class Instrument extends Component<any, any> { class Instrument extends Component<any, any> {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
@ -283,6 +292,7 @@ export default class Instrument extends Component<any, any> {
let instrumentInfo = data.data; let instrumentInfo = data.data;
// 更新扫码进入仪器信息 // 更新扫码进入仪器信息
this.setState({ instrumentInfo: instrumentInfo }); this.setState({ instrumentInfo: instrumentInfo });
this.props.setInstrument(instrumentInfo);
} }
}; };
/**删除扫码缓存*/ /**删除扫码缓存*/
@ -301,7 +311,6 @@ export default class Instrument extends Component<any, any> {
let res = await InstrumentInfo.isBindingSerial({ let res = await InstrumentInfo.isBindingSerial({
serial: instrumentInfo.serial, serial: instrumentInfo.serial,
}); });
console.log("isBindingSerial", res);
if (res.data.code === 201) { if (res.data.code === 201) {
// 绑定 // 绑定
this.setState({ isExchangeBinding: false, isVisibleBinding: true }); this.setState({ isExchangeBinding: false, isVisibleBinding: true });
@ -324,6 +333,7 @@ export default class Instrument extends Component<any, any> {
let { channelInfo } = this.state; let { channelInfo } = this.state;
await this.getInstrumentInfoBySerial(channelInfo.serialCode); await this.getInstrumentInfoBySerial(channelInfo.serialCode);
let res = await InstrumentInfo.manualCodeBinding({ let res = await InstrumentInfo.manualCodeBinding({
serial: channelInfo.serialCode, serial: channelInfo.serialCode,
serialImage: channelInfo.serialImage, serialImage: channelInfo.serialImage,
@ -334,7 +344,12 @@ export default class Instrument extends Component<any, any> {
let code = Number(res.code); // 强制类型转换 let code = Number(res.code); // 强制类型转换
setTimeout(() => { setTimeout(() => {
if (code === 200) { if (code === 200) {
this.openBindingVisible(); // this.openBindingVisible();
msg("绑定成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
} else if (code === 202) { } else if (code === 202) {
this.changeBindBox(); this.changeBindBox();
} else if (code === 203) { } else if (code === 203) {
@ -364,15 +379,12 @@ export default class Instrument extends Component<any, any> {
Taro.hideLoading(); Taro.hideLoading();
let code = Number(res.data.code); let code = Number(res.data.code);
console.log("scanCodeBinding code", code);
setTimeout(() => { setTimeout(() => {
console.log("scanCodeBinding code", code, code === 204);
if (code === 200) { if (code === 200) {
msg("绑定成功"); Taro.setStorageSync("isScan", true);
setTimeout(() => { Taro.setStorageSync("serial", channelInfo.serialCode);
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); Taro.switchTab({ url: "/pages/index/index" });
go("/instrument/pages/instrument/intro?id=" + channelInfo.id); // this.openBindingVisible();
}, 1000);
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
this.changeBindBox(); this.changeBindBox();
} else if (res.data.code === 203) { } else if (res.data.code === 203) {
@ -401,10 +413,10 @@ export default class Instrument extends Component<any, any> {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ isVisibleBinding: false }); this.setState({ isVisibleBinding: false });
msg("绑定成功"); msg("绑定成功");
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
setTimeout(() => { setTimeout(() => {
go("/instrument/pages/instrument/intro?id=" + channelInfo.id); setStorageSync("instrument_detail", JSON.stringify(channelInfo));
}, 1000); this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
this.changeBindBox(); this.changeBindBox();
} else if (res.data.code === 203) { } else if (res.data.code === 203) {
@ -431,6 +443,24 @@ export default class Instrument extends Component<any, any> {
this.closeBinding(); this.closeBinding();
if (data.code === 200) { if (data.code === 200) {
msg("换绑成功"); msg("换绑成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo));
this.getInstrumentIntroInfo(channelInfo.id);
}, 500);
}
};
/** 获取设备介绍页信息:绑定判断是否存在介绍信息,如果存在则跳转,不存在则回到首页 */
getInstrumentIntroInfo = async (id) => {
let res = await InstrumentInfo.instructionInfo({
instrumentId: id,
});
if (res.data.code === 200) {
if (res.data.data.length > 0) {
go("/instrument/pages/instrument/intro??customBack=true&id=" + id);
} else {
Taro.switchTab({ url: "/pages/index/index" });
}
} }
}; };
@ -470,7 +500,7 @@ export default class Instrument extends Component<any, any> {
} }
customBack = () => { customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
// 打开绑定弹窗 // 打开绑定弹窗
@ -772,3 +802,19 @@ export default class Instrument extends Component<any, any> {
); );
} }
} }
const mapStateToProps = (state) => ({
storeInstrument: state.instrument,
});
const mapDispatchToProps = (dispatch) => ({
setSerial(data) {
dispatch(setSerial(data));
},
setInstrumentName(data) {
dispatch(setInstrumentName(data));
},
setInstrument(data) {
dispatch(setInstrument(data));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Instrument);

@ -132,7 +132,7 @@ class Intro extends Component<any, any> {
customBack = () => { customBack = () => {
let customBack = this.$instance.router?.params?.customBack; let customBack = this.$instance.router?.params?.customBack;
if (customBack) { if (customBack) {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
return; return;
} }
back(); back();

@ -2,6 +2,7 @@ import Taro from "@tarojs/taro";
import dayjs from "dayjs"; import dayjs from "dayjs";
import classnames from "classnames"; import classnames from "classnames";
import { debounce } from "lodash"; import { debounce } from "lodash";
// eslint-disable-next-line import/no-named-as-default // eslint-disable-next-line import/no-named-as-default
import React, { import React, {
Component, Component,
@ -10,7 +11,7 @@ import React, {
useState, useState,
} from "react"; } from "react";
// import Echarts from "./components/Echart/index"; import Echarts from "./components/Echart/index";
import Gears from "./components/Gears/index"; import Gears from "./components/Gears/index";
import { import {
Block, Block,
@ -40,8 +41,8 @@ import ConnectionBluetoot from "@/components/bluetoot/connection";
/* 本页组件 */ /* 本页组件 */
import ElectricityView from "./components/ElectricityView/index"; import ElectricityView from "./components/ElectricityView/index";
import ModeListView from "./components/ModeList/FR200"; import ModeListView from "./components/ModeList/FR200";
import ModeContent from "./components/ModeContent/FR200";
import Footer from "./components/Footer/FR200"; import Footer from "./components/Footer/FR200";
import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */ /* 本页组件 END */
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI"; import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
@ -66,7 +67,482 @@ 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;
@ -86,20 +562,7 @@ const MODE_WORKING_ENUM = {
}; };
// 不同模式启动前的倒计时时间 // 不同模式启动前的倒计时时间
let CountDownTime = { let CountDownTime = {};
powerfulSoothing: 6,
Stability: 3,
Brighten: 3,
FirmSkin: 3,
MaskCustom: 6,
BrightenStand: 6,
FirmSkinStand: 6,
SmallpoxSoothingPro: 6,
SmallpoxSoothing: 4,
MixNursePro: 6,
MixNurse: 4,
ScalpCare: 6,
};
let DeviceSyncData = { let DeviceSyncData = {
totalWorkingMinutes: 0, totalWorkingMinutes: 0,
@ -145,7 +608,7 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 连接设备 End */ /** 连接设备 End */
/** 护理过程 */ /** 护理过程 */
isStandStatus: false, // 当前模式是否舱体/支架模式 isRuningTest: false, // 是否正在测试
isShowStepTips: false, // 是否显示介绍步骤弹窗 isShowStepTips: false, // 是否显示介绍步骤弹窗
isConnectionBlutoot: true, // 是否已连接蓝牙 isConnectionBlutoot: true, // 是否已连接蓝牙
isShowNurse: true, // 是否开始并显示护理 FR200默认已经开始准备护理 isShowNurse: true, // 是否开始并显示护理 FR200默认已经开始准备护理
@ -197,8 +660,6 @@ class IotCarePlanFR200 extends Component<any, any> {
// 上一次护理记录未生成,是否继续连接设备 // 上一次护理记录未生成,是否继续连接设备
isShowReReadRecordConnect: false, isShowReReadRecordConnect: false,
// 按钮是否不可运行:FR200不可禁用
isFooterBtnDisabled: false,
// isFirstEntryMode: false, // 模式首次打开 // isFirstEntryMode: false, // 模式首次打开
isShowHistoryMsg: false, // 是否显示正在同步历史 isShowHistoryMsg: false, // 是否显示正在同步历史
@ -227,7 +688,7 @@ class IotCarePlanFR200 extends Component<any, any> {
pointOutChangeSide: false, // 交叉输出点 pointOutChangeSide: false, // 交叉输出点
impedance: 107, // 阻抗/能量等级1档<200 200<2档<280 280<3档<360 后面以此类推每加一档+80抗阻 impedance: 107, // 阻抗/能量等级1档<200 200<2档<280 280<3档<360 后面以此类推每加一档+80抗阻
}; };
// 1档 等于0<200,2档等于200<280,3档等于280<360
/** FR200模式类型名称 */ /** FR200模式类型名称 */
ModeTypeArray: string[] = [ ModeTypeArray: string[] = [
"all", "all",
@ -377,7 +838,6 @@ class IotCarePlanFR200 extends Component<any, any> {
isConnectionBlutoot: false, // 断开蓝牙 isConnectionBlutoot: false, // 断开蓝牙
// isShowCountdown: false, // 关闭倒计时,防止倒计时还在运行 // isShowCountdown: false, // 关闭倒计时,防止倒计时还在运行
}); });
this.footerIsDisabled();
}; };
GetModeList = async (id) => { GetModeList = async (id) => {
@ -491,10 +951,15 @@ class IotCarePlanFR200 extends Component<any, any> {
// 开发中,暂时允许直接切换 // 开发中,暂时允许直接切换
// 每次切换模式时清空一下历史数据 // 每次切换模式时清空一下历史数据
this.changeItemUpdateFR200NursingHistory(); this.changeItemUpdateFR200NursingHistory();
this.stepNext(); // 如果切换模式,则不执行开始逻辑 this.stepNext(); // 仅切换模式,不执行开始逻辑
setTimeout(() => {
this.onNursingTap("switch"); // FR200水分测试不可自动运行需手动点击开始测试手动启动检测
}, 800); // 其他模式可以自动运行
if (data.modeType !== "moistureTest") {
setTimeout(() => {
this.onNursingTap("switch");
}, 800);
}
}; };
/** 设备运行中切换模式 */ /** 设备运行中切换模式 */
modeRuningChange() { modeRuningChange() {
@ -592,9 +1057,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
/** 开始护理按钮:点击开始,页面进行到下一步 */ /** 开始护理按钮:点击开始,页面进行到下一步 */
onStartNurse = async () => { onStartNurse = async () => {
// 如果检查通过,可运行,则执行下一步 this.stepNext();
if (!this.footerIsDisabled()) {
this.stepNext();
setTimeout(() => { setTimeout(() => {
this.onNursingTap(); this.onNursingTap();
@ -603,8 +1066,6 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showCountdownFun(downNum, () => { }); this.showCountdownFun(downNum, () => { });
}, 500); }, 500);
return;
}
// 如果检查失败,则报错 // 如果检查失败,则报错
this.onEmitErrorTips(); this.onEmitErrorTips();
}; };
@ -618,10 +1079,7 @@ class IotCarePlanFR200 extends Component<any, any> {
let { ActiveModeItem } = this.state; let { ActiveModeItem } = this.state;
// 按钮不可点击时,提示报错 // 按钮不可点击时,提示报错
let isDisabled = this.footerIsDisabled(); this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
if (isDisabled) {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
}
}); });
}; };
@ -1244,7 +1702,7 @@ class IotCarePlanFR200 extends Component<any, any> {
*/ */
onNursingTap(type = "") { onNursingTap(type = "") {
// 如果已禁止运行,则停止执行后续逻辑 // 如果已禁止运行,则停止执行后续逻辑
if (this.state.isFooterBtnDisabled) return; if (this.state.isRuningTest) return;
// 防止多次点击 // 防止多次点击
if (this.state.hadClickStart) return; if (this.state.hadClickStart) return;
this.setState({ this.setState({
@ -1372,22 +1830,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.workJsonStatus.workMode this.workJsonStatus.workMode
); );
this.setState({
isFooterBtnDisabled: false,
});
if (this.workJsonStatus.workMode) { if (this.workJsonStatus.workMode) {
// FR200可能要判断是否水分测试 Test // FR200可能要判断是否水分测试 Test
console.log("this.workJsonStatus.workMode", this.workJsonStatus.workMode); // console.log("现在运行的模式:", this.workJsonStatus.workMode);
if (this.workJsonStatus.workMode.indexOf("Stand") > -1) {
console.log(
"this.workJsonStatus.workMode",
this.workJsonStatus.workMode
);
this.setState({
isStandStatus: true,
});
setTimeout(() => this.footerIsDisabled(), 100);
}
} }
// 2.判断是否已存在缓存的护理记录:如果没有历史,则缓存 // 2.判断是否已存在缓存的护理记录:如果没有历史,则缓存
@ -1501,6 +1946,7 @@ class IotCarePlanFR200 extends Component<any, any> {
/** 获取小程序本地缓存的历史记录 */ /** 获取小程序本地缓存的历史记录 */
getFR200NursingHistory() { getFR200NursingHistory() {
this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
console.log(this.FR200NursingHistory, '获取本地数据++++++++++++++++++++++++++++++++++++++++++');
// 是否同步历史记录 // 是否同步历史记录
let isSyncHistory = Taro.getStorageSync("isSyncHistory"); let isSyncHistory = Taro.getStorageSync("isSyncHistory");
@ -1604,14 +2050,107 @@ class IotCarePlanFR200 extends Component<any, any> {
Taro.removeStorageSync("FR200NursingHistory"); Taro.removeStorageSync("FR200NursingHistory");
}; };
todoPromise = () => { // todoPromise = () => {
return new Promise<void>((resolve, reject) => { // return new Promise<void>((resolve, reject) => {
setTimeout(() => { // setTimeout(() => {
resolve(); // resolve();
// });
// });
// };
// 脸部one
todoPromise = async () => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
// 护理脸部
if (nowFR200NursingHistory.workMode === 'face') {
// 把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 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 min: any = Math.min(...filtered.map(item => item.impedance));
min = this.determineTier(min)
// 平均数最大等级处于2
let average: any = max / 2
average = this.determineTier(average)
// 能量图里面的图谱每10秒为一个数组
// 创建一个空数组用于存储分组后的结果
// 创建一个空数组用于存储分组后的结果
let groupedAa: any[] = [];
// 使用循环遍历数组 aa
for (let i = 0; i < filtered.length; i += 10) {
// 提取每组的三个对象
let group = filtered.slice(i, i + 10);
// 找到组中最大的 name 值
let maxName = Math.max(...group.map(obj => obj.impedance));
// 计算并存储每组的平均数
let average:any = this.determineTier(maxName / 2);
// let average = maxName / 2;
if(average >=1) {
average=average-1
average=average *10
}
// 将包含该组对象和平均数的对象添加到 groupedAa 数组中
groupedAa.push(average);
}
let nursingData = {
// nursingTime:result,
nursingData: JSON.stringify({
faceEnergy, max, min, average, groupedAa, filtered: filtered.length, workMode: nowFR200NursingHistory.workMode
})
}
return nursingData
} else {
let GearData = this.state.GearData;
// 肌肤报告
let Allnum = 0
GearData.forEach(e => {
Allnum = +e.forehead
}); });
}); // 向下取整
}; Allnum = Math.floor(Allnum / 3);
let nursingData = {
nursingData: JSON.stringify({
Allnum, GearData
})
}
return nursingData
}
}
// 计算挡位
determineTier = (sun) => {
// 定义每档的范围
const tiers = [0, 200, 280, 360, 440, 520, 600, 680, 760, 840];
// 遍历每一档的范围,找到 sun 所属的档
for (let i = 0; i < tiers.length; i++) {
if (sun < tiers[i + 1]) {
return i + 1;
}
}
// 如果 sun 不在任何一档范围内,返回默认档或处理错误
return '10';
}
/** 提交护理记录:完成护理后自动调用,会跳转页面 */ /** 提交护理记录:完成护理后自动调用,会跳转页面 */
PostNursingLogClock = async (data: any = null, isJump = true) => { PostNursingLogClock = async (data: any = null, isJump = true) => {
// todo 建议写一个Promise异步函数用 await 执行,在提交前处理好数据 // todo 建议写一个Promise异步函数用 await 执行,在提交前处理好数据
@ -1622,15 +2161,19 @@ 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()
console.log(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) {
@ -1650,7 +2193,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({ this.setState({
isShowNursingSuccess: false, isShowNursingSuccess: false,
}); });
this.goFaceReport(); // 跳转
this.goFaceReport(res1, ActiveModeItem.id); // 跳转
}, 2000); }, 2000);
} }
} }
@ -1806,10 +2351,31 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
/** 完成护理提交:跳转护理报告页 */ /** 完成护理提交:跳转护理报告页 */
goFaceReport = () => { goFaceReport = (data, id) => {
let nursingData = JSON.parse(data.nursingData)
// 跳转前置空定时器,防止重复提交 // 跳转前置空定时器,防止重复提交
if (currentTimeTimer) clearInterval(currentTimeTimer); if (currentTimeTimer) clearInterval(currentTimeTimer);
go("/pages/face_report/face_report?id=" + this.state.currentDevice.id); if (['face', 'eyes', 'nasolabialFold', 'mandibularLine', 'headLiftingPro'].includes(nursingData.workMode)) {
let obj = {
modeName: nursingData.modeName,
data: nursingData
}
let report = true;
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
id +
"&report=" +
report + "&obj=" +
JSON.stringify(obj)
);
} else if ('moistureTest' === nursingData.workMode) {
console.log('水分测试');
} else {
go("/pages/face_report/face_report?id=" + this.state.currentDevice.id);
}
}; };
// 完成配对 // 完成配对
@ -1826,7 +2392,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({ this.setState({
isConnectShow: false, isConnectShow: false,
}); });
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
// 手动护理模式切换:提示是否保存护理 // 手动护理模式切换:提示是否保存护理
@ -1887,24 +2453,8 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
/** 初次护理信息弹窗 END */ /** 初次护理信息弹窗 END */
/**
* @name
* @description
* @returns true
*/
footerIsDisabled = () => {
// 默认不禁用FR200无法禁用
let isFooterBtnDisabled = false;
// this.setState({
// isFooterBtnDisabled: isFooterBtnDisabled,
// });
return isFooterBtnDisabled; // 数据更新有延迟,返回用于判断
};
customBack = () => { customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
onModeLockOpen = async () => { onModeLockOpen = async () => {
@ -1948,7 +2498,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isFirstTipShow, isFirstTipShow,
nurseInfo, nurseInfo,
isShowReReadRecordSave, isShowReReadRecordSave,
isFooterBtnDisabled, isRuningTest,
isShowHistoryMsg, isShowHistoryMsg,
isModeLock, isModeLock,
} = this.state; } = this.state;
@ -2181,30 +2731,30 @@ class IotCarePlanFR200 extends Component<any, any> {
/> />
)} )}
{ActiveModeItem.combineData && ( {(ActiveModeItem.modeType === "face" ||
<ModeContent ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>}
isShowNurse={isShowNurse}
ActiveModeItem={ActiveModeItem} {(ActiveModeItem.modeType === "maskPenetration" ||
ModeStepIndex={ModeStepIndex} ActiveModeItem.modeType === "essence") && (
/> <Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
)} )}
{/* <Echarts></Echarts> */} {ActiveModeItem.modeType === "moistureTest" && (
<Gears <WaterTest></WaterTest>
onEmitMinus={this.handleMinus} )}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
</View> </View>
<Footer <Footer
isDisabled={isFooterBtnDisabled} currentWorkMode={ActiveModeItem.modeType}
isShowNurse={isShowNurse} isRuningTest={isRuningTest}
isStopNurse={isStopNurse} isStopNurse={isStopNurse}
onEmitStartNurse={this.onStartNurse} onEmitStartNurse={this.onStartNurse}
onEmitSwitchChange={this.onSwitchChange} onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan} onEmitEndPlan={this.onEndPlan}
onEmitErrorTips={this.onEmitErrorTips}
/> />
</View> </View>
</Block> </Block>

@ -1945,7 +1945,7 @@ class IotCarePlanWL200 extends Component<any, any> {
this.setState({ this.setState({
isConnectShow: false, isConnectShow: false,
}); });
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
// 手动护理模式切换:提示是否保存护理 // 手动护理模式切换:提示是否保存护理
@ -2056,7 +2056,7 @@ class IotCarePlanWL200 extends Component<any, any> {
console.log("出发", e); console.log("出发", e);
}; };
customBack = () => { customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
onModeLockOpen = async () => { onModeLockOpen = async () => {

@ -9,13 +9,32 @@ import echarts from "@/utils/echarts.min.js";
import "./index.less"; import "./index.less";
interface Props { interface Props {
Electricity: any; EchartsData:any
matrixElectricity: any;
facialMaskConnectStatus: any;
} }
function Index() { function Index({
EchartsData
}:Props) {
let type =0
switch(EchartsData.modeName) {
case '基础班脸部':
type=37
break;
case '基础版眼部':
type=25
break;
case '法令纹Pro':
type=25
break;
case '下颌线Pro':
type=19
break;
case '抬头纹Pro':
type=13
break;
default:
}
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) { function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor); var startRGB = hexToRgb(startColor);
@ -50,49 +69,38 @@ function Index() {
const startColor = "#FFFF00"; // 黄色 const startColor = "#FFFF00"; // 黄色
const endColor = "#FF0000"; // 红色 const endColor = "#FF0000"; // 红色
const steps = 80; // 80个颜色 const steps = 81; // 80个颜色
const colors = generateColorArray(startColor, endColor, steps); const colors = generateColorArray(startColor, endColor, steps);
const xList = [...new Array(61).fill(0).map((item, key) => key)]; const xList = [...new Array(type).fill(0).map((item, key) => key)];
const seriesData = [ let seriesData:any =[]
...xList.map((item) => { seriesData = EchartsData?.data?.groupedAa
return Math.random() * 80; // const xList = [...new Array(37).fill(0).map((item, key) => key)];
}), // const seriesData = [
]; // ...xList.map((item) => {
// let seriesData=[ // return Math.random() * 80;
// 1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3, // }),
// 1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3, // ];
// 1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 const option: EChartOption ={
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 grid: {
// ,1,2,2,3,3,4,5,1,2,3,4,2,8,5,1,2,3, // 让图表占满容器
// 1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 top: "10rpx",
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 left: "45rpx",
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 right: "28rpx",
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 bottom: "17rpx",
// ,1,2,2,3,3,4,5,1,2,3,4,2,3,5,1,2,3 },
// ] xAxis: {
// console.log(seriesData,'seriesData',xList); type: "category",
data: [...xList],
const option: EChartOption = { axisLabel: {
grid: { interval: 5,
// 让图表占满容器 formatter: function (value, index) {
top: "10rpx", return value * 10 + 's';
left: "35rpx", },
right: "28rpx", textStyle: {
bottom: "17rpx",
},
xAxis: {
type: "category",
data: [...xList],
axisLabel: {
interval: 9,
formatter: function (value, index) {
return value * 6 + 's';
},
textStyle: {
color: '#999999', // 文字颜色 color: '#999999', // 文字颜色
fontSize: 8 // 文字大小 fontSize: 8 // 文字大小
}, },
@ -168,7 +176,7 @@ function Index() {
// isPage={false} // isPage={false}
// style自定义设置echarts宽高 // style自定义设置echarts宽高
// style={{ width: "100%", height: "100%" }} // style={{ width: "100%", height: "100%" }}
style={{ width: "630rpx", height: "260rpx" }} style={{ width: "670rpx", height: "260rpx" }}
/> />
{/* <View className="box"> {/* <View className="box">

@ -2,115 +2,72 @@ import { Block, View, Image, Text, CoverView } from "@tarojs/components";
import "./FR200.less"; import "./FR200.less";
interface Props { interface Props {
isShowNurse: boolean; // isShowNurse: boolean;
currentWorkMode: string; // 当前工作模式
isStopNurse: boolean; isStopNurse: boolean;
isDisabled: boolean; // 是否禁用开始暂停按钮:模式与连接设备是否一致 isRuningTest: boolean; // 是否在运行测试
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件 onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
onEmitSwitchChange: Function; onEmitSwitchChange: Function;
onEmitEndPlan: Function; onEmitEndPlan: Function;
onEmitErrorTips: Function; // 不可点击,提示错误
} }
function Index({ function Index({
isShowNurse, currentWorkMode,
isStopNurse, isStopNurse,
isDisabled, isRuningTest,
onEmitStartNurse, onEmitStartNurse,
onEmitSwitchChange, onEmitSwitchChange,
onEmitEndPlan, onEmitEndPlan,
onEmitErrorTips,
}: Props) { }: Props) {
const onStartNurse = () => { const onStartNurse = () => {
onEmitStartNurse(); onEmitStartNurse();
}; };
const onSwitchChange = () => { const onSwitchChange = () => {
if (!isDisabled) { onEmitSwitchChange();
onEmitSwitchChange();
}
}; };
const onEndPlan = () => { const onEndPlan = () => {
onEmitEndPlan(); onEmitEndPlan();
}; };
const onErrorTips = () => {
onEmitErrorTips();
};
return ( return (
<Block> <Block>
<View className="iot-footer"> <View className="iot-footer">
{!isShowNurse && ( {currentWorkMode === "moistureTest" && (
<Block> <Block>
{isDisabled ? ( {!isRuningTest ? (
<View className="btn btn-disable" onClick={onStartNurse}> <View className="btn " onClick={onStartNurse}>
</View> </View>
) : ( ) : (
<View className="btn" onClick={onStartNurse}> <View className="btn">...</View>
</View>
)} )}
</Block> </Block>
)} )}
{isShowNurse && ( {currentWorkMode !== "moistureTest" && (
<View className="switch-btn-box"> <View className="switch-btn-box">
{!isDisabled && ( <View className="btn-item border-right" onClick={onSwitchChange}>
<View className="btn-item border-right" onClick={onSwitchChange}> {isStopNurse ? (
{isStopNurse ? ( <Block>
<Block> <Image
<Image className="btn-icon"
className="btn-icon" src={require("@/img/iot/start_nurse.png")}
src={require("@/img/iot/start_nurse.png")} mode="aspectFill"
mode="aspectFill" />
/> <Text className="btn-text"></Text>
<Text className="btn-text"></Text> </Block>
</Block> ) : (
) : ( <Block>
<Block> <Image
<Image className="btn-icon"
className="btn-icon" src={require("@/img/iot/pause_nurse.png")}
src={require("@/img/iot/pause_nurse.png")} mode="aspectFill"
mode="aspectFill" />
/> <Text className="btn-text"></Text>
<Text className="btn-text"></Text> </Block>
</Block> )}
)} </View>
</View>
)}
{isDisabled && (
<View
className="btn-item border-right btn-disable"
onClick={onErrorTips}
>
{isStopNurse ? (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("@/img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
) : (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("@/img/iot/pause_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
)}
</View>
)}
<View className="btn-item" onClick={onEndPlan}> <View className="btn-item" onClick={onEndPlan}>
<Image <Image

@ -41,7 +41,7 @@ export default class Consultant extends Component<any, any> {
customBack = () => { customBack = () => {
let customBack = this.$instance.router?.params?.customBack; let customBack = this.$instance.router?.params?.customBack;
if (customBack) { if (customBack) {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
return; return;
} }
back(); back();

@ -75,7 +75,7 @@ class Entry extends Component<any, any> {
let detail = JSON.parse(MpSplashDetail_type1); let detail = JSON.parse(MpSplashDetail_type1);
let list = detail.filter((item: any) => item.fileSuffix === "images"); let list = detail.filter((item: any) => item.fileSuffix === "images");
if (list.length === 0) { if (list.length === 0) {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
return; return;
} }
let welcomeList = list.map((item) => { let welcomeList = list.map((item) => {
@ -87,7 +87,7 @@ class Entry extends Component<any, any> {
}); });
this.setState({ welcomeList }); this.setState({ welcomeList });
} else { } else {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
} }
} }
@ -114,7 +114,7 @@ class Entry extends Component<any, any> {
} }
} }
toHomePage() { toHomePage() {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
} }
onFinish(event) { onFinish(event) {

@ -1,4 +1,5 @@
import classnames from "classnames"; import classnames from "classnames";
setSerial;
import dayjs from "dayjs"; import dayjs from "dayjs";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import { Component } from "react"; import { Component } from "react";
@ -16,6 +17,11 @@ import { Popup } from "@antmjs/vantui";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userRefresh, tokenRefresh } from "@/store/features/userInfo"; import { userRefresh, tokenRefresh } from "@/store/features/userInfo";
import { setIndexFlag } from "@/store/features/globalStore"; import { setIndexFlag } from "@/store/features/globalStore";
import {
setInstrument,
setSerial,
setInstrumentName,
} from "@/store/features/instrument";
/*** redux end ***/ /*** redux end ***/
/** 自定义组件 **/ /** 自定义组件 **/
@ -59,8 +65,6 @@ import {
// const log = require("@/utils/log"); // const log = require("@/utils/log");
class Index extends Component<any, any> { class Index extends Component<any, any> {
$instance: any = Taro.getCurrentInstance();
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
@ -117,10 +121,10 @@ class Index extends Component<any, any> {
createBy: null, createBy: null,
createTime: "2024-01-19 17:46:10", createTime: "2024-01-19 17:46:10",
exportFields: [], exportFields: [],
id: 4, id: 0,
instrumentId: 82, instrumentId: 0,
instrumentIdArray: null, instrumentIdArray: null,
instrumentName: "研发测试FR380", instrumentName: "",
instrumentSerialIdList: [], instrumentSerialIdList: [],
queryInstrumentIds: null, queryInstrumentIds: null,
remark: null, remark: null,
@ -154,9 +158,28 @@ class Index extends Component<any, any> {
}; };
} }
async onLoad() { async onLoad(options) {
console.log("onLoad options", options);
if (options) {
if (options?.q) {
Taro.setStorageSync("isScan", true);
let url = options.q;
let _url = decodeURIComponent(url);
if (_url.indexOf("?")) {
let ids = _url.split("?");
if (ids.length > 1) {
let serial = ids[1];
Taro.setStorageSync("serial", serial);
}
}
console.log("Taro.getCurrentInstance()", Taro.getCurrentInstance());
Taro.reLaunch({ url: "/pages/index/index" }); // 链接扫码进入需要清空router重置地址栏参数防止bug
}
}
// 仅非扫码进入页面时,校验跳转欢迎页 // 仅非扫码进入页面时,校验跳转欢迎页
if (!this.$instance.router?.params?.q) { let $instance: any = Taro.getCurrentInstance();
console.log("$instance", $instance);
if (!$instance.router?.params?.q) {
const isFirst = Taro.getStorageSync("isWelcome"); const isFirst = Taro.getStorageSync("isWelcome");
if (!isFirst) { if (!isFirst) {
go("/pages/initiate/initiate"); go("/pages/initiate/initiate");
@ -168,20 +191,22 @@ class Index extends Component<any, any> {
componentWillUnmount() { componentWillUnmount() {
// 页面卸载监听 // 页面卸载监听
Taro.offAppHide((res) => {}); Taro.offAppHide((res) => {
this.$instance = null; console.log("页面卸载监听 offAppHide");
});
} }
componentDidShow() { componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.$instance.page);
tabbar?.setSelected(0);
console.log(
this.state.instrumentInfo,
"查看",
this.state.instrumentList,
Taro.getStorageSync("skipRegister")
);
const handleAsyncLogic = async () => { const handleAsyncLogic = async () => {
// tabbar icon切换
let $instance: any = Taro.getCurrentInstance();
const tabbar = Taro.getTabBar<CustomTabBar>($instance.page);
tabbar?.setSelected(0);
// 扫码仪器数据同步
this.setState({
instrumentInfo: this.props.storeInstrument,
});
// 判断是否跳过了注册 // 判断是否跳过了注册
if (Taro.getStorageSync("skipRegister")) { if (Taro.getStorageSync("skipRegister")) {
await this.EquipmentNo(); // 扫码序列号查询:注册后才调用,因为扫码未注册直接跳转注册页 await this.EquipmentNo(); // 扫码序列号查询:注册后才调用,因为扫码未注册直接跳转注册页
@ -189,7 +214,9 @@ class Index extends Component<any, any> {
Taro.removeStorageSync("skipRegister"); Taro.removeStorageSync("skipRegister");
} else { } else {
// 已注册且非跳过,正常执行逻辑 // 已注册且非跳过,正常执行逻辑
this.showInit(); setTimeout(() => {
this.showInit();
});
} }
}; };
handleAsyncLogic(); handleAsyncLogic();
@ -213,40 +240,13 @@ class Index extends Component<any, any> {
showInit = async () => { showInit = async () => {
// 判断是否登录 // 判断是否登录
this.$instance = Taro.getCurrentInstance();
let mobile = Taro.getStorageSync("mobile"); let mobile = Taro.getStorageSync("mobile");
if (mobile) { if (mobile) {
this.setState({ isRegisterBoolean: true }); this.setState({ isRegisterBoolean: true });
} }
// 非扫码进入小程序,需判断是否跳转欢迎页;扫码进入小程序,先缓存序列号,再检测隐私弹窗
let serial = Taro.getStorageSync("serial");
console.log(this.$instance, "2222", serial);
let url = this.$instance.router?.params?.q || "";
if (!url) {
// 非扫码或扫码已跳转的返回进入
const isFirst = Taro.getStorageSync("isWelcome");
if (isFirst || serial) {
// 如果是扫码进来的,不需要进入介绍页也弹鉴权弹窗
this.checkShowPrivacyPopup();
}
} else {
// 扫码进入
Taro.setStorageSync("isScan", true);
// 是否可以运行扫码逻辑:每次扫码后设为真,
Taro.setStorageSync("isScanRun", true);
if (url) {
let _url = decodeURIComponent(url);
if (_url.indexOf("?")) { // 直接检查隐私弹窗
let ids = _url.split("?"); this.checkShowPrivacyPopup();
if (ids.length > 1) {
let serial = ids[1];
Taro.setStorageSync("serial", serial);
}
}
}
this.checkShowPrivacyPopup();
}
}; };
// 检测是否弹出隐私协议 // 检测是否弹出隐私协议
@ -283,7 +283,6 @@ class Index extends Component<any, any> {
// 查看设备序号与仪器 // 查看设备序号与仪器
EquipmentNo = async () => { EquipmentNo = async () => {
let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存 let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存
let { data } = await InstrumentInfo.getInstrumentInfoBySerial({ let { data } = await InstrumentInfo.getInstrumentInfoBySerial({
serial: serial, serial: serial,
}); });
@ -292,6 +291,7 @@ class Index extends Component<any, any> {
let instrumentInfo = data.data; let instrumentInfo = data.data;
// 更新扫码进入仪器信息 // 更新扫码进入仪器信息
this.setState({ instrumentInfo: instrumentInfo }); this.setState({ instrumentInfo: instrumentInfo });
this.props.setInstrument(instrumentInfo);
// 1有效 0无效 // 1有效 0无效
// if (instrumentInfo.validStatus === 0) { // if (instrumentInfo.validStatus === 0) {
@ -341,13 +341,11 @@ class Index extends Component<any, any> {
// 防止逻辑出错没有token // 防止逻辑出错没有token
await this.onlyLogin(); await this.onlyLogin();
} }
console.log("initPageData", Taro.getStorageSync("serial"));
// 如果是扫码且已有token则跳转 // 如果是扫码且已有token则跳转
if (Taro.getStorageSync("serial")) { let serial = Taro.getStorageSync("serial");
console.log(mobile, "mobile"); if (serial) {
// 如果已注册绑定手机号不用跳转
if (!mobile) { if (!mobile) {
// 如果未注册绑定手机号,就去注册
setTimeout(() => { setTimeout(() => {
go("/pages/register/register"); go("/pages/register/register");
}, 300); }, 300);
@ -652,9 +650,12 @@ class Index extends Component<any, any> {
}; };
// 根据扫码的序列号获取仪器信息 // 根据扫码的序列号获取仪器信息
getInstrumentInfoBySerial = async () => { getInstrumentInfoBySerial = async () => {
let url = this.$instance.router?.params?.q || ""; let $instance: any = Taro.getCurrentInstance();
let url = $instance.router?.params?.q || "";
let isScan = Taro.getStorageSync("isScan"); // 判断是否扫码进入 let isScan = Taro.getStorageSync("isScan"); // 判断是否扫码进入
let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存 let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存
if (!serial) return;
if (url || isScan) { if (url || isScan) {
let { data } = await InstrumentInfo.getInstrumentInfoBySerial({ let { data } = await InstrumentInfo.getInstrumentInfoBySerial({
serial: serial, serial: serial,
@ -740,6 +741,7 @@ class Index extends Component<any, any> {
let { data } = await InstrumentInfo.binding({ let { data } = await InstrumentInfo.binding({
serial: instrumentInfo.serial, serial: instrumentInfo.serial,
}); });
console.log("bindingInstrument", data);
Taro.hideLoading(); Taro.hideLoading();
this.closeBinding(); this.closeBinding();
this.removeScanFun(); this.removeScanFun();
@ -773,13 +775,12 @@ class Index extends Component<any, any> {
} }
}; };
/** 获取设备介绍页信息 */ /** 获取设备介绍页信息:绑定判断是否存在介绍信息,如果存在则跳转,不存在则回到首页 */
getInstrumentIntroInfo = async (id) => { getInstrumentIntroInfo = async (id) => {
let res = await InstrumentInfo.instructionInfo({ let res = await InstrumentInfo.instructionInfo({
instrumentId: id, instrumentId: id,
}); });
if (res.data.code === 200) { if (res.data.code === 200) {
console.log("res.data.data", res.data.data);
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 {
@ -798,11 +799,14 @@ class Index extends Component<any, any> {
let { data } = await InstrumentInfo.exchangeBinding({ let { data } = await InstrumentInfo.exchangeBinding({
serial: instrumentInfo.serial, serial: instrumentInfo.serial,
}); });
console.log("exchangeBinding", data);
Taro.hideLoading(); Taro.hideLoading();
this.closeBinding(); this.closeBinding();
if (data.code !== 200) { if (data.code === 200) {
//todo msg("换绑成功");
setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(instrumentInfo));
this.getInstrumentIntroInfo(instrumentInfo.id);
}, 500);
} }
}; };
// 仪器绑定失败弹窗 // 仪器绑定失败弹窗
@ -840,8 +844,13 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页 // 跳转仪器介绍页
goNursing = (item) => { goNursing = (item) => {
console.log("connectInstrument", item);
// 仅开发者工具调试使用 // 仅开发者工具调试使用
const platform = Taro.getSystemInfoSync().platform; const platform = Taro.getSystemInfoSync().platform;
// setStorageSync("instrument_detail", item);
// this.setState({ connectInstrument: item });
// setTimeout(() => this.goIot());
// return;
if (platform === "devtools") { if (platform === "devtools") {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
@ -1444,6 +1453,7 @@ const mapStateToProps = (state) => ({
background: state.navigation.background, background: state.navigation.background,
mobile: state.userInfo.mobile, mobile: state.userInfo.mobile,
isShowIndexFlag: state.globalStore.isShowIndexFlag, isShowIndexFlag: state.globalStore.isShowIndexFlag,
storeInstrument: state.instrument,
}); });
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({
userRefresh(data) { userRefresh(data) {
@ -1455,6 +1465,14 @@ const mapDispatchToProps = (dispatch) => ({
setIndexFlag(data) { setIndexFlag(data) {
dispatch(setIndexFlag(data)); dispatch(setIndexFlag(data));
}, },
setSerial(data) {
dispatch(setSerial(data));
},
setInstrumentName(data) {
dispatch(setInstrumentName(data));
},
setInstrument(data) {
dispatch(setInstrument(data));
},
}); });
export default connect(mapStateToProps, mapDispatchToProps)(Index); export default connect(mapStateToProps, mapDispatchToProps)(Index);
// instrumentId

@ -52,12 +52,12 @@ class Register extends Component<any, any> {
onSkip = () => { onSkip = () => {
// 返回首页尽量清空路由记录,防止扫码参数bug扰乱逻辑 // 返回首页尽量清空路由记录,防止扫码参数bug扰乱逻辑
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
skipRegister() { skipRegister() {
// 跳过注册 // 跳过注册
Taro.setStorageSync("skipRegister", true); Taro.setStorageSync("skipRegister", true);
Taro.reLaunch({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
} }
onDisagreeTap = () => { onDisagreeTap = () => {
// 关闭小程序 // 关闭小程序

@ -23,7 +23,27 @@ page {
margin-bottom: 20rpx; margin-bottom: 20rpx;
margin-top: 32rpx; margin-top: 32rpx;
} }
.itemStyel{
display: inline-block;
font-size: 15rpx;
position: absolute;
top: 0rpx;
left: 94rpx;
}
.itemStyelone{
display: inline-block;
font-size: 15rpx;
position: absolute;
top: 0rpx;
left: 142rpx;
}
.itemStyeltwo{
display: inline-block;
font-size: 15rpx;
position: absolute;
top: 0rpx;
left: 278rpx;
}
.statistic_item { .statistic_item {
flex: 1; flex: 1;
border-right: 1rpx solid #dddddd; border-right: 1rpx solid #dddddd;
@ -73,15 +93,18 @@ page {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #000; color: #000;
padding-left: 16rpx;
// margin: 48rpx 0 34rpx; // margin: 48rpx 0 34rpx;
} }
.eacharts{ .eacharts{
// background-color: red; // background-color: red;
// margin-top: 14px; // margin-top: 14px;
margin: auto;
margin-bottom: 45rpx; margin-bottom: 45rpx;
/* margin: 52rpx 0rpx; */ /* margin: 52rpx 0rpx; */
width: 100%; width: 100%;
height: 247rpx; height: 247rpx;
// margin-left: 131rpx;
} }
.van-popup { .van-popup {
border-radius: 30rpx; border-radius: 30rpx;
@ -320,6 +343,7 @@ page {
margin: 12rpx 0rpx; margin: 12rpx 0rpx;
color: #181818; color: #181818;
font-weight: 700; font-weight: 700;
position: relative;
} }
// .desc:last-child { // .desc:last-child {

@ -17,6 +17,7 @@ import { InstrumentInfo } from "@/utils/Interface";
// 引入ecahrts图表 // 引入ecahrts图表
// import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face' // import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face'
import EchartsForm from '../../../moduleIOT/pages/iotCarePlan/components/Echart_face' import EchartsForm from '../../../moduleIOT/pages/iotCarePlan/components/Echart_face'
import Echarts1 from '../../../moduleIOT/pages/iotCarePlan/components/Echart'
/** 自定义组件 **/ /** 自定义组件 **/
@ -26,13 +27,19 @@ export default class Index extends Component<any, any> {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
face_Tyep: '基础脸部', EchartsData:{},
reportShow: true, reportShow: true,
name: "template模板页", name: "template模板页",
statistics: {}, statistics: {},
recordList: [], recordList: [],
modeImage: require("@/img/face-report/face.png"),
recordData: { recordData: {
modeImage: require("@/img/face-report/face.png") modeName: '基础班脸部',
filtered:111,
faceEnergy:222,
average:2222,
max:33,
min:7
}, },
year: new Date().getFullYear(), year: new Date().getFullYear(),
show: false, show: false,
@ -73,7 +80,7 @@ export default class Index extends Component<any, any> {
data["instrumentId"] = id; data["instrumentId"] = id;
} }
let res = await InstrumentInfo.apiNursingLog.getStatistics(data); let res = await InstrumentInfo.apiNursingLog.getStatistics(data);
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ statistics: res.data.data }); this.setState({ statistics: res.data.data });
} }
@ -246,8 +253,8 @@ export default class Index extends Component<any, any> {
const id = searchParams.get("id"); const id = searchParams.get("id");
const recordId = searchParams.get("recordId"); const recordId = searchParams.get("recordId");
this.getStatistics(id); this.getStatistics(id);
this.getRecord(id, recordId); // this.getRecord(id, recordId);
console.log(recordId); // console.log(recordId);
} }
getTime(time) { getTime(time) {
const hour = time.slice(0, 2); const hour = time.slice(0, 2);
@ -260,20 +267,52 @@ export default class Index extends Component<any, any> {
return minute + "分" + second + "秒"; return minute + "分" + second + "秒";
} }
} }
async onLoad(options) { onLoad(options) {
console.log(options, '查看传过来的参数');
let Bool = JSON.parse(options?.report) let Bool = JSON.parse(options?.report)
if (!Bool) { if (!Bool) {
this.setState({ this.setState({
reportShow: Bool reportShow: Bool
}) })
} }
this.init(options)
this.getRouteId(); this.getRouteId();
this.getClockStatistics() // this.getClockStatistics()
}
init(options){
let obj =JSON.parse(options.obj)
let recordData =this.state.recordData
let modeImage =this.state.modeImage
switch(obj.modeName) {
case '基础班脸部':
modeImage =require("@/img/face-report/face.png")
break;
case '基础版眼部':
modeImage =require("@/img/face-report/eye.png")
break;
case '法令纹Pro':
modeImage =require("@/img/face-report/nasolabial_Pro.png")
break;
case '下颌线Pro':
modeImage =require("@/img/face-report/Mandibular_Pro.png")
break;
case '抬头纹Pro':
modeImage =require("@/img/face-report/Head_lift_Pro.png")
break;
default:
}
recordData ={
...obj,
...obj.data
}
this.setState({recordData,modeImage,EchartsData:{...obj}})
console.log(obj,'查看');
} }
componentDidShow() { } componentDidShow() { }
componentDidHide() { } componentDidHide() { }
@ -285,7 +324,7 @@ export default class Index extends Component<any, any> {
}; };
render() { render() {
let { name, statistics, recordList, recordData, show, clockStatistics, punchInInfo, monthTime, reportShow, face_Tyep } = this.state; let { name, statistics, modeImage, recordData, show, clockStatistics, punchInInfo, monthTime, reportShow,EchartsData } = this.state;
return ( return (
<Block> <Block>
<Navbar isBack titleSlot='护理报告'></Navbar> <Navbar isBack titleSlot='护理报告'></Navbar>
@ -310,24 +349,24 @@ export default class Index extends Component<any, any> {
<View className='left'> <View className='left'>
<Image <Image
className='cover' className='cover'
src={recordData.modeImage} src={modeImage}
mode='aspectFill' mode='aspectFill'
></Image> ></Image>
<View className='face_type'>{face_Tyep}</View> <View className='face_type'>{recordData.modeName}</View>
</View> </View>
<View className='content'> <View className='content'>
<View className='content_top'> <View className='content_top'>
<View className='desc_box'> <View className='desc_box'>
<View className='desc'>{recordData.modeName}</View> <View className='desc'>{recordData.modeName === '下颌线Pro'?<View className="itemStyel">[1]</View>:null}&nbsp;&nbsp;{recordData.filtered}</View>
<View className='desc'> <View className='desc'>
{recordData.nursingTime} {recordData.modeName === '下颌线Pro'?<View className="itemStyel">[2]</View>:null}&nbsp;&nbsp;{recordData.faceEnergy}
</View> </View>
<View className='desc'> <View className='desc'>
{recordData.nursingTime} &nbsp;&nbsp;<View className="itemStyelone">[3]</View>{recordData.average}
</View> </View>
<View className='desc'> <View className='desc'>
{recordData.nursingTime} &nbsp;&nbsp;<View className="itemStyel">[4]</View>{recordData.max} &nbsp;&nbsp;<View className="itemStyeltwo">[5]</View>{recordData.min}
</View> </View>
</View> </View>
</View> </View>
@ -335,9 +374,10 @@ export default class Index extends Component<any, any> {
</View> </View>
</View> </View>
</View> </View>
<View className='main_title'>-{face_Tyep}</View> <View className='main_title'>-{recordData.modeName}</View>
<View className='eacharts'> <View className='eacharts'>
<EchartsForm></EchartsForm> <EchartsForm EchartsData={EchartsData}></EchartsForm>
{/* <Echarts1></Echarts1> */}
</View> </View>
</View> </View>

@ -704,6 +704,10 @@ page {
height: 100% !important; height: 100% !important;
border-radius: 20rpx; border-radius: 20rpx;
} }
.showImg:last-child{
width: 40rpx !important;
height: 40rpx !important;
}
} }
.info4 { .info4 {
position: relative; position: relative;

@ -307,20 +307,27 @@ export default class Recording extends Component<any, any> {
default: default:
this.AllDevice(item); this.AllDevice(item);
} }
// let report =false // let report =false
// go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report ); // go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report );
} }
// 打开第一种类型 // 打开第一种类型
One = async (item) => { One = async (item) => {
console.log("打开第一种类型", item);
let report = false; let report = false;
let nursingData=JSON.parse(item.nursingData)
let obj ={
modeName:item.modeName,
data:nursingData
}
console.log("打开第一种类型", item,obj);
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
item.id + item.id +
"&recordId=" + "&report=" +
item.recordId + report+ "&obj=" +
"&report=" + JSON.stringify(obj)
report
); );
}; };
// 打开第二种类型 // 打开第二种类型

@ -22,14 +22,38 @@ const instrumentReducer = createSlice({
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
validStatus: 1, // 1有效0无效 validStatus: 1, // 1有效0无效
// scanData: {
// name: "", // 扫码名字
// code: "", // 扫码序列号
// isChange: false, // 是否换绑
// },
}, },
reducers: { reducers: {
setInstrument(state, { payload }) { setInstrument(state, { payload }) {
console.log("payload", payload); state.bindingStatus = payload.bindingStatus;
state = JSON.parse(JSON.stringify(payload)); state.id = payload.id;
state.instrumentId = payload.instrumentId;
state.instrumentIdArray = payload.instrumentIdArray;
state.instrumentName = payload.instrumentName;
state.instrumentSerialIdList = payload.instrumentSerialIdList;
state.queryInstrumentIds = payload.queryInstrumentIds;
state.remark = payload.remark;
state.serial = payload.serial;
state.source = payload.source;
state.status = payload.status;
state.validStatus = payload.validStatus;
},
setSerial(state, { payload }) {
state.serial = payload;
},
setInstrumentName(state, { payload }) {
state.instrumentName = payload;
}, },
}, },
}); });
export const { setInstrument } = instrumentReducer.actions; export const { setInstrument, setSerial, setInstrumentName } =
instrumentReducer.actions;
export default instrumentReducer.reducer; export default instrumentReducer.reducer;

@ -6,6 +6,7 @@ import userInfoReducer from "./features/userInfo";
import globalStoreReducer from "./features/globalStore"; import globalStoreReducer from "./features/globalStore";
import otherSettingReducer from "./features/otherSetting"; import otherSettingReducer from "./features/otherSetting";
import deviceInfoReducer from "./features/deviceInfo"; import deviceInfoReducer from "./features/deviceInfo";
import instrumentReducer from "./features/instrument";
const store = configureStore({ const store = configureStore({
reducer: { reducer: {
@ -16,6 +17,7 @@ const store = configureStore({
globalStore: globalStoreReducer, globalStore: globalStoreReducer,
otherSetting: otherSettingReducer, otherSetting: otherSettingReducer,
deviceInfo: deviceInfoReducer, deviceInfo: deviceInfoReducer,
instrument: instrumentReducer,
}, },
}); });

@ -27,7 +27,7 @@ export const Ajax = (params) => {
// mask: true, // mask: true,
// }); // });
const whiteListLoading = [""]; // loading const whiteListLoading = []; // loading
// 防止多次点击 // 防止多次点击
const requestUrlList = global_requestUrlList; const requestUrlList = global_requestUrlList;

Loading…
Cancel
Save