修复bug

master
blak-kong 2 years ago
parent 0fc7d07689
commit f14cb28a59

@ -33,11 +33,8 @@ import {
} from "@flossom-npm/iot-translater-we100"; } from "@flossom-npm/iot-translater-we100";
// 通过设备类型判断给 deviceToolKitInstance 赋值 // 通过设备类型判断给 deviceToolKitInstance 赋值
import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import { DeviceToolKit as DeviceToolKitFR200 } from "@flossom-npm/iot-translater"; import { DeviceToolKit as DeviceToolKitFR200 } from "@flossom-npm/iot-translater";
import OtaDeviceTypeEnum from "../OtaDeviceTypeEnum";
// 临时替代 // 临时替代
var log = console; var log = console;
@ -208,7 +205,9 @@ class UpdateIotFR200 extends Component<any, any> {
//@ts-ignore //@ts-ignore
const value = deviceToolKitInstance.toBleCommand(jsoncmd as any); const value = deviceToolKitInstance.toBleCommand(jsoncmd as any);
sendCommand({ value }).then((res) => { sendCommand({ value }).then((res) => {
console.log("finishedOTA", res);
this.resetOta(); this.resetOta();
this.finishFun();
}); });
} }
/** /**
@ -416,10 +415,12 @@ class UpdateIotFR200 extends Component<any, any> {
// 错误关闭回调 // 错误关闭回调
errorFun = () => { errorFun = () => {
this.resetOta(); this.resetOta();
if (this.$checkTimer) clearInterval(this.$checkTimer);
this.props.errorFun(); this.props.errorFun();
}; };
// 升级完成回调 // 升级完成回调
finishFun = () => { finishFun = () => {
if (this.$checkTimer) clearInterval(this.$checkTimer);
this.props.finishFun(); this.props.finishFun();
}; };

@ -229,6 +229,7 @@ class UpdateIotWL200 extends Component<any, any> {
const value = deviceToolKitInstance.toBleCommand(jsoncmd as any); const value = deviceToolKitInstance.toBleCommand(jsoncmd as any);
sendCommand({ value }).then((res) => { sendCommand({ value }).then((res) => {
this.resetOta(); this.resetOta();
this.finishFun();
}); });
} }
/** /**
@ -435,6 +436,7 @@ class UpdateIotWL200 extends Component<any, any> {
// 错误关闭回调 // 错误关闭回调
errorFun = () => { errorFun = () => {
this.resetOta(); this.resetOta();
if (this.$checkTimer) clearInterval(this.$checkTimer);
this.props.errorFun(); this.props.errorFun();
}; };
// 升级完成回调 // 升级完成回调

@ -56,13 +56,12 @@ import ConnectionBluetoot from "@/components/bluetoot/connection";
/* 本页组件 */ /* 本页组件 */
import ElectricityView from "./components/ElectricityView/Electricity"; import ElectricityView from "./components/ElectricityView/Electricity";
import ModeListView from "./components/ModeList/FR200"; import ModeListView from "./components/ModeList/FR200";
import ModeListAllView from "./components/ModeList/FR200All";
import Footer from "./components/Footer/FR200"; import Footer from "./components/Footer/FR200";
import WaterTest from "./components/WaterTest/index"; import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */ /* 本页组件 END */
import Echarts from "./components/Echart"; import Echarts from "./components/Echart";
import EchartsFullScean from "./components/EchartFullScean";
import Gears from "./components/Gears"; import Gears from "./components/Gears";
import "./FR200.less"; import "./FR200.less";
@ -345,10 +344,10 @@ class IotCarePlanFR200 extends Component<any, any> {
], ],
time: { time: {
min: 0, min: 0,
second: 0 second: 0,
}, },
timeArr: [], timeArr: [],
videoVoiceStatus: false videoVoiceStatus: false,
}; };
} }
bluetoothContainer: any = null; bluetoothContainer: any = null;
@ -380,7 +379,6 @@ class IotCarePlanFR200 extends Component<any, any> {
ModeTypeArray: string[] = [ ModeTypeArray: string[] = [
"all", "all",
"base", "base",
"eyes",
"zone", "zone",
"permeation", "permeation",
"sensitive", "sensitive",
@ -441,23 +439,7 @@ class IotCarePlanFR200 extends Component<any, any> {
title: obj.name, title: obj.name,
}); });
let sendParams: any = { this.resetDeviceTimeSync();
// ...deviceCommandSamples.pause,
// workMode: 'moistureTest', // 使用模式
commandType: "DeviceStatusSync",
deviceSyncCommandType: 'onlySyncStatusToDevice',
totalWorkingSeconds: 0,
workStatus: "pause",
workMode: 'face',
};
sendParams.gear = 1;
let pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
sendParams as any
);
sendCommand({
value: pauseArrayBuffer,
}).then((res) => console.log("同步为0=====》", res));
await this.GetModeList(obj?.id); await this.GetModeList(obj?.id);
@ -476,6 +458,26 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
} }
/**重置设备时间同步*/
resetDeviceTimeSync(workMode = "face") {
let sendParams: any = {
// ...deviceCommandSamples.pause,
// workMode: 'moistureTest', // 使用模式
commandType: "DeviceStatusSync",
deviceSyncCommandType: "onlySyncStatusToDevice",
totalWorkingSeconds: 0,
workStatus: "pause",
workMode: workMode,
};
sendParams.gear = 1;
let pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
sendParams as any
);
sendCommand({
value: pauseArrayBuffer,
}).then((res) => console.log("同步为0=====》", res));
}
async init() { async init() {
// 查询离线记录汇总 // 查询离线记录汇总
const queryInstructionParams = { const queryInstructionParams = {
@ -601,12 +603,11 @@ class IotCarePlanFR200 extends Component<any, any> {
// 护理检查改变模式,是否提示切换护理模式 // 护理检查改变模式,是否提示切换护理模式
// isNotCheck为真时不进行校验直接切换 // isNotCheck为真时不进行校验直接切换
this.tempModeCurrent = data; this.tempModeCurrent = data;
this.resetDeviceTimeSync(data.modeType); // 切换模式时,重置设备同步时间
// 仅在未开始护理前,切换模式的时候提示模式弹窗 // 仅在未开始护理前,切换模式的时候提示模式弹窗
// FR200默认开始护理 // FR200默认开始护理
if (!isShowNurse) {
this.openStepTips(); this.openStepTips();
}
// 如果按钮不可点击则报错,内部自带检查底部按钮函数 // 如果按钮不可点击则报错,内部自带检查底部按钮函数
// this.onEmitErrorTips(); // this.onEmitErrorTips();
@ -627,14 +628,13 @@ class IotCarePlanFR200 extends Component<any, any> {
currentWorkModeType = 2; currentWorkModeType = 2;
} }
series.map(item => { series.map((item) => {
if (item.type == 'line') { if (item.type == "line") {
item.data = [] item.data = [];
} else { } else {
item.data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] item.data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
} }
}) });
this.setState({ this.setState({
ActiveModeItem: data, ActiveModeItem: data,
@ -645,7 +645,7 @@ class IotCarePlanFR200 extends Component<any, any> {
MaskModeStepIndex: 0, // 面膜促渗步骤 MaskModeStepIndex: 0, // 面膜促渗步骤
ModeType: this.ModeTypeArray[data.modeClass], ModeType: this.ModeTypeArray[data.modeClass],
currentWorkModeType, currentWorkModeType,
series series,
}); });
// 切换模式时:重新设置视频地址 // 切换模式时:重新设置视频地址
@ -732,8 +732,11 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
// 取消并关闭切换护理模式弹窗 // 取消并关闭切换护理模式弹窗
cancelModeSwitchBtn = () => { cancelModeSwitchBtn = () => {
let { ActiveModeItem } = this.state;
this.setState({ this.setState({
isSwitchActiveMode: false, isSwitchActiveMode: false,
activeModeID: ActiveModeItem?.id,
ModeID: "mode_" + ActiveModeItem?.id,
}); });
}; };
// 弹窗确定切换护理模式 // 弹窗确定切换护理模式
@ -896,14 +899,14 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
updata(level = 1, min = 0, seconds = 0) { updata(level = 1, min = 0, seconds = 0) {
if (seconds == 0 && min == 0) { if (seconds == 0 && min == 0) {
return return;
} }
// let that = this; // let that = this;
// let stop = 0; // let stop = 0;
// let time = setInterval(function () { // let time = setInterval(function () {
// stop++; // stop++;
let series = JSON.parse(JSON.stringify(this.state.series)); let series = JSON.parse(JSON.stringify(this.state.series));
let num = level let num = level;
let count = 0; let count = 0;
series.map((item) => { series.map((item) => {
if (item.type === "line") { if (item.type === "line") {
@ -923,16 +926,16 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
} else { } else {
if (count <= num) { if (count <= num) {
item.data.splice(seconds - 1, 1, 1) item.data.splice(seconds - 1, 1, 1);
} else { } else {
item.data.splice(seconds - 1, 1, 0) item.data.splice(seconds - 1, 1, 0);
} }
} }
} }
}); });
let time = JSON.parse(JSON.stringify(this.state.time)); let time = JSON.parse(JSON.stringify(this.state.time));
time.min = min time.min = min;
time.second = seconds time.second = seconds;
// 更新图表数据 // 更新图表数据
this.setState({ series }); this.setState({ series });
this.setState({ time }); this.setState({ time });
@ -1091,7 +1094,6 @@ class IotCarePlanFR200 extends Component<any, any> {
// 更新界面倒计时 // 更新界面倒计时
this.resetTimer(); this.resetTimer();
if ( if (
sceneTime > totalTime && sceneTime > totalTime &&
this.isRuning && this.isRuning &&
@ -1381,14 +1383,12 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
} }
/** /**
* *
*/ */
videoVoiceStatusChange() { videoVoiceStatusChange() {
let { videoVoiceStatus } = this.state; let { videoVoiceStatus } = this.state;
this.setState({ videoVoiceStatus: !videoVoiceStatus }) this.setState({ videoVoiceStatus: !videoVoiceStatus });
} }
/** @name 精华促渗下一步,根据时间自动调用 */ /** @name 精华促渗下一步,根据时间自动调用 */
essencePenetrationNext() { essencePenetrationNext() {
@ -1905,17 +1905,16 @@ class IotCarePlanFR200 extends Component<any, any> {
console.log("保存setFR200NursingHistory"); console.log("保存setFR200NursingHistory");
}; };
formatTime(min, sec) { formatTime(min, sec) {
let mins let mins;
if (min < 10) { if (min < 10) {
mins = '0' + min; mins = "0" + min;
} else { } else {
mins = min; mins = min;
} }
let secs let secs;
if (sec < 10) { if (sec < 10) {
secs = '0' + sec; secs = "0" + sec;
} else { } else {
secs = sec; secs = sec;
} }
@ -1937,19 +1936,22 @@ class IotCarePlanFR200 extends Component<any, any> {
// 设置正确封面 // 设置正确封面
if (!data) { if (!data) {
if (jsonStatus) { if (jsonStatus) {
let { timeArr } = this.state let { timeArr } = this.state;
let newTime = this.formatTime(jsonStatus.totalWorkingMinutes, jsonStatus.totalWorkingSeconds) let newTime = this.formatTime(
let flag = false jsonStatus.totalWorkingMinutes,
timeArr.map(item => { jsonStatus.totalWorkingSeconds
);
let flag = false;
timeArr.map((item) => {
if (newTime === item) { if (newTime === item) {
flag = true flag = true;
} }
}) });
if (flag) { if (flag) {
return return;
} }
timeArr.push(newTime) timeArr.push(newTime);
this.setState({ timeArr }) this.setState({ timeArr });
// 缓存每秒数据 // 缓存每秒数据
if (!params.dataArray) params.dataArray = []; if (!params.dataArray) params.dataArray = [];
params.dataArray.push(jsonStatus); params.dataArray.push(jsonStatus);
@ -1957,17 +1959,26 @@ class IotCarePlanFR200 extends Component<any, any> {
params.workMode = jsonStatus?.workMode; params.workMode = jsonStatus?.workMode;
params.modeId = this.state.ActiveModeItem?.id; params.modeId = this.state.ActiveModeItem?.id;
params.modeName = this.state.ActiveModeItem.modeName; params.modeName = this.state.ActiveModeItem.modeName;
let impedance = jsonStatus.impedance let impedance = jsonStatus.impedance;
let level = impedance - 200 let level = impedance - 200;
if (level < 0) { if (level < 0) {
level = 1 level = 1;
} else { } else {
level = Math.ceil(level / 80) + 1 level = Math.ceil(level / 80) + 1;
} }
console.log('min:', jsonStatus.totalWorkingMinutes, ' ', 'sec', jsonStatus.totalWorkingSeconds); console.log(
"min:",
this.updata(level, jsonStatus.totalWorkingMinutes, jsonStatus.totalWorkingSeconds) jsonStatus.totalWorkingMinutes,
" ",
"sec",
jsonStatus.totalWorkingSeconds
);
this.updata(
level,
jsonStatus.totalWorkingMinutes,
jsonStatus.totalWorkingSeconds
);
} }
} else { } else {
params.jsonStatus = jsonStatus; params.jsonStatus = jsonStatus;
@ -2491,7 +2502,7 @@ class IotCarePlanFR200 extends Component<any, any> {
series, series,
time, time,
isFullScreen, isFullScreen,
videoVoiceStatus videoVoiceStatus,
} = this.state; } = this.state;
return ( return (
@ -2510,19 +2521,19 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isModeLock} isShow={isModeLock}
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content='该模式即将上线,敬请期待' content="该模式即将上线,敬请期待"
confirmButtonText='我知道了' confirmButtonText="我知道了"
textAlgin='center' textAlgin="center"
close={this.onModeLockClose} close={this.onModeLockClose}
confirm={this.onModeLockClose} confirm={this.onModeLockClose}
/> />
<PopupInstrumentUploadTips <PopupInstrumentUploadTips
isShow={isFirstTipShow} isShow={isFirstTipShow}
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='打卡介绍' title="打卡介绍"
data={nurseInfo} data={nurseInfo}
close={this.onTipShowClose} close={this.onTipShowClose}
confirm={this.onTipShowClose} confirm={this.onTipShowClose}
@ -2534,11 +2545,11 @@ class IotCarePlanFR200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isEndCarePlan} isShow={isEndCarePlan}
title='提示' title="提示"
content='是否结束护理' content="是否结束护理"
textAlgin='center' textAlgin="center"
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确定' confirmButtonText="确定"
close={this.cancelEndBtn} close={this.cancelEndBtn}
confirm={this.confirmEndBtn} confirm={this.confirmEndBtn}
/> />
@ -2546,7 +2557,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isSwitchActiveMode} isShow={isSwitchActiveMode}
title='护理模式切换' title="护理模式切换"
content={ content={
<ModeListView <ModeListView
ModeID={ModeID} ModeID={ModeID}
@ -2560,9 +2571,9 @@ class IotCarePlanFR200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen} onModeLockOpen={this.onModeLockOpen}
/> />
} }
textAlgin='center' textAlgin="center"
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确定' confirmButtonText="确定"
close={this.cancelModeSwitchBtn} close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn} confirm={this.confirmModeSwitchBtn}
/> />
@ -2572,7 +2583,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowStepTips} isShow={isShowStepTips}
isLarge isLarge
isFirstEntry={false} isFirstEntry={false}
confirmButtonText='知道了' confirmButtonText="知道了"
data={ActiveModeItem.openSourceData} data={ActiveModeItem.openSourceData}
close={this.closeStepTips} close={this.closeStepTips}
/> />
@ -2581,10 +2592,10 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isNotEnoughTime} isShow={isNotEnoughTime}
isClose isClose
title='提示' title="提示"
content='您的本次护理时间不足,请重新护理' content="您的本次护理时间不足,请重新护理"
confirmButtonText='确认' confirmButtonText="确认"
textAlgin='center' textAlgin="center"
close={this.closeNotEnoughTime} close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime} confirm={this.closeNotEnoughTime}
/> />
@ -2593,11 +2604,11 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowErrorTipsText} isShow={isShowErrorTipsText}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content={errorTipsText} content={errorTipsText}
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={this.closeErrorTipsText} close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText} confirm={this.closeErrorTipsText}
/> />
@ -2606,17 +2617,17 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowTipsSave} isShow={isShowTipsSave}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content={ content={
<Block> <Block>
<View></View> <View></View>
<View></View> <View></View>
</Block> </Block>
} }
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确认' confirmButtonText="确认"
textAlgin='center' textAlgin="center"
close={this.closeTipsSave} close={this.closeTipsSave}
cancel={this.cancelTipsSave} cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave} confirm={this.confirmTipsSave}
@ -2625,11 +2636,11 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupStatus <PopupStatus
isShow={isShowNursingSuccess} isShow={isShowNursingSuccess}
isClose isClose
title='您已结束本次护理' title="您已结束本次护理"
type='success' type="success"
content='正在上传护理记录……' content="正在上传护理记录……"
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={() => { close={() => {
/*不需要做处理*/ /*不需要做处理*/
}} }}
@ -2648,63 +2659,67 @@ class IotCarePlanFR200 extends Component<any, any> {
<Popup <Popup
show={isShowHistoryMsg} show={isShowHistoryMsg}
className='custom-popup' className="custom-popup"
overlay={false} overlay={false}
> >
<View className='sync-history-msg'>...</View> <View className="sync-history-msg">...</View>
</Popup> </Popup>
</View> </View>
<View> <View>
<View className='iot-main'> <View className="iot-main">
{isFullScreen && ( {isFullScreen && (
<View className='banner-box'> <View className="banner-box">
<View> <View>
<Video <Video
className='video-or-image' className="video-or-image"
src={currentVideoSrc} src={currentVideoSrc}
loop loop
id='myVideo' id="myVideo"
muted={videoVoiceStatus} muted={videoVoiceStatus}
objectFit='cover' objectFit="cover"
enablePlayGesture
showFullscreenBtn={false} showFullscreenBtn={false}
showPlayBtn={false}
showBottomProgress={false}
controls={false}
onLoadedMetaData={this.GetVideosTime} onLoadedMetaData={this.GetVideosTime}
/> />
{/* <button onClick={this.executePromises}>点击按钮</button> */} {/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && ( {errorTips && (
<Block> <Block>
<View className='msg-tips'> <View className="msg-tips">
<Image <Image
className='msg-tips-img' className="msg-tips-img"
src={require("@/img/tips.png")} src={require("@/img/tips.png")}
/> />
<View className='msg-tips-content'>{errorTips}</View> <View className="msg-tips-content">{errorTips}</View>
</View> </View>
</Block> </Block>
)} )}
</View> </View>
<View <View
className='music flex aitems jcenter' className="music flex aitems jcenter"
onClick={this.videoVoiceStatusChange.bind(this)} onClick={this.videoVoiceStatusChange.bind(this)}
> >
<Image <Image
src={require(`@/img/${videoVoiceStatus ? 'mute' : 'play'}.png`)} src={require(`@/img/${
mode='aspectFill' videoVoiceStatus ? "mute" : "play"
}.png`)}
mode="aspectFill"
></Image> ></Image>
</View> </View>
<View className='fr200-iot-device'> <View className="fr200-iot-device">
<View className='item'> <View className="item">
<Text className='device-time'> <Text className="device-time">
<Text className='time'>{currentTime}</Text> <Text className="time">{currentTime}</Text>
</Text> </Text>
</View> </View>
<View className='line' /> <View className="line" />
<View className='item'> <View className="item">
<Text className='gear'>{currentGear}</Text> <Text className="gear">{currentGear}</Text>
</View> </View>
<View className='line' /> <View className="line" />
<ElectricityView <ElectricityView
Electricity={Electricity} Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus} DeviceConnectStatus={DeviceConnectStatus}
@ -2714,12 +2729,9 @@ class IotCarePlanFR200 extends Component<any, any> {
)} )}
{ModeList.length > 0 && isFullScreen && ( {ModeList.length > 0 && isFullScreen && (
<ModeListView <ModeListAllView
isPop={false} isPop={false}
isShowNurse={isShowNurse}
ModeList={ModeList} ModeList={ModeList}
ModeType={ModeType}
ModeID={ModeID}
activeModeID={activeModeID} activeModeID={activeModeID}
onEmit={this.modeCurrentFun} onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch} onEmitShowAll={this.openModeSwitch}
@ -2728,8 +2740,21 @@ class IotCarePlanFR200 extends Component<any, any> {
)} )}
{/* <button onClick={this.updata.bind(this)}>模拟数据更新 </button> */} {/* <button onClick={this.updata.bind(this)}>模拟数据更新 </button> */}
<View className={classnames({ show: ActiveModeItem?.modeType !== "face" && ActiveModeItem?.modeType !== "eyes" && ActiveModeItem?.modeType !== "nasolabialFold" && ActiveModeItem?.modeType !== "mandibularLine" && ActiveModeItem?.modeType !== "headLiftingPro" })}> <View
<Echarts series={series} time={time} full={this.full.bind(this)}></Echarts> className={classnames({
show:
ActiveModeItem?.modeType !== "face" &&
ActiveModeItem?.modeType !== "eyes" &&
ActiveModeItem?.modeType !== "nasolabialFold" &&
ActiveModeItem?.modeType !== "mandibularLine" &&
ActiveModeItem?.modeType !== "headLiftingPro",
})}
>
<Echarts
series={series}
time={time}
full={this.full.bind(this)}
></Echarts>
</View> </View>
{(ActiveModeItem?.modeType === "maskPenetration" || {(ActiveModeItem?.modeType === "maskPenetration" ||

@ -546,8 +546,11 @@ class IotCarePlanWL200 extends Component<any, any> {
}; };
// 取消并关闭切换护理模式弹窗 // 取消并关闭切换护理模式弹窗
cancelModeSwitchBtn = () => { cancelModeSwitchBtn = () => {
let { ActiveModeItem } = this.state;
this.setState({ this.setState({
isSwitchActiveMode: false, isSwitchActiveMode: false,
activeModeID: ActiveModeItem?.id,
ModeID: "mode_" + ActiveModeItem?.id,
}); });
}; };
// 弹窗确定切换护理模式 // 弹窗确定切换护理模式
@ -2128,11 +2131,11 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isModeLock} isShow={isModeLock}
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content='该模式即将上线,敬请期待' content="该模式即将上线,敬请期待"
confirmButtonText='我知道了' confirmButtonText="我知道了"
textAlgin='center' textAlgin="center"
isClose={false} isClose={false}
close={this.onModeLockClose} close={this.onModeLockClose}
confirm={this.onModeLockClose} confirm={this.onModeLockClose}
@ -2140,8 +2143,8 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupInstrumentUploadTips <PopupInstrumentUploadTips
isShow={isFirstTipShow} isShow={isFirstTipShow}
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='打卡介绍' title="打卡介绍"
data={nurseInfo} data={nurseInfo}
close={this.onTipShowClose} close={this.onTipShowClose}
confirm={this.onTipShowClose} confirm={this.onTipShowClose}
@ -2153,11 +2156,11 @@ class IotCarePlanWL200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isEndCarePlan} isShow={isEndCarePlan}
title='提示' title="提示"
content='是否结束护理' content="是否结束护理"
textAlgin='center' textAlgin="center"
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确定' confirmButtonText="确定"
close={this.cancelEndBtn} close={this.cancelEndBtn}
confirm={this.confirmEndBtn} confirm={this.confirmEndBtn}
/> />
@ -2165,7 +2168,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isSwitchActiveMode} isShow={isSwitchActiveMode}
title='护理模式切换' title="护理模式切换"
content={ content={
<ModeListView <ModeListView
ModeID={ModeID} ModeID={ModeID}
@ -2179,9 +2182,9 @@ class IotCarePlanWL200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen} onModeLockOpen={this.onModeLockOpen}
/> />
} }
textAlgin='center' textAlgin="center"
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确定' confirmButtonText="确定"
close={this.cancelModeSwitchBtn} close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn} confirm={this.confirmModeSwitchBtn}
/> />
@ -2191,7 +2194,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowStepTips} isShow={isShowStepTips}
isLarge isLarge
isFirstEntry={false} isFirstEntry={false}
confirmButtonText='知道了' confirmButtonText="知道了"
data={ActiveModeItem.openSourceData} data={ActiveModeItem.openSourceData}
close={this.closeStepTips} close={this.closeStepTips}
/> />
@ -2200,10 +2203,10 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isNotEnoughTime} isShow={isNotEnoughTime}
isClose isClose
title='提示' title="提示"
content='您的本次护理时间不足,请重新护理' content="您的本次护理时间不足,请重新护理"
confirmButtonText='确认' confirmButtonText="确认"
textAlgin='center' textAlgin="center"
close={this.closeNotEnoughTime} close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime} confirm={this.closeNotEnoughTime}
/> />
@ -2212,11 +2215,11 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowErrorTipsText} isShow={isShowErrorTipsText}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content={errorTipsText} content={errorTipsText}
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={this.closeErrorTipsText} close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText} confirm={this.closeErrorTipsText}
/> />
@ -2225,17 +2228,17 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowTipsSave} isShow={isShowTipsSave}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName='level-up' myClassName="level-up"
title='提示' title="提示"
content={ content={
<Block> <Block>
<View></View> <View></View>
<View></View> <View></View>
</Block> </Block>
} }
cancelButtonText='取消' cancelButtonText="取消"
confirmButtonText='确认' confirmButtonText="确认"
textAlgin='center' textAlgin="center"
close={this.closeTipsSave} close={this.closeTipsSave}
cancel={this.cancelTipsSave} cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave} confirm={this.confirmTipsSave}
@ -2244,11 +2247,11 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupStatus <PopupStatus
isShow={isShowNursingSuccess} isShow={isShowNursingSuccess}
isClose isClose
title='您已结束本次护理' title="您已结束本次护理"
type='success' type="success"
content='正在上传护理记录……' content="正在上传护理记录……"
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={() => { close={() => {
/*不需要做处理*/ /*不需要做处理*/
}} }}
@ -2267,23 +2270,23 @@ class IotCarePlanWL200 extends Component<any, any> {
<Popup <Popup
show={isShowHistoryMsg} show={isShowHistoryMsg}
className='custom-popup' className="custom-popup"
overlay={false} overlay={false}
> >
<View className='sync-history-msg'>...</View> <View className="sync-history-msg">...</View>
</Popup> </Popup>
</View> </View>
<View> <View>
<View className='iot-main'> <View className="iot-main">
<View className='banner-box'> <View className="banner-box">
<View> <View>
{!isShowNurse && ( {!isShowNurse && (
<Video <Video
className='video-or-image' className="video-or-image"
src={ActiveModeItem.modeVideo} src={ActiveModeItem.modeVideo}
loop loop
id='myVideo' id="myVideo"
onPlay={this.onPlay} onPlay={this.onPlay}
muted={isMuted} muted={isMuted}
onTimeUpdate={this.GetVideosTime} onTimeUpdate={this.GetVideosTime}
@ -2296,12 +2299,12 @@ class IotCarePlanWL200 extends Component<any, any> {
<Block> <Block>
{isStopNurse ? ( {isStopNurse ? (
<Image <Image
className='video-or-image' className="video-or-image"
src={currentServiceData.stopSource} src={currentServiceData.stopSource}
/> />
) : ( ) : (
<Image <Image
className='video-or-image' className="video-or-image"
src={currentServiceData.startSource} src={currentServiceData.startSource}
/> />
)} )}
@ -2309,33 +2312,33 @@ class IotCarePlanWL200 extends Component<any, any> {
)} )}
{errorTips && ( {errorTips && (
<Block> <Block>
<View className='msg-tips'> <View className="msg-tips">
<Image <Image
className='msg-tips-img' className="msg-tips-img"
src={require("@/img/tips.png")} src={require("@/img/tips.png")}
/> />
<View className='msg-tips-content'>{errorTips}</View> <View className="msg-tips-content">{errorTips}</View>
</View> </View>
</Block> </Block>
)} )}
</View> </View>
<View <View
className='music flex aitems jcenter' className="music flex aitems jcenter"
onClick={this.handleClicksound.bind(this)} onClick={this.handleClicksound.bind(this)}
> >
<Image <Image
src={require(`@/img/${isMuted ? 'mute' : 'play'}.png`)} src={require(`@/img/${isMuted ? "mute" : "play"}.png`)}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
</View> </View>
<View className='iot-device'> <View className="iot-device">
<View className='item'> <View className="item">
<Text className='device-time'> <Text className="device-time">
<Text className='time'>{currentTime}</Text> <Text className="time">{currentTime}</Text>
</Text> </Text>
</View> </View>
<View className='line' /> <View className="line" />
<ElectricityView <ElectricityView
Electricity={Electricity} Electricity={Electricity}
matrixElectricity={matrixElectricity} matrixElectricity={matrixElectricity}

@ -240,7 +240,7 @@ function Index({
> >
<View className="mode-list"> <View className="mode-list">
<View className="mode-item-title"></View> <View className="mode-item-title"></View>
{PermeationList.map((item: any, index: any) => { {SensitiveList.map((item: any, index: any) => {
return ( return (
<View <View
key={"sensitive_" + index} key={"sensitive_" + index}

@ -0,0 +1,108 @@
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Block, View, ScrollView, Image } from "@tarojs/components";
import { useState, useEffect } from "react";
import "./FR200.less";
interface Props {
isPop: boolean;
activeModeID: any;
ModeList: any;
onEmit: Function; // 每次点击item回调事件和数据给父组件
onEmitShowAll: Function; // 打开弹窗按钮
onModeLockOpen: Function; // 打开锁定弹窗
}
function Index({
isPop,
ModeList,
activeModeID,
onEmit,
onModeLockOpen,
onEmitShowAll,
}: Props) {
const onItemClick = (item) => {
if (item.lock) {
onModeLockOpen(); // 点击了锁定模式
return;
}
onEmit(item);
};
const showAll = () => {
onEmitShowAll();
};
return (
<Block>
<View className="mode-list-main">
{!isPop && ModeList.length > 0 && (
<View className="change-all-mode-btn" onClick={showAll}>
<View className="title"></View>
<Image
className="icon"
src={require("@/img/iot/mode-switch.png")}
/>
</View>
)}
<ScrollView
className="mode-list-box"
scrollX={true}
scrollIntoView={"all_" + activeModeID} // itemID自动滚动到该元素位置
>
<View className="mode-list">
{ModeList.map((item: any, index: any) => {
return (
<View
key={"all_" + index}
id={"all_" + item.id}
className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id,
})}
onClick={onItemClick.bind(this, item)}
>
<View
className={classnames("new", {
"is-new": item.isNew === 1,
})}
>
NEW
</View>
<View className="mode-info">
<View className="mode-info-title">{item.modeName}</View>
<View className="mode-info-time">
{item.modeTimeStr === "00:00"
? "--:--"
: item.modeTimeStr}
</View>
<View
className={classnames("mode-info-select", {
"is-select": activeModeID === item.id,
})}
>
{activeModeID === item.id && (
<View className="mode-info-select-point"></View>
)}
</View>
</View>
{activeModeID === item.id && (
<View className="mode-pic">
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>
);
})}
<View style="width:120rpx;min-width:120rpx;height:40rpx;display:flex"></View>
</View>
</ScrollView>
</View>
</Block>
);
}
export default Index;
Loading…
Cancel
Save