diff --git a/src/components/CameraGuide.vue b/src/components/CameraGuide.vue index 1300d258..ff039889 100644 --- a/src/components/CameraGuide.vue +++ b/src/components/CameraGuide.vue @@ -2,7 +2,7 @@
- +
@@ -107,7 +107,7 @@
-
+
点击拍照
@@ -154,7 +154,6 @@ export default { return { step: 'guide', // guide 拍摄引导 | preview 预览确认 stream: null, - cameraReady: false, previewBlob: null, previewDataURL: '', barcodeBars: heights @@ -174,13 +173,7 @@ export default { this.step = 'guide' this.previewBlob = null this.previewDataURL = '' - this.$nextTick(() => { - // 提升到 body 下渲染:避免在 overflow 滚动容器内 fixed 元素的合成层排序异常(部分 WebView 会被页面导航栏盖住) - if (this.$el && this.$el.nodeType === 1 && this.$el.parentNode !== document.body) { - document.body.appendChild(this.$el) - } - this.startCamera() - }) + this.$nextTick(() => this.startCamera()) } else { this.stopCamera() } @@ -191,7 +184,6 @@ export default { }, methods: { async startCamera() { - this.cameraReady = false try { const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' }, @@ -581,9 +573,6 @@ export default { &:active { transform: scale(.92); } - &.shootBtnDisabled { - opacity: .45; - } &::after { content: ''; position: absolute;