|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="ocr-all">
|
|
|
+ <div class="ocr-all" v-loading.fullscreen.lock="fullscreenLoading" element-loading-text="识别中">
|
|
|
<div style="color: #606266;font-size: 15px;font-weight: 600;">PS:选择图片后,点击要需要识别类型!</div>
|
|
|
<div class="ocr-box">
|
|
|
<el-upload
|
|
@@ -80,7 +80,8 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
disabled: false,
|
|
|
panduan:"",
|
|
|
- picBase64:''
|
|
|
+ picBase64:'',
|
|
|
+ fullscreenLoading:false,
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -129,29 +130,24 @@ export default {
|
|
|
let imgResult = ''
|
|
|
reader.readAsDataURL(file)
|
|
|
reader.onload = function () {
|
|
|
- imgResult = reader.result
|
|
|
+ imgResult = reader.result
|
|
|
}
|
|
|
- 3
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
reader.onerror = function (error) {
|
|
|
- reject(error)
|
|
|
+ reject(error)
|
|
|
}
|
|
|
reader.onloadend = function () {
|
|
|
- resolve(imgResult)
|
|
|
+ resolve(imgResult)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
//身份证人像面
|
|
|
IDcardR(){
|
|
|
+
|
|
|
+
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetIDCard"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
|
- that.fullscreenLoading = true;
|
|
|
this.$axios({
|
|
|
method: 'post',
|
|
|
url:url,
|
|
@@ -172,8 +168,10 @@ export default {
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
});
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -181,11 +179,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//身份证国徽面
|
|
|
IDcardG(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetIDCard"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -208,9 +208,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -218,11 +220,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//营业执照
|
|
|
license(){
|
|
|
+ this.fullscreenLoading=true;
|
|
|
var url="/api/TencentOCR/GetBizLicenseOCR"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -238,13 +242,14 @@ export default {
|
|
|
}
|
|
|
}).then(function(res){
|
|
|
if(res.data.code==200){
|
|
|
- console.log(res)
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
});
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading=false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -252,11 +257,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//统一信用代码
|
|
|
creditCode(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetOrgCodeCertOCR"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -276,9 +283,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -286,11 +295,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//行驶证
|
|
|
driving(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetVehicleLicense"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -311,9 +322,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -321,11 +334,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//户口本
|
|
|
household(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetResidenceBookletOCR"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -345,9 +360,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -355,11 +372,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//房产证
|
|
|
deed(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetPropOwnerCert"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -379,9 +398,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -389,11 +410,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
this.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//结婚证
|
|
|
Marriage(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetMarriageLicense"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -413,9 +436,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -423,11 +448,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- this.$message.error('请检查图片是否为此类型!');
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ that.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
- //结婚证
|
|
|
+ //大陆护照
|
|
|
mainlandPassport(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetPassport"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -447,9 +474,11 @@ export default {
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
- });
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ });
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -457,11 +486,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- this.$message.error('请检查图片是否为此类型!');
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ that.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
//通用印刷体
|
|
|
universal(){
|
|
|
+ this.fullscreenLoading = true;
|
|
|
var url="/api/TencentOCR/GetGeneralBasic"
|
|
|
var that=this
|
|
|
if(that.panduan){
|
|
@@ -482,8 +513,10 @@ export default {
|
|
|
message: res.data.msg,
|
|
|
type: 'success'
|
|
|
});
|
|
|
- // window.open(res.data.data.downUrl)
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ window.open(res.data.data.url)
|
|
|
}else{
|
|
|
+ that.fullscreenLoading = false;
|
|
|
that.$message({
|
|
|
message: res.data.msg,
|
|
|
type: 'warning'
|
|
@@ -491,7 +524,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- this.$message.error('请检查图片是否为此类型!');
|
|
|
+ that.fullscreenLoading = false;
|
|
|
+ that.$message.error('请检查图片是否为此类型!');
|
|
|
}
|
|
|
},
|
|
|
},
|