弹框复用-删除上次上传的图片

dev_forum
caishi 6 years ago
parent c9d462a18f
commit fb8a5181a5

@ -30,7 +30,7 @@ class RealNameCertificationModal extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
fileList:[]
} }
} }
@ -38,6 +38,7 @@ class RealNameCertificationModal extends Component{
} }
setVisible = (visible) => { setVisible = (visible) => {
this.setState({ fileList:[] });
this.refs.modalWrapper.setVisible(visible) this.refs.modalWrapper.setVisible(visible)
} }
@ -119,6 +120,8 @@ class RealNameCertificationModal extends Component{
loading: false, loading: false,
})); }));
} }
let fileList = [...info.fileList];
this.setState({ fileList });
} }
render(){ render(){
@ -291,7 +294,7 @@ class RealNameCertificationModal extends Component{
<span className="idPic-uploader demoImg"> <span className="idPic-uploader demoImg">
<img src={`${certification == 1 ? authImg : jobImg}`} alt="avatar" style={{ maxHeight: '110px'}}/> <img src={`${certification == 1 ? authImg : jobImg}`} alt="avatar" style={{ maxHeight: '110px'}}/>
</span> </span>
<Dragger {...uploadProps2}> <Dragger {...uploadProps2} fileList = {this.state.fileList}>
{imageUrl2 ? {imageUrl2 ?
// <a href={imageUrl2} target="_blank" title="点击重新上传图片"></a> // <a href={imageUrl2} target="_blank" title="点击重新上传图片"></a>
<img src={imageUrl2} alt="avatar" style={{ maxHeight: '110px'}}/> <img src={imageUrl2} alt="avatar" style={{ maxHeight: '110px'}}/>

Loading…
Cancel
Save