// 用input[file]上传图片
upLoadImg=(e)=>{
console.log(e.currentTarget.files[0]);
let file=e.currentTarget.files[0]
let url = null ;
// 获取图片上传的绝对路径
if (window.createObjectURL!=undefined) { // basic
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) { // mozilla(firefox)
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) { // webkit or chrome
url = window.webkitURL.createObjectURL(file) ;
}
let tempData=[...this.state.prizeuserdata];
tempData.push({
id: '',
url:url
});
this.setState({
prizeuserdata:[...tempData]
})
};