From 0a9c34f2da201da0358bf149e475519c82553fc8 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 09 Nov 2021 16:20:28 +0800
Subject: [PATCH] 扫码组件,允许由业务层转App层来完成

---
 forms/input/CInputScanCode.vue |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/forms/input/CInputScanCode.vue b/forms/input/CInputScanCode.vue
index 81288f6..aac51ae 100644
--- a/forms/input/CInputScanCode.vue
+++ b/forms/input/CInputScanCode.vue
@@ -52,6 +52,8 @@
         itemRes: Object,
         // 占位提示
         placeholder: String,
+        // 由业务层调用app
+        onScaning: Function,
     },
     data() {
         return {
@@ -96,10 +98,12 @@
                     },
                 });
             } else if (type === 'app') {
-                // TODO:扫码
-                setTimeout(() => {
-                    this.scaning = false;
-                }, 1000);
+                if (this.onScaning) {
+                    this.onScaning(res => {
+                        this.scaning = false;
+                        this.itemRes.onChange(res.result);
+                    });
+                }
             }
         },
     },

--
Gitblit v1.9.1