From 1234bdfcd5c1d328838e3a582345f8e75a7b2a79 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期二, 26 十二月 2023 11:03:34 +0800
Subject: [PATCH] 	modified:   src/views/common/qrCodeApp.vue 	modified:   vue.config.js

---
 src/views/common/qrCodeApp.vue |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/src/views/common/qrCodeApp.vue b/src/views/common/qrCodeApp.vue
index ef13928..2e5ef67 100644
--- a/src/views/common/qrCodeApp.vue
+++ b/src/views/common/qrCodeApp.vue
@@ -27,7 +27,7 @@
     data() {
         return {
             isShow: true,
-            camera: "front",
+            camera: "rear",
             result: "", // 鎵爜缁撴灉淇℃伅
             error: "" // 閿欒淇℃伅
         };
@@ -35,29 +35,26 @@
     created() { },
     methods: {
         openCamera(){
-            this.camera="front"
+            this.camera='rear'
         },
         //鍥炶皟鎵弿缁撴灉
         onDecode(result) {
-            console.log(result);
             if (result !== "") {
                 this.result=result
                 this.$emit("ok",this.result)
                 this.cancelCode()
-                // alert(result)            
             }
         },
         // 鐩告満鍙嶈浆
         switchCamera() {
             switch (this.camera) {
-                //鍓嶇疆
-                case 'front':
-                    //杞悗缃�
-                    this.camera = 'rear'
-                    break
-                    //鍙嶄箣
+                //鍙嶄箣
                 case 'rear':
-                    this.camera = 'front'
+                this.camera = 'front'
+                break
+                case 'front':
+                    //鍚庣疆
+                    this.camera = 'rear'
                     break
                 default:
                     this.$toast('閿欒')
@@ -75,12 +72,7 @@
         async onInit(promise) {
             try {
                 const { capabilities } = await promise;
-                console.log(
-                    "馃殌 ~ file: cameracomponent.vue:47 ~ onInit ~ capabilities",
-                    capabilities
-                );
             } catch (error) {
-                // console.log()
                 this.$toast(error.name);
                 if (error.name === "NotAllowedError") {
                     this.error = "ERROR: 鎮ㄩ渶瑕佹巿浜堢浉鏈鸿闂潈闄�";
@@ -106,12 +98,7 @@
         }
     },
     watch: {
-        "result": {
-            handler(newVal) {
-                console.log('鎵弿鍊�' + newVal);
-            },
-            deep: true
-        }
+
     }
 };
 </script>

--
Gitblit v1.9.3