Commit 37e6c6d2 authored by youjie's avatar youjie

no message

parent fcfd4cc7
...@@ -75,6 +75,9 @@ export default { ...@@ -75,6 +75,9 @@ export default {
filePath: res.tempFilePaths[0], filePath: res.tempFilePaths[0],
encoding: "base64", //编码格式 encoding: "base64", //编码格式
success: (ans) => { success: (ans) => {
uni.showLoading({
title: "上传中",
});
if(that.type){ if(that.type){
that.getImgInfo(ans.data, that.access_token, (_res) => { that.getImgInfo(ans.data, that.access_token, (_res) => {
if (_res.data.direction == 1) { if (_res.data.direction == 1) {
...@@ -111,7 +114,15 @@ export default { ...@@ -111,7 +114,15 @@ export default {
} }
}); });
}else{ }else{
that.upFile(res.tempFilePaths[0]) that.upFile(res.tempFilePaths[0], (uploadRes) => {
let BusinessLicense = JSON.parse(
uploadRes.data
).data;
let infor = {}
infor.BusinessLicense = BusinessLicense
console.log("infor", infor);
that.$emit('onSuccess', infor);
});
console.log("res.tempFilePaths[0]",res.tempFilePaths[0]); console.log("res.tempFilePaths[0]",res.tempFilePaths[0]);
} }
}, },
...@@ -120,10 +131,7 @@ export default { ...@@ -120,10 +131,7 @@ export default {
}); });
}, },
//图片上传 //图片上传
upFile(filePath) { upFile(filePath,resCall) {
uni.showLoading({
title: "上传中",
});
let that = this; let that = this;
uni.uploadFile({ uni.uploadFile({
url: that.action, url: that.action,
...@@ -134,11 +142,8 @@ export default { ...@@ -134,11 +142,8 @@ export default {
}, },
success: (uploadFileRes) => { success: (uploadFileRes) => {
if (uploadFileRes.statusCode == 200) { if (uploadFileRes.statusCode == 200) {
let data = JSON.parse(uploadFileRes.data)
let infor = {}
infor.BusinessLicense = data.data
that.$emit('onSuccess', infor);
uni.hideLoading() uni.hideLoading()
resCall(uploadFileRes);
}else{ }else{
wx.showToast({ wx.showToast({
title: uploadFileRes.message, title: uploadFileRes.message,
......
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