Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xugong
hls-xcmg-vue-app
Commits
e948e710
Commit
e948e710
authored
Nov 20, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'增加合格证识别'
parent
26563110
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
2 deletions
+73
-2
add-car.vue
src/pages/contractStart/add-car.vue
+73
-2
No files found.
src/pages/contractStart/add-car.vue
View file @
e948e710
...
...
@@ -9,8 +9,8 @@
</div>
<div
class=
"down-content"
>
<span>
请上传照片
</span>
<div
class=
"photo"
>
<
!--
<img
src=
""
>
--
>
<div
class=
"photo"
@
click=
"ocrShow()"
>
<
img
v-if=
"vehicleImg"
:src=
"vertifyImg"
alt=
""
>
</div>
<list-item
:item-height=
"44"
>
<item>
...
...
@@ -313,6 +313,7 @@ export default {
bp_id
:
''
,
},
equip
:
[],
vehicleImg
:
''
,
}
},
computed
:
{
...
...
@@ -359,6 +360,76 @@ export default {
})
},
methods
:
{
// ocr识别入口
ocrShow
()
{
let
vm
=
this
hlsPopup
.
showActionSheet
({
titleText
:
'请选择照片'
,
buttonArray
:
[
'拍照'
,
'从相册取'
],
callback
:
index
=>
{
if
(
index
===
0
)
{
vm
.
openCamera
()
}
else
{
vm
.
takePicture
()
}
},
})
},
openCamera
()
{
let
vm
=
this
let
cameraoptions
=
{
quality
:
60
,
width
:
1843
,
height
:
1382
,
}
let
success
=
function
(
imgdata
)
{
if
(
!
imgdata
)
{
hlsPopup
.
showLongCenter
(
'请拍照'
)
}
else
{
vm
.
vehicleImg
=
imgdata
vm
.
vehicleIdentify
(
imgdata
)
}
}
let
error
=
function
()
{
hlsPopup
.
showLongCenter
(
error
)
}
hlsUtil
.
openCamera
(
cameraoptions
,
success
,
error
)
},
takePicture
()
{
let
vm
=
this
var
cameraoptions
=
{
quality
:
70
,
width
:
1843
,
height
:
1382
,
maxCount
:
1
,
}
let
success
=
function
(
imgUrl
)
{
if
(
imgUrl
.
length
===
0
)
{
hlsPopup
.
showLongCenter
(
'请选择一张图片'
)
}
else
{
vm
.
vehicleImg
=
imgUrl
[
0
]
vm
.
vehicleIdentify
(
imgUrl
[
0
])
}
}
let
error
=
function
()
{
hlsPopup
.
showLongCenter
(
error
)
}
vm
.
hlsUtil
.
takePicture
(
cameraoptions
,
success
,
error
)
},
// 合格证识别
vehicleIdentify
(
fileUrl
)
{
let
vm
=
this
hlsPopup
.
showLoading
(
'正在识别'
)
let
url
=
process
.
env
.
ocrPath
+
'/baidu/ocr/vehicle_certificate'
hlsUtil
.
baiduOcr
(
fileUrl
,
url
,
function
(
res
)
{
hlsPopup
.
hideLoading
()
let
result
=
res
.
result
.
words_result
vm
.
frame_number
=
result
.
VinNo
// 车架号
vm
.
engine
=
result
.
EngineNo
// 发动机号
//vm.vehicle_model = result.VinNo // 车辆型号
vm
.
certificate_number
=
result
.
CertificationNo
// 合格证编号
})
},
showTime
(
format
)
{
this
.
hlsPopup
.
showTime
({
nowDate
:
`
${
this
.
carDate
}
`
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment