12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 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 = {
- fileList: this.props.pictureUrl
- };
- this.handleChange = this.handleChange.bind(this);
- }
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({
- fileList
- });
- this.props.fileList(fileList);
- }
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- }
- render() {
- const { fileList } = this.state;
- const { orderNo = undefined, bindId = undefined, deleteApi = "", sign = "" } = this.props
- return (
- <div style={{ display: "inline-block" }}>
- <ImgList
- deleteApi={deleteApi} // 删除图片接口
- orderNo={orderNo} // 用于订单上传绑定,不是订单上传不需要传
- bindId={bindId} // 绑定的编号
- sign={sign}
- domId={this.props.domId}
- uploadConfig={{
- action: globalConfig.context + this.props.url,
- data: {
- orderNo: orderNo,
- sign: this.props.sign,
- },
- multiple: true,
- listType: "picture-card",
- }}
- onChange={(infor) => {
- this.handleChange(infor)
- }}
- fileList={fileList}
- />
- </div>
- );
- }
- }
- export default PicturesWall;
|