let that = this
const requrl = this.requesturl
uni.chooseImage({
count:1,
success: (chooseImageRes) => {
const files = chooseImageRes.tempFilePaths;
let arr = []
uni.showLoading({
title: '上传中'
});
uni.uploadFile({
url: requrl+'/appapi/fujian/file',
filePath: files[0],
name: 'file',
success: (uploadFileRes) => {
that.fileurl = JSON.parse(uploadFileRes.data).data
that.imgsrc = requrl + that.fileurl
this.$emit('geturl',this.fileurl,this.field)
uni.hideLoading()
uni.showToast({
title:'上传成功',
duration:1000,
icon:"none"
})
},
file:(err) => {
uni.hideLoading()
uni.showToast({
title:'上传失败',
duration:1000,
icon:"none"
})
}
});
``` }```
``` });```
1 个回复
f***@163.com - 1
你好 现在这个问题解决了吗 我现在也是碰到这个