Browse Source

扫码页返回按钮样式

master
蟑螂恶霸 2 years ago
parent
commit
f8e4c53c9f
  1. 105
      src/views/enforce/scanPage.vue

105
src/views/enforce/scanPage.vue

@ -1,5 +1,6 @@
<template>
<div class="page bgc-f4f4f4">
<label class="backlab" @click="back()"></label>
<div class="video-show" />
<video id="video" ref="video" class="video vjs-fluid" autoplay />
<span class="change" @click="change">
@ -43,25 +44,25 @@ export default {
const that = this;
// datanew
that.codeReader
.getVideoInputDevices()
.then(videoInputDevices => {
console.log(videoInputDevices)
// videoInputDevices
this.videoLength = videoInputDevices.length;
// numdata
const firstDeviceId = videoInputDevices[that.num].deviceId;
//
that.decodeFromInputVideoFunc(
firstDeviceId,
videoInputDevices.length
);
})
//
.catch(err => {
this.num = 1;
that.openScan();
console.error(err);
});
.getVideoInputDevices()
.then(videoInputDevices => {
console.log(videoInputDevices)
// videoInputDevices
this.videoLength = videoInputDevices.length;
// numdata
const firstDeviceId = videoInputDevices[that.num].deviceId;
//
that.decodeFromInputVideoFunc(
firstDeviceId,
videoInputDevices.length
);
})
//
.catch(err => {
this.num = 1;
that.openScan();
console.error(err);
});
},
//openScanid
decodeFromInputVideoFunc(firstDeviceId, length) {
@ -70,35 +71,35 @@ export default {
that.textContent = null; //
//
that.codeReader.decodeFromInputVideoDeviceContinuously(
firstDeviceId,
"video",
(result, err) => {
that.textContent = null;
// result
if (result) {
that.textContent = result;
//
if (that.textContent) {
setTimeout(() => {
window.location.href = that.textContent;
//
that.textContent = null;
that.codeReader && that.codeReader.reset();
}, 100);
firstDeviceId,
"video",
(result, err) => {
that.textContent = null;
// result
if (result) {
that.textContent = result;
//
if (that.textContent) {
setTimeout(() => {
window.location.href = that.textContent;
//
that.textContent = null;
that.codeReader && that.codeReader.reset();
}, 100);
}
}
}
//
if (err && !err) {
this.num++;
setTimeout(() => {
that.tipShow = false;
}, 2000);
if (this.num <= length) {
that.openScan();
//
if (err && !err) {
this.num++;
setTimeout(() => {
that.tipShow = false;
}, 2000);
if (this.num <= length) {
that.openScan();
}
console.error(err);
}
console.error(err);
}
}
);
},
//
@ -130,6 +131,20 @@ export default {
<style scoped>
.backlab {
position: absolute;
z-index: 999999;
top: 0.5rem;
left: 0.35rem;
padding-left: 0;
width: 0.6rem;
height: 0.6rem;
background: url(../../assets/images/icon_arbw.png) no-repeat left 40% center;
background-size: auto 50%;
background-color: rgba(255, 255, 255, .2);
border: 1px solid rgba(255, 255, 255, .7);
border-radius: 50%;
}
.video {
width: 100vw;
height: 100vh;

Loading…
Cancel
Save