From 46b1da589f5d9aaabf8c87631bba5670e7caa9a0 Mon Sep 17 00:00:00 2001
From: Miao_Spring <539943419@qq.com>
Date: Mon, 27 Jan 2025 20:51:37 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AAqrg?=
=?UTF-8?q?b=E7=9A=84demo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/miaoQRScanner.vue | 5 +-
components/tools/miaoQRGBCode.vue | 81 ++++++++++++++++
pages/index.vue | 10 ++
pages/tools/QRGB.vue | 15 +++
pages/tools/QRGB/code.vue | 21 +++++
pages/tools/QRGB/scanner.vue | 149 ++++++++++++++++++++++++++++++
6 files changed, 278 insertions(+), 3 deletions(-)
create mode 100644 components/tools/miaoQRGBCode.vue
create mode 100644 pages/tools/QRGB.vue
create mode 100644 pages/tools/QRGB/code.vue
create mode 100644 pages/tools/QRGB/scanner.vue
diff --git a/components/miaoQRScanner.vue b/components/miaoQRScanner.vue
index bd60dc0..39e4645 100644
--- a/components/miaoQRScanner.vue
+++ b/components/miaoQRScanner.vue
@@ -21,12 +21,10 @@ let timer: any | undefined = undefined
const scannerResult = new Set()
-const getQRData = (videoFrame: VideoFrame): string | undefined => {
+const getQRData = (videoFrame: ImageBitmap ): string | undefined => {
const canvas = document.createElement('canvas')
// const canvas = testCtx.value!
- // @ts-ignore
canvas.width = videoFrame.width
- // @ts-ignore
canvas.height = videoFrame.height
// console.log(canvas.width, canvas.height)
const ctx = canvas.getContext('2d')
@@ -82,6 +80,7 @@ onMounted(async () => {
onBeforeUnmount(() => {
stream?.getTracks().forEach(track => track.stop())
+ clearInterval(timer)
})
diff --git a/components/tools/miaoQRGBCode.vue b/components/tools/miaoQRGBCode.vue
new file mode 100644
index 0000000..704a371
--- /dev/null
+++ b/components/tools/miaoQRGBCode.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index.vue b/pages/index.vue
index 5b5c147..98e266e 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -148,6 +148,16 @@ const PageContent = reactive([
}
]
},
+ {
+ name: 'QRGB',
+ description: '把三个二维码叠在一起,真是创创又新新啊',
+ nuxtLinks: [
+ {
+ name: 'link',
+ to: `/tools/QRGB`
+ }
+ ]
+ },
]
}, {
subTitle: '学习资料',
diff --git a/pages/tools/QRGB.vue b/pages/tools/QRGB.vue
new file mode 100644
index 0000000..a70119a
--- /dev/null
+++ b/pages/tools/QRGB.vue
@@ -0,0 +1,15 @@
+
+
+ code
+ scanner
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/tools/QRGB/code.vue b/pages/tools/QRGB/code.vue
new file mode 100644
index 0000000..a848d2b
--- /dev/null
+++ b/pages/tools/QRGB/code.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/tools/QRGB/scanner.vue b/pages/tools/QRGB/scanner.vue
new file mode 100644
index 0000000..f040e58
--- /dev/null
+++ b/pages/tools/QRGB/scanner.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
\ No newline at end of file