Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-device-start
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1d9534e4
authored
Nov 15, 2019
by
hank
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of gitlab.maxrocky.com:visualcloud/Vmatrix-device-start into develop
parents
ac17eb37
e092f1c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
26 deletions
+22
-26
src/views/Home.vue
+22
-26
No files found.
src/views/Home.vue
View file @
1d9534e4
...
...
@@ -108,6 +108,27 @@ export default {
};
},
methods
:
{
getQrcode
()
{
// let qr_code = window.$jssdk("ble.connectId")
let
qr_code
=
window
.
$jssdk
(
"bind.qrcode"
);
if
(
!
qr_code
.
qrcode
)
{
setTimeout
(
this
.
getQrcode
,
1000
)
// getQrcode();
return
;
}
else
{
QRCode
.
toDataURL
(
JSON
.
stringify
(
qr_code
),
{
errorCorrectionLevel
:
"H"
,
width
:
500
,
height
:
500
})
.
then
(
url
=>
{
this
.
connectIdCode
=
url
;
})
.
catch
(
err
=>
{
console
.
error
(
err
);
});
}
},
toQRcode
()
{
QRCode
.
toDataURL
(
this
.
link
,
{
width
:
500
,
...
...
@@ -244,6 +265,7 @@ export default {
switch
(
value
)
{
case
"MAIN_INIT_QRCODE"
:
this
.
MAIN_INIT_QRCODE
();
this
.
getQrcode
();
this
.
showTitle
();
this
.
closeLoading
();
break
;
...
...
@@ -290,29 +312,6 @@ export default {
created
()
{
window
.
test
=
this
;
this
.
toQRcode
();
const
getQrcode
=
()
=>
{
// let qr_code = window.$jssdk("ble.connectId")
let
qr_code
=
window
.
$jssdk
(
"bind.qrcode"
);
if
(
!
qr_code
.
qrcode
)
{
setTimeout
(()
=>
{
getQrcode
()
},
1000
)
// getQrcode();
return
;
}
else
{
QRCode
.
toDataURL
(
JSON
.
stringify
(
qr_code
),
{
errorCorrectionLevel
:
"H"
,
width
:
500
,
height
:
500
})
.
then
(
url
=>
{
this
.
connectIdCode
=
url
;
})
.
catch
(
err
=>
{
console
.
error
(
err
);
});
}
};
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
window
.
jsbridge
)
{
reject
();
...
...
@@ -322,9 +321,6 @@ export default {
success
?
resolve
()
:
reject
();
};
}).
then
(()
=>
{
// let =
getQrcode
();
this
.
state
=
window
.
$jssdk
(
"app.page"
);
this
.
isConnected
=
window
.
$jssdk
(
"ble.isConnected"
);
window
.
$observer
(
"ble.onConnectionStateChange"
,
isConnected
=>
{
...
...
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