qsj 2 years ago
commit 030ce764e6

@ -154,7 +154,7 @@ class IotCarePlanFR200 extends Component<any, any> {
openSourceData: [], openSourceData: [],
}, // 当前选中模式 }, // 当前选中模式
SwitchActiveModeItem: {}, // 切换选中模式 SwitchActiveModeItem: {}, // 切换选中模式
ModeID: "mode_", // 模式KEY ModeID: "base_", // 模式KEY
activeModeID: "", // 当前选中模式ID:用于高亮 activeModeID: "", // 当前选中模式ID:用于高亮
ModeStepIndex: 0, // 当前护理功效步骤:每个步骤时间不定,所以时间另外计算,根据步骤显示 ModeStepIndex: 0, // 当前护理功效步骤:每个步骤时间不定,所以时间另外计算,根据步骤显示
ModeStepTimeArray: [], // 护理功效时间步骤用于切换显示GIF ModeStepTimeArray: [], // 护理功效时间步骤用于切换显示GIF
@ -231,10 +231,9 @@ class IotCarePlanFR200 extends Component<any, any> {
BaseModeType: string[] = ["face", "eyes"]; BaseModeType: string[] = ["face", "eyes"];
async onLoad(option) { async onLoad(option) {
console.log(option,'跳转过来的数据'); console.log(option, "跳转过来的数据");
if (option.modeId) { if (option.modeId) {
this.setState({ activeModeID: option.modeId }) this.setState({ activeModeID: option.modeId });
} }
// 保持屏幕常亮 // 保持屏幕常亮
Taro.setKeepScreenOn({ Taro.setKeepScreenOn({
@ -243,7 +242,6 @@ class IotCarePlanFR200 extends Component<any, any> {
this.initData(); this.initData();
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
} }
componentDidMount() {} componentDidMount() {}
@ -376,33 +374,27 @@ class IotCarePlanFR200 extends Component<any, any> {
instrumentId: id, instrumentId: id,
}; };
let res = await InstrumentInfo.modeInfoList(params); let res = await InstrumentInfo.modeInfoList(params);
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
this.setState({ this.setState({
ModeList: res.data.data, ModeList: res.data.data, // 模式列表
ActiveModeItem: res.data.data[0], // 让模式列表正常显示
}); });
if (this.state.activeModeID != "") {
if(this.state.activeModeID){ this.state.ModeList.map((item) => {
this.state.ModeList.map(item => {
if (item.id === this.state.activeModeID) { if (item.id === this.state.activeModeID) {
this.setState({ this.setState({
ActiveModeItem: item ActiveModeItem: item,
}); });
} }
}) });
let res1= res.data.data.find(e =>e.id == this.state.activeModeID)
setTimeout(() => {
this.modeCurrentFun(res1);
}, 100);
} else {
setTimeout(() => {
this.modeCurrentFun(res.data.data[0]);
}, 100);
} }
let res1 = res.data.data.find((e) => e.id == this.state.activeModeID);
setTimeout(() => {
this.modeCurrentFun(res1);
}, 100);
} else { } else {
this.setState({ ModeList: [] }); this.setState({ ModeList: [] });
} }
@ -443,7 +435,7 @@ class IotCarePlanFR200 extends Component<any, any> {
* @name / * @name /
* */ * */
modeCurrentFun = async (data, isNotCheck = false) => { modeCurrentFun = async (data, isNotCheck = false) => {
let { isShowNurse,activeModeID } = this.state; let { isShowNurse, activeModeID } = this.state;
// 护理检查改变模式,是否提示切换护理模式 // 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换 // isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data; this.tempModeCurrent = data;
@ -498,8 +490,6 @@ class IotCarePlanFR200 extends Component<any, any> {
if (data.serviceData.length > 0) { if (data.serviceData.length > 0) {
this.setServiceTimeData(); this.setServiceTimeData();
} }
}); });
// 开发中,暂时允许直接切换 // 开发中,暂时允许直接切换
@ -586,7 +576,6 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
// 弹窗确定切换护理模式 // 弹窗确定切换护理模式
confirmModeSwitchBtn = () => { confirmModeSwitchBtn = () => {
let { SwitchActiveModeItem } = this.state; let { SwitchActiveModeItem } = this.state;
this.cancelModeSwitchBtn(); this.cancelModeSwitchBtn();
this.modeCurrentFun(SwitchActiveModeItem); this.modeCurrentFun(SwitchActiveModeItem);
@ -1224,14 +1213,14 @@ class IotCarePlanFR200 extends Component<any, any> {
let newWorkStatus = let newWorkStatus =
workStatus || workStatus ||
(this.workStatus == MODE_WORKING_ENUM.WORKING ? "pause" : "working"); (this.workStatus == MODE_WORKING_ENUM.WORKING ? "pause" : "working");
if (isBtnClick && newWorkStatus == "working") { // if (isBtnClick && newWorkStatus == "working") {
// todo FR200 不判断舱体,判断肌肤 // // todo FR200 不判断舱体,判断肌肤
if (!ActiveModeItem.isCabinMode && DeviceConnectStatus != 1) { // if (!ActiveModeItem.isCabinMode && DeviceConnectStatus != 1) {
console.log("DeviceConnectStatus", DeviceConnectStatus); // console.log("DeviceConnectStatus", DeviceConnectStatus);
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后点击重新检测"); // this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后点击重新检测");
return; // return;
} // }
} // }
let sendParams: any = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
@ -1270,7 +1259,7 @@ class IotCarePlanFR200 extends Component<any, any> {
/** /**
* @name * @name
* @params type switch * @params type switch WL200
*/ */
onNursingTap(type = "") { onNursingTap(type = "") {
// 如果已禁止运行,则停止执行后续逻辑 // 如果已禁止运行,则停止执行后续逻辑
@ -2264,6 +2253,10 @@ class IotCarePlanFR200 extends Component<any, any> {
className="video-or-image" className="video-or-image"
src={ActiveModeItem.modeVideo} src={ActiveModeItem.modeVideo}
loop loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
/> />
)} )}
@ -2326,7 +2319,14 @@ class IotCarePlanFR200 extends Component<any, any> {
)} )}
{(ActiveModeItem.modeType === "face" || {(ActiveModeItem.modeType === "face" ||
ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>} ActiveModeItem.modeType === "eyes") && (
<Block>
<Echarts></Echarts>
</Block>
)}
{/* <View style="display:none;">
<Echarts></Echarts>
</View> */}
{(ActiveModeItem.modeType === "maskPenetration" || {(ActiveModeItem.modeType === "maskPenetration" ||
ActiveModeItem.modeType === "essence") && ( ActiveModeItem.modeType === "essence") && (

@ -62,7 +62,7 @@ function Index({
(ModeType === "all" || ModeType === "base" || isPop) && ( (ModeType === "all" || ModeType === "base" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scroll-x="true" scrollX={true}
scrollIntoView={ModeID} // itemID自动滚动到该元素位置 scrollIntoView={ModeID} // itemID自动滚动到该元素位置
> >
<View className="mode-list"> <View className="mode-list">

@ -58,7 +58,7 @@ function Index({
(ModeType === "all" || ModeType === "visor" || isPop) && ( (ModeType === "all" || ModeType === "visor" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scroll-x="true" scrollX={true}
scrollIntoView={ModeID} // itemID自动滚动到该元素位置 scrollIntoView={ModeID} // itemID自动滚动到该元素位置
> >
<View className="mode-list"> <View className="mode-list">

Loading…
Cancel
Save