|
|
|
|
|
|
|
|
import navBgCar from "./components/nav-bg-car3"; |
|
|
import navBgCar from "./components/nav-bg-car3"; |
|
|
import navBar from "@/components/nav-bar/nav-bar2.vue"; |
|
|
import navBar from "@/components/nav-bar/nav-bar2.vue"; |
|
|
import viewfinder from "../../components/viewfinder.vue" |
|
|
import viewfinder from "../../components/viewfinder.vue" |
|
|
import { |
|
|
|
|
|
pathToBase64 |
|
|
|
|
|
} from "@/utils/image-tools/index.js"; |
|
|
|
|
|
import { |
|
|
import { |
|
|
ocrAllQuery, |
|
|
ocrAllQuery, |
|
|
fileUpload, |
|
|
fileUpload, |
|
|
|
|
|
|
|
|
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
|
|
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
|
|
sourceType: ["camera", "album"], //从相册选择 |
|
|
sourceType: ["camera", "album"], //从相册选择 |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
uploadFile(res.tempFilePaths[0], 1, ocrAllQuery).then((data) => { |
|
|
|
|
|
|
|
|
uploadFile(res.tempFilePaths[0], "", ocrAllQuery).then((data) => { |
|
|
if (data.result) { |
|
|
if (data.result) { |
|
|
state.form.userName = stringToJson(data.result |
|
|
state.form.userName = stringToJson(data.result |
|
|
.businessLicense)[ |
|
|
.businessLicense)[ |
|
|
|
|
|
|
|
|
state.form.userIdNum = stringToJson(data.result |
|
|
state.form.userIdNum = stringToJson(data.result |
|
|
.businessLicense)[ |
|
|
.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 = () => { |
|
|
const camera = () => { |
|
|
state.phoneType = 0 |
|
|
state.phoneType = 0 |
|
|
} |
|
|
} |