// 选择头像
_image(item){
ImagePicker.showImagePicker(options,(response) => {
if(response.didCancel){
this.refs.toast.show('取消成功',500)
}
else if(response.error){
this.refs.toast.show(`response.error)`,500)
}
else if(response.customButton){
this.refs.toast.show('自定义按钮点击:' + response.customButton,500)
}
else{
let source = { uri: 'data:image/jpeg;base64,' + response.data };
item.image = source.uri;
this.setState({data: this.state.data})
}
})
}
extraData={this.state} 必须添加
每次修改之后,将 this.state.data 重新更新一次,即可