Commit 3812693b authored by youjie's avatar youjie
parents 6cad16c5 8adff23a
......@@ -439,11 +439,11 @@
</div>
<div class="contPic">
<div class="contPicNav">
<li @click="templateType=1" :class="{active:templateType==1}">
<li @click="templateType=1,changeType()" :class="{active:templateType==1}">
身份证
<div v-show="templateType==1"></div>
</li>
<li @click="templateType=2" :class="{active:templateType==2}">
<li @click="templateType=2,changeType()" :class="{active:templateType==2}">
护照
<div v-show="templateType==2"></div>
</li>
......@@ -467,7 +467,7 @@
</label>
</div>
<input type="button" value="开始识别" class="normalBtn" @click="commonTextDiscern" />
<br/>
<br />
<span style="color:red;font-weight:bold">请认真核对识别结果,如有不正确的请手动调整。</span>
</div>
</div>
......@@ -967,6 +967,10 @@
},
//OCR识别
commonTextDiscern() {
if (this.imgBase64String == '') {
this.Error("请选择图片!");
return;
}
let params = {
base64: "",
Type: 1, //1-中国大陆护照,2-身份证
......@@ -1043,8 +1047,18 @@
}
}
}
}, faild => {
this.loading = false;
});
},
//识别类型切换
changeType() {
let preview = document.getElementById("img");
preview.src = "";
this.imgBase64String = '';
let file = document.getElementById("file");
file.value = '';
},
onUpload(val) {
let preview = document.getElementById("img");
let file = document.getElementById("file").files[0];
......@@ -1061,6 +1075,7 @@
quality: 0.7
}).then(res => {
this.imgBase64String = res.base64.slice(23);
this.commonTextDiscern();
});
},
goBack() {
......
......@@ -1028,7 +1028,7 @@ export default {
if (successCall) {
successCall(res)
}
})
},faildCall)
},
//Blob文件上传
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
......@@ -1141,18 +1141,7 @@ export default {
var newpath = path.replace('http://192.168.10.214:8130', '').replace('https://imgfile.oytour.com', '').replace('https://imgfile.oytour.com', '').split('?')[0];
return url + '/image/index?filePath=' + newpath + '&process=resize,' + poise + ',w_' + w + ',h_' + h;
}
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData();
formData.append("myfile", files[0]);
that.$http.post(uploadUrl, formData, {
'Content-Type': 'multipart/form-data'
})
.then(res => {
successCall(res);
})
},
//验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function (item, filed, isMinus) {
......
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