Commit 3812693b authored by youjie's avatar youjie
parents 6cad16c5 8adff23a
...@@ -439,11 +439,11 @@ ...@@ -439,11 +439,11 @@
</div> </div>
<div class="contPic"> <div class="contPic">
<div class="contPicNav"> <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> <div v-show="templateType==1"></div>
</li> </li>
<li @click="templateType=2" :class="{active:templateType==2}"> <li @click="templateType=2,changeType()" :class="{active:templateType==2}">
护照 护照
<div v-show="templateType==2"></div> <div v-show="templateType==2"></div>
</li> </li>
...@@ -467,7 +467,7 @@ ...@@ -467,7 +467,7 @@
</label> </label>
</div> </div>
<input type="button" value="开始识别" class="normalBtn" @click="commonTextDiscern" /> <input type="button" value="开始识别" class="normalBtn" @click="commonTextDiscern" />
<br/> <br />
<span style="color:red;font-weight:bold">请认真核对识别结果,如有不正确的请手动调整。</span> <span style="color:red;font-weight:bold">请认真核对识别结果,如有不正确的请手动调整。</span>
</div> </div>
</div> </div>
...@@ -967,6 +967,10 @@ ...@@ -967,6 +967,10 @@
}, },
//OCR识别 //OCR识别
commonTextDiscern() { commonTextDiscern() {
if (this.imgBase64String == '') {
this.Error("请选择图片!");
return;
}
let params = { let params = {
base64: "", base64: "",
Type: 1, //1-中国大陆护照,2-身份证 Type: 1, //1-中国大陆护照,2-身份证
...@@ -1043,8 +1047,18 @@ ...@@ -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) { onUpload(val) {
let preview = document.getElementById("img"); let preview = document.getElementById("img");
let file = document.getElementById("file").files[0]; let file = document.getElementById("file").files[0];
...@@ -1061,6 +1075,7 @@ ...@@ -1061,6 +1075,7 @@
quality: 0.7 quality: 0.7
}).then(res => { }).then(res => {
this.imgBase64String = res.base64.slice(23); this.imgBase64String = res.base64.slice(23);
this.commonTextDiscern();
}); });
}, },
goBack() { goBack() {
......
...@@ -1028,7 +1028,7 @@ export default { ...@@ -1028,7 +1028,7 @@ export default {
if (successCall) { if (successCall) {
successCall(res) successCall(res)
} }
}) },faildCall)
}, },
//Blob文件上传 //Blob文件上传
Vue.prototype.uploadSelfBlob = function (path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
...@@ -1141,18 +1141,7 @@ export default { ...@@ -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]; 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; 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】 //验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function (item, filed, isMinus) { 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