From 8afbe0b83915dc417cea62221782e7ce15c00c78 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期一, 04 十二月 2023 17:19:42 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before --- src/views/quality/rawMaterial/QrcodeReader.vue | 77 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) diff --git a/src/views/quality/rawMaterial/QrcodeReader.vue b/src/views/quality/rawMaterial/QrcodeReader.vue new file mode 100644 index 0000000..2dbdff2 --- /dev/null +++ b/src/views/quality/rawMaterial/QrcodeReader.vue @@ -0,0 +1,77 @@ +<template> + <div class="qrcode"> + <div class="code"> + <!-- decode鏄壂鎻忕粨鏋滅殑鍑芥暟锛宼orch鐢ㄤ簬鏄惁闇�瑕佹墦寮�鎵嬬數绛掞紝init鐢ㄤ簬妫�鏌ヨ璁惧鏄惁鑳藉璋冪敤鎽勫儚澶寸殑鏉冮檺锛宑amera鍙敤浜庢墦寮�鍓嶉潰鎴栬�呭悗闈㈡憚鍍忓ご --> + <qrcode-drop-zone @decode="onDecode"> + <qrcode-stream @decode="onDecode" :torch="torchActive" @init="onInit" :camera="camera" /> + </qrcode-drop-zone> + <div class="code-button"> + <button @click="switchCamera">鐩告満鍙嶈浆</button> + <button @click="ClickFlash">鎵撳紑鎵嬬數绛�</button> + <button @click="turnCameraOff">鍏抽棴鐩告満</button> + </div> + </div> + </div> + </template> + + <script> + // 寮曠敤vue-qrcode-reader鎻掍欢 + import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from 'vue-qrcode-reader' + + export default { + name: 'Approve', + props: { + camera: { + type: String, + default: 'rear', + }, + torchActive: { + type: Boolean, + default: false, + }, + qrcode: { + type: Boolean, + default: false, + }, + noStreamApiSupport: { + type: Boolean, + default: false, + }, + }, + data() { + return {} + }, + created() { + console.log(222222222222224564646); + }, + + components: { + // 娉ㄥ唽缁勪欢 + QrcodeStream, + QrcodeDropZone, + QrcodeCapture, + }, + methods: { + // 鎵爜缁撴灉鍥炶皟 + onDecode(result) { + this.$emit('onDecode', result) + }, + // 鐩告満鍙嶈浆 + switchCamera() { + this.$emit('switchCamera') + }, + // 鍏抽棴鐩告満锛燂紵锛燂紵锛燂紵 + turnCameraOff() { + this.$emit('turnCameraOff') + }, + // 鎵撳紑鎵嬬數绛� + ClickFlash() { + this.$emit('ClickFlash') + }, + // 妫�鏌ユ槸鍚﹁皟鐢ㄦ憚鍍忓ご + onInit(promise) { + this.$emit('onInit', promise) + }, + }, + } + </script> \ No newline at end of file -- Gitblit v1.9.3