From f6dc8ea98bb123f35730fc07ab74d22cb13057fc Mon Sep 17 00:00:00 2001
From: zhoulinf <2507241354@qq.com>
Date: Tue, 4 Aug 2026 18:58:15 +0800
Subject: [PATCH] =?UTF-8?q?CRM=5F26-08-05#story#9126,=E8=BD=A6=E8=BE=86?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E3=80=81=E6=9C=8D=E5=8A=A1=E5=95=86=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E7=B3=BB=E7=BB=9F=E9=9C=80=E6=B1=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/CameraGuide.vue | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/components/CameraGuide.vue b/src/components/CameraGuide.vue
index ff039889..1300d258 100644
--- a/src/components/CameraGuide.vue
+++ b/src/components/CameraGuide.vue
@@ -2,7 +2,7 @@
@@ -154,6 +154,7 @@ export default {
return {
step: 'guide', // guide 拍摄引导 | preview 预览确认
stream: null,
+ cameraReady: false,
previewBlob: null,
previewDataURL: '',
barcodeBars: heights
@@ -173,7 +174,13 @@ export default {
this.step = 'guide'
this.previewBlob = null
this.previewDataURL = ''
- this.$nextTick(() => this.startCamera())
+ 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()
+ })
} else {
this.stopCamera()
}
@@ -184,6 +191,7 @@ export default {
},
methods: {
async startCamera() {
+ this.cameraReady = false
try {
const stream = await navigator.mediaDevices.getUserMedia({
video: { facingMode: 'environment' },
@@ -573,6 +581,9 @@ export default {
&:active {
transform: scale(.92);
}
+ &.shootBtnDisabled {
+ opacity: .45;
+ }
&::after {
content: '';
position: absolute;