blak-kong 2 years ago
parent c4997697c9
commit d48778d528

@ -148,13 +148,12 @@ class IotCarePlanFR200 extends Component<any, any> {
isModeLock: false, // 模式是否锁定
isSwitchActiveMode: false, // 是否显示弹窗切换模式
ModeList: [],
ModeType: "all", // all
modeClass: "", // 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤
ModeType: "all", // all 1基础护理 2专区护理 3专研促渗 4敏期护理 5智能测肤
ActiveModeItem: {
openSourceData: [],
}, // 当前选中模式
SwitchActiveModeItem: {}, // 切换选中模式
ModeID: "base_", // 模式KEY
ModeID: "mode_", // 模式KEY
activeModeID: "", // 当前选中模式ID:用于高亮
ModeStepIndex: 0, // 当前护理功效步骤:每个步骤时间不定,所以时间另外计算,根据步骤显示
ModeStepTimeArray: [], // 护理功效时间步骤用于切换显示GIF
@ -380,6 +379,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({
ModeList: res.data.data, // 模式列表
ActiveModeItem: res.data.data[0], // 让模式列表正常显示
ModeType: this.ModeTypeArray[res.data.data[0].modeClass],
});
if (this.state.activeModeID != "") {
@ -453,14 +453,6 @@ class IotCarePlanFR200 extends Component<any, any> {
if (isReturn) return;
}
let currentServiceData = {
startSource: "",
stopSource: "",
};
if (data.serviceData.length) {
currentServiceData = data.serviceData[0];
}
let currentTime = data.modeTimeStr;
// 根据模式,动态设置底部按钮样式
@ -478,20 +470,12 @@ class IotCarePlanFR200 extends Component<any, any> {
ActiveModeItem: data,
activeModeID: data.id,
ModeID: "mode_" + data.id,
currentServiceData,
ModeStepIndex: 0,
ModeType: this.ModeTypeArray[data.modeClass],
currentTime,
currentWorkModeType,
});
setTimeout(() => {
// 设置时间组合
if (data.serviceData.length > 0) {
this.setServiceTimeData();
}
});
// 开发中,暂时允许直接切换
// 每次切换模式时清空一下历史数据
this.changeItemUpdateFR200NursingHistory();
@ -1190,7 +1174,6 @@ class IotCarePlanFR200 extends Component<any, any> {
);
this.setState({
ModeStepIndex: index,
currentServiceData,
});
}
}
@ -1417,7 +1400,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 仪器缓存模式,判断是否存在于现有模式中
let recordModeItem = ModeList.find((item) => {
return item.id == FR200NursingHistory.currentServiceData.modeId;
return item.id == FR200NursingHistory.modeId;
});
if (!FR200NursingHistory || !recordModeItem) {
console.log("仪器有数据, 但是缓存没有数据, 忽略");
@ -1517,7 +1500,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({
isShowNurse: true,
isShowHistoryMsg: true,
currentServiceData: this.FR200NursingHistory.currentServiceData,
videoTime: this.FR200NursingHistory.videoTime,
tempModeCurrent: ActiveModeItem,
ActiveModeItem: ActiveModeItem,
activeModeID: ActiveModeItem.id,
@ -1560,21 +1543,10 @@ class IotCarePlanFR200 extends Component<any, any> {
// 设置当前时间
params.currentTime = this.state.currentTime;
// params.videoTime;
// 设置正确封面
if (data) {
params.currentServiceData = data;
} else {
let currentServiceData = {
startSource: "",
stopSource: "",
};
let serviceLength = this.state.ActiveModeItem.serviceData.length;
if (serviceLength > 0) {
currentServiceData = this.state.ActiveModeItem.serviceData[0];
}
params.currentServiceData = currentServiceData;
if (!data) {
if (jsonStatus) {
// 缓存每秒数据
if (!params.dataArray) params.dataArray = [];

@ -8,7 +8,7 @@ interface Props {
ModeID: any;
activeModeID: any;
ModeList: any;
ModeType: string; // all visor cabin yimeish
ModeType: string; // all base eyes zone permeation sensitive intelligence
isShowNurse: boolean; // 是否已进入护理详情页
isPop: boolean; // 是否弹窗
onEmit: Function; // 每次点击item回调事件和数据给父组件
@ -26,14 +26,12 @@ function Index({
onEmitShowAll,
onModeLockOpen,
}: Props) {
let BaseList = ModeList.filter((item) => item.modeClass === 1); // 基础护理
let ZoneList = ModeList.filter((item) => item.modeClass === 2); // 专区护理
let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗
let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理
let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤
console.log(activeModeID,'查看id',BaseList,ModeList);
console.log(activeModeID, "查看id", BaseList, ModeList);
const onItemClick = (item) => {
if (item.lock) {
onModeLockOpen(); // 点击了锁定模式
@ -71,7 +69,7 @@ function Index({
return (
<View
key={"base_" + index}
id={"base_" + item.id}
id={"mode_" + item.id}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,
})}
@ -129,7 +127,7 @@ function Index({
return (
<View
key={"zone_" + index}
id={"zone_" + item.id}
id={"mode_" + item.id}
onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,
@ -187,7 +185,7 @@ function Index({
return (
<View
key={"permeation_" + index}
id={"permeation_" + item.id}
id={"mode_" + item.id}
onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,
@ -245,7 +243,7 @@ function Index({
return (
<View
key={"sensitive_" + index}
id={"sensitive_" + item.id}
id={"mode_" + item.id}
onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,
@ -303,7 +301,7 @@ function Index({
return (
<View
key={"intelligence_" + index}
id={"intelligence_" + item.id}
id={"mode_" + item.id}
onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,

Loading…
Cancel
Save