@@ -247,54 +247,39 @@ | |||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | |||
sourceType: ["camera", "album"], //从相册选择 | |||
success: function (res) { | |||
pathToBase64(res.tempFilePaths[0]) | |||
.then((path) => { | |||
var data = { | |||
type: 'business_license', | |||
base64: path, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(ocrAllQuery, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log("营业执照", data) | |||
if (data.result) { | |||
state.form.url2 = ''; | |||
state.form.companyName = stringToJson(data.result | |||
.businessLicense)[ | |||
'名称']; | |||
state.form.code = stringToJson(data.result | |||
.businessLicense)[ | |||
'统一社会信用代码']; | |||
cardFileImageUpdateyy(path) | |||
} | |||
}); | |||
}) | |||
.catch((error) => { }); | |||
uploadFile(res.tempFilePaths[0], "", ocrAllQuery).then((data) => { | |||
if (data.result) { | |||
state.form.url2 = ''; | |||
state.form.companyName = stringToJson(data.result | |||
.businessLicense)[ | |||
'名称']; | |||
state.form.code = stringToJson(data.result | |||
.businessLicense)[ | |||
'统一社会信用代码']; | |||
uploadFile(res.tempFilePaths[0], "", "").then((data) => { | |||
state.form.url1 = data; | |||
}) | |||
} | |||
}) | |||
}, | |||
}); | |||
}; | |||
//委托书获取图片给后端 | |||
const cardFileImageUpdateyy = (val : any) => { | |||
var data = { | |||
fileBase64: val, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(fileUpload, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
state.form.url1 = data.data.url; | |||
}); | |||
}; | |||
// const cardFileImageUpdateyy = (val : any) => { | |||
// var data = { | |||
// fileBase64: val, | |||
// }; | |||
// const options = { | |||
// type: 2, | |||
// data: data, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(fileUpload, options).then((res) => { | |||
// const data = stringToJson(res.bizContent); | |||
// state.form.url1 = data.data.url; | |||
// }); | |||
// }; | |||
const shiqu = () => { | |||
console.log("state.form.handlerPhone", state.form.handlerPhone) | |||
} |
@@ -115,9 +115,6 @@ | |||
import navBgCar from "./components/nav-bg-car3"; | |||
import navBar from "@/components/nav-bar/nav-bar2.vue"; | |||
import viewfinder from "../../components/viewfinder.vue" | |||
import { | |||
pathToBase64 | |||
} from "@/utils/image-tools/index.js"; | |||
import { | |||
ocrAllQuery, | |||
fileUpload, | |||
@@ -318,7 +315,7 @@ | |||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | |||
sourceType: ["camera", "album"], //从相册选择 | |||
success: function (res) { | |||
uploadFile(res.tempFilePaths[0], 1, ocrAllQuery).then((data) => { | |||
uploadFile(res.tempFilePaths[0], "", ocrAllQuery).then((data) => { | |||
if (data.result) { | |||
state.form.userName = stringToJson(data.result | |||
.businessLicense)[ | |||
@@ -326,55 +323,15 @@ | |||
state.form.userIdNum = stringToJson(data.result | |||
.businessLicense)[ | |||
'统一社会信用代码']; | |||
cardFileImageUpdateyy(path) | |||
uploadFile(res.tempFilePaths[0], "", "").then((data) => { | |||
state.form.posImgUrl = data; | |||
}) | |||
} | |||
}) | |||
// pathToBase64(res.tempFilePaths[0]) | |||
// .then((path) => { | |||
// var data = { | |||
// type: 'business_license', | |||
// base64: path, | |||
// }; | |||
// const options = { | |||
// type: 2, | |||
// data: data, | |||
// method: "POST", | |||
// showLoading: true, | |||
// }; | |||
// request(ocrAllQuery, options).then((res) => { | |||
// const data = stringToJson(res.bizContent); | |||
// if (data.result) { | |||
// state.form.userName = stringToJson(data.result | |||
// .businessLicense)[ | |||
// '名称']; | |||
// state.form.userIdNum = stringToJson(data.result | |||
// .businessLicense)[ | |||
// '统一社会信用代码']; | |||
// cardFileImageUpdateyy(path) | |||
// } | |||
// }); | |||
// }) | |||
// .catch((error) => { }); | |||
}, | |||
}); | |||
}; | |||
//委托书获取图片给后端 | |||
const cardFileImageUpdateyy = (val : any) => { | |||
var data = { | |||
fileBase64: val, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(fileUpload, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
state.form.posImgUrl = data.data.url; | |||
}); | |||
}; | |||
const camera = () => { | |||
state.phoneType = 0 | |||
} |