Преглед изворни кода

监控调阅增加NFC扫描提示

coys пре 1 година
родитељ
комит
b6858ae8e6

+ 23 - 0
src/components/nfcPopup/alone.vue

@@ -36,6 +36,7 @@ export default {
   data() {
     return {
       imageList: [],
+      timer: null,
       //nfc弹窗
       visible: false,
       //nfc图片(base64)
@@ -63,7 +64,28 @@ export default {
     submitNFC() {
       // window.openNFCScanCallBack=null
       window.openNFCScanCallBack = this.openNFCScanCallBack
+      
       this.useNFC()
+      this.$toast.loading({
+        duration: 0, // 持续展示 toast
+        position: 'top',
+        forbidClick: true,
+        message: '请靠近NFC标签,进行扫描!'
+      })
+
+      let second = 15
+      this.timer = setInterval(() => {
+        second--
+        if (!second) {
+          this.$toast.clear()
+          clearInterval(this.timer)
+          this.$toast({
+            type: 'fail',
+            position: 'top',
+            message: '未扫描到任何信息!'
+          })
+        }
+      }, 1000)
     },
     openCameraCallBack(data) {
       this.globalLoading = true
@@ -109,6 +131,7 @@ export default {
         })
     },
     openNFCScanCallBack(data) {
+      clearInterval(this.timer)
       this.globalLoading = true
       let nfc = null
       try {

+ 0 - 1
src/views/menu/monitoringCall/components/consultInfo.vue

@@ -117,7 +117,6 @@ export default {
         if (code == 200) {
           this.hostList = data
           if (num == 1) {
-            
             this.activeNames = [this.hostList[0].hostId]
           } else {
             console.log(this.activeNames, '////')