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 { ModeID: any; activeModeID: any; ModeList: any; ModeType: string; // all base eyes zone permeation sensitive intelligence isShowNurse: boolean; // 是否已进入护理详情页 isPop: boolean; // 是否弹窗 onEmit: Function; // 每次点击item,回调事件和数据给父组件 onEmitShowAll: Function; // 打开弹窗按钮 onModeLockOpen: Function; // 打开锁定弹窗 } function Index({ isShowNurse, isPop, ModeList, ModeType, ModeID, activeModeID, onEmit, 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); // 智能测肤 const onItemClick = (item) => { if (item.lock) { onModeLockOpen(); // 点击了锁定模式 return; } onEmit(item); }; const showAll = () => { onEmitShowAll(); }; return ( {!isPop && ModeList.length > 0 && isShowNurse && ( 全部模式 )} {BaseList.length > 0 && (ModeType === "all" || ModeType === "base" || isPop) && ( 基础护理 {BaseList.map((item: any, index: any) => { return ( NEW {item.modeName} {item.modeTimeStr === "00:00" ? "--:--" : item.modeTimeStr} {activeModeID === item.id && ( )} {activeModeID === item.id && ( )} ); })} )} {ZoneList.length > 0 && (ModeType === "all" || ModeType === "zone" || isPop) && ( 专区护理 {ZoneList.map((item: any, index: any) => { return ( NEW {item.modeName} {item.modeTimeStr} {activeModeID === item.id && ( )} {activeModeID === item.id && ( )} ); })} )} {PermeationList.length > 0 && (ModeType === "all" || ModeType === "permeation" || isPop) && ( 专研促渗 {PermeationList.map((item: any, index: any) => { return ( NEW {item.modeName} {item.modeTimeStr} {activeModeID === item.id && ( )} {activeModeID === item.id && ( )} ); })} )} {SensitiveList.length > 0 && (ModeType === "all" || ModeType === "sensitive" || isPop) && ( 敏期护理 {PermeationList.map((item: any, index: any) => { return ( NEW {item.modeName} {item.modeTimeStr} {activeModeID === item.id && ( )} {activeModeID === item.id && ( )} ); })} )} {IntelligenceList.length > 0 && (ModeType === "all" || ModeType === "intelligence" || isPop) && ( 智能测肤 {IntelligenceList.map((item: any, index: any) => { return ( NEW {item.modeName} {item.modeTimeStr} {activeModeID === item.id && ( )} {activeModeID === item.id && ( )} ); })} )} ); } export default Index;