From a52a8cc4042fed687266a7ef4a69507c103efb22 Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Thu, 4 Jun 2026 16:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E7=A0=81=E9=A1=B5:=E6=94=B9=E5=9B=9E.?= =?UTF-8?q?vue(WebView)+plus.barcode,=E5=85=A8=E9=80=8F=E6=98=8E=E6=97=A0?= =?UTF-8?q?=E5=8F=96=E6=99=AF=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + pages.json | 5 +---- pages/upload/{scan-isbn.nvue => scan-isbn.vue} | 8 +++++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename pages/upload/{scan-isbn.nvue => scan-isbn.vue} (95%) diff --git a/.gitignore b/.gitignore index 2370852..5263955 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ unpackage/ .hbuilderx/ +hybrid/ .DS_Store diff --git a/pages.json b/pages.json index 6f964e8..b813f0b 100644 --- a/pages.json +++ b/pages.json @@ -58,10 +58,7 @@ "path": "pages/upload/scan-isbn", "style": { "navigationBarTitleText": "", - "navigationStyle": "custom", - "app-plus": { - "render": "native" - } + "navigationStyle": "custom" } } ], diff --git a/pages/upload/scan-isbn.nvue b/pages/upload/scan-isbn.vue similarity index 95% rename from pages/upload/scan-isbn.nvue rename to pages/upload/scan-isbn.vue index 4eaf0a5..ab1beeb 100644 --- a/pages/upload/scan-isbn.nvue +++ b/pages/upload/scan-isbn.vue @@ -15,8 +15,10 @@ scanned: false } }, - onReady() { - this.initBarcode() + mounted() { + this.$nextTick(() => { + this.initBarcode() + }) }, onUnload() { this.destroyBarcode() @@ -27,7 +29,6 @@ uni.showToast({ title: '扫码初始化失败', icon: 'none' }) return } - // 创建原生条码扫描控件,全透明无取景框 var options = { top: '0px', left: '0px', @@ -80,6 +81,7 @@ flex: 1; background-color: #000; position: relative; + overflow: hidden; } .barcode-container { position: absolute;