qsj 2 years ago
commit 030ce764e6

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

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

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

Loading…
Cancel
Save