You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.3 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { Block, View, Image, Text, CoverView } from "@tarojs/components";
import "./FR200.less";
interface Props {
// isShowNurse: boolean;
currentWorkModeType: number; // 当前工作模式 1基础脸部等只有结束按钮 2.促渗,可以开始暂停和结束 3.水分测试
isStopNurse: boolean;
isRuningTest: any; // 是否在运行测试 1是启动2进行中3重新检测4检测完成
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
onEmitSwitchChange: Function;
onEmitEndPlan: Function;
onsuccess: Function;
}
function Index({
currentWorkModeType,
isStopNurse,
isRuningTest,
onEmitStartNurse,
onEmitSwitchChange,
onEmitEndPlan,
onsuccess,
}: Props) {
const onStartNurse = () => {
onEmitStartNurse();
};
const onSwitchChange = () => {
onEmitSwitchChange();
};
const onEndPlan = () => {
onEmitEndPlan();
};
const onSuccessNurse = () => {
onsuccess();
};
return (
<Block>
<View className="iot-footer">
{currentWorkModeType === 3 && (
<Block>
{isRuningTest === 1 ? (
<View className="btn" onClick={onStartNurse}>
</View>
) : isRuningTest === 2 ? (
<View className="btn">...</View>
) : isRuningTest === 3 ? (
<View className="btn" onClick={onStartNurse}>
</View>
) : (
<View className="btn" onClick={onSuccessNurse}>
</View>
)}
</Block>
)}
{currentWorkModeType === 2 && (
<View className="switch-btn-box">
<View className="btn-item border-right" onClick={onSwitchChange}>
{isStopNurse ? (
<Block>
<Image
className="btn-icon"
src={require("@/img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</Block>
) : (
<Block>
<Image
className="btn-icon"
src={require("@/img/iot/pause_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</Block>
)}
</View>
<View className="btn-item" onClick={onEndPlan}>
<Image
className="btn-icon"
src={require("@/img/iot/over_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</View>
</View>
)}
{currentWorkModeType === 1 && (
<View className="switch-btn-box">
<View className="btn-item" onClick={onEndPlan}>
<Image
className="btn-icon"
src={require("@/img/iot/over_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</View>
</View>
)}
</View>
</Block>
);
}
export default Index;