import classnames from "classnames"; import Taro from "@tarojs/taro"; import { Component } from "react"; import { Block, View, Image, Text, Button, PageMeta, Swiper, SwiperItem, } from "@tarojs/components"; import { Popup } from "@antmjs/vantui"; import "./popup.less"; import "./popup-step-tips.less"; import "./fade.css"; import { go } from "../../utils/traoAPI"; /** props * isLarge 是否大尺寸 * isShow 是否显示 * data 数据 * title 动态标题 * confirmButtonText 确定关闭按钮 * @confirm 关闭回调 * ***/ export default class PopupStepTips extends Component { constructor(props) { super(props); this.state = { name: "步骤介绍弹窗", // 当前IOT使用 current: 0, isLocal: false, // 是否缓存关闭,以后不再显示准备步骤 }; } async onLoad() {} componentDidMount() {} componentWillUnmount() {} componentDidShow() {} componentDidHide() {} initData = () => { if (this.props.siteData) { let arr = JSON.parse(JSON.stringify(this.props.siteData)); this.setState({ siteList: arr }); } }; onClose = () => { let { isLocal } = this.state; this.props.close({ isLocal }); }; onClickStop = (e) => { e.stopPropagation(); }; // onChange(event) { // const current = event.detail.current; // const { current: curCurrent } = this.state; // const { siteData } = this.props; // if (curCurrent + 2 === siteData.length && current + 1 === siteData.length) { // this.setState({ toRight: true }); // } // this.setState({ current }); // } onPrev = async () => { let { current } = this.state; this.setState({ current: current - 1 }); }; onNext = async () => { let { current } = this.state; if (current === this.props.data.length) { this.onClose(); } else { this.setState({ current: current + 1 }); } }; onChangeLocal = () => { let { isLocal } = this.state; this.setState({ isLocal: !isLocal }); }; render() { let { isShow, data, isLarge, title, content, confirmButtonText } = this.props; let { current, isLocal } = this.state; return ( {data.length > 0 ? data[current].openTitle : "暂无数据"} {/* {title && ( {title} )} */} {data.map((item, index) => { return ( {item.openContent} ); })} {data.length === 1 && ( )} {data.length > 1 && current === 0 && ( )} {data.length > 1 && ( )} {isLocal ? ( ) : ( )} 以后不再提示准备步骤 ); } }