Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BCDH-APP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
首开风险隐患双控平台
BCDH-APP
Commits
9d5590d6
Commit
9d5590d6
authored
Dec 27, 2021
by
罗新东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了扫码
parent
40748dba
Pipeline
#7653
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
src/components/QrCodeReader.vue
src/components/QrCodeReader.vue
+10
-14
No files found.
src/components/QrCodeReader.vue
View file @
9d5590d6
...
...
@@ -5,9 +5,8 @@
@
click=
"$router.back()"
:src=
"require('../assets/back.png')"
/>
<
!--
<p
class=
"error"
>
{{
error
}}
</p>
--
>
<
p
class=
"error"
>
{{
error
}}
</p
>
<!--错误信息-->
<!--
<p
class=
"decode-result"
>
扫描结果:
<b>
{{
result
}}
</b>
...
...
@@ -19,11 +18,9 @@
<p
@
click=
"openFlash"
>
打开手电筒
</p>
<p
@
click=
"switchCamera"
>
相机反转
</p>
</div>
-->
<qrcode-stream
v-show=
"qrcode"
:camera=
"camera"
:torch=
"torchActive"
@
decode=
"onDecode"
@
init=
"onInit"
>
...
...
@@ -53,7 +50,6 @@ import { QrcodeStream } from "vue-qrcode-reader";
export
default
{
// 注册
components
:
{
QrcodeStream
},
data
()
{
return
{
result
:
""
,
// 扫码结果信息
...
...
@@ -73,12 +69,11 @@ export default {
this
.
$emit
(
'
success
'
,
result
)
},
async
onInit
(
promise
)
{
const
{
capabilities
}
=
await
promise
;
//
const { capabilities } = await promise;
const
TORCH_IS_SUPPORTED
=
!!
capabilities
.
torch
;
try
{
await
promise
;
}
catch
(
error
)
{
// const TORCH_IS_SUPPORTED = !!capabilities.torch;
promise
.
catch
(
error
=>
{
// alert(1111)
if
(
error
.
name
===
"
NotAllowedError
"
)
{
this
.
error
=
"
ERROR: 您需要授予相机访问权限
"
;
}
else
if
(
error
.
name
===
"
NotFoundError
"
)
{
...
...
@@ -92,7 +87,8 @@ export default {
}
else
if
(
error
.
name
===
"
StreamApiNotSupportedError
"
)
{
this
.
error
=
"
ERROR: 此浏览器不支持流API
"
;
}
}
// console.log(error.name)
})
},
// 打开相机
// openCamera() {
...
...
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