Commit 1d9534e4 by hank

Merge branch 'develop' of gitlab.maxrocky.com:visualcloud/Vmatrix-device-start into develop

parents ac17eb37 e092f1c6
......@@ -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 => {
......
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 sign in to comment