Commit aad7cc0a authored by youjie's avatar youjie

文件压缩上传

parent 9d8f23eb
...@@ -36,7 +36,10 @@ export default { ...@@ -36,7 +36,10 @@ export default {
uni.showLoading({ uni.showLoading({
title: "上传中", title: "上传中",
}); });
that.upFile(res.tempFilePaths[0], (uploadRes) => { uni.getImageInfo({
src: res.tempFilePaths[0],
success: function(image) {
that.upFile(image.path, (uploadRes) => {
let BusinessLicense = JSON.parse( let BusinessLicense = JSON.parse(
uploadRes.data uploadRes.data
); );
...@@ -44,19 +47,16 @@ export default { ...@@ -44,19 +47,16 @@ export default {
url: '', url: '',
name: '' name: ''
} }
// console.log('图片名称:',BusinessLicense);
const tempFilePath = BusinessLicense.FileName; const tempFilePath = BusinessLicense.FileName;
infor.name = tempFilePath; infor.name = tempFilePath;
infor.url = that.hostErpFile+BusinessLicense.FilePath infor.url = that.hostErpFile+BusinessLicense.FilePath
that.$emit('onSuccess', infor); that.$emit('onSuccess', infor);
// console.log("infor", infor);
},err=>{ },err=>{
uni.hideLoading() uni.hideLoading()
}); });
console.log("res.tempFilePaths[0]",res.tempFilePaths[0]); console.log("res.tempFilePaths[0]",res.tempFilePaths[0]);
}
});
}, },
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment