import React, { Component } from "react"; import { Modal, Icon, Upload } from "antd"; import { timingSafeEqual } from "crypto"; import ImgList from "../../../../common/imgList"; class PicturesWall extends Component { constructor(props) { super(props); this.state = { previewVisible: false, previewImage: "", fileList: this.props.pictureUrl }; this.handleCancel = this.handleCancel.bind(this); this.handleChange = this.handleChange.bind(this); this.handlePreview = this.handlePreview.bind(this); } handleCancel() { this.setState({ previewVisible: false }); } handlePreview(file) { this.setState({ previewImage: file.url || file.thumbUrl, previewVisible: true }); } handleChange(info) { let fileList = info.fileList; this.setState({ fileList }); this.props.fileList(fileList); } componentWillReceiveProps(nextProps) { this.state.fileList = nextProps.pictureUrl; this.state.pojectApplicationUrl = undefined; } render() { const { previewVisible, previewImage, fileList } = this.state; const uploadButton = (
点击上传
); return (
{ this.handleChange(infor) }} fileList={fileList} />
); } } export default PicturesWall;