Browse Source

全部提交

yxb
DESKTOP-2IO5MST\huting 1 year ago
parent
commit
a81f13cf13

+ 29
- 44
subpackage/after-sale/account-recharge/open-account.vue View File

sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["camera", "album"], //从相册选择 sourceType: ["camera", "album"], //从相册选择
success: function (res) { 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 = () => { const shiqu = () => {
console.log("state.form.handlerPhone", state.form.handlerPhone) console.log("state.form.handlerPhone", state.form.handlerPhone)
} }

+ 5
- 48
subpackage/orders/opening-account-unit.vue View File

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
} }

Loading…
Cancel
Save