import React from "react"; import { Spin, Button, Tabs, Table, message, Modal, Upload, Tooltip, } from "antd"; import { splitUrl } from "@/tools"; import "./remove.less" const PicModal = React.createClass({ getInitialState() { return { newVisible: false, rotateDeg: 0, }; }, componentWillReceiveProps(nextProps) { this.setState({ newVisible: nextProps.ShowModal, }); }, handleOk() { this.setState({ newVisible: false, }); // window.setTimeout( () => { // this.setState({ // newVisible: true // }); // },) }, downImg() { let num = 0; for (let i = 0; i < this.props.picUrl.length; i++) { if (globalConfig.avatarHost + "/upload" + this.props.picUrl[i] == this.state.previewImage) { num = i; } } if (num == this.props.picUrl.length - 1) { return message.warning("已经是最后一张了哦"); } this.state.previewImage = globalConfig.avatarHost + "/upload" + this.props.picUrl[num + 1]; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); }, upImg() { let num = 0; for (let i = 0; i < this.props.picUrl.length; i++) { if (globalConfig.avatarHost + "/upload" + this.props.picUrl[i] == this.state.previewImage) { num = i; } } if (num == 0) { return message.warning("已经是第一张了哦"); } this.state.previewImage = globalConfig.avatarHost + "/upload" + this.props.picUrl[num - 1]; this.setState({ previewImage: this.state.previewImage, rotateDeg: 0 }); }, rotate() { let rotateDeg = this.state.rotateDeg + 90; this.setState({ rotateDeg }); }, render() { return (