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-instrument-upload-tips.less"; import "./fade.css"; import { go, goJump } from "../../utils/traoAPI"; /*** props * isLarge 是否大尺寸 * isShow 是否显示 * data 数据 * @confirm 关闭回调 * ***/ export default class PopupInstrumentUploadTips extends Component { constructor(props) { super(props); this.state = { name: "打卡介绍弹窗", current: 0, toRight: false, isClick: 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 = () => { this.props.close(); }; 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 }); } onFinish(event) { const { current } = event.detail; const { toRight, isClick } = this.state; const { siteData } = this.props; if (current === siteData.length - 1) { if (toRight || isClick) { this.setState({ toRight: false, isClick: false }); } else { // this.toHomePage(); } } } onPrev = async () => { let { current } = this.state; this.setState({ current: current - 1 }); }; onNext = async () => { let { current } = this.state; if (current === this.props.data.length - 1) { this.onClose(); } else { this.setState({ current: current + 1 }); } }; render() { let { isShow, data, isLarge, title } = this.props; let { current } = this.state; return ( {data.map((item, index) => { return ( current === index && ( {item.message} ) ); })} {data.length === 1 && ( )} {data.length > 1 && current === 0 && ( )} {data.length > 1 && current > 0 && ( )} ); } }