凉纪 2 tahun lalu
induk
melakukan
ce961c07ec

+ 5 - 4
src/components/nfcPopup/more.vue

@@ -22,8 +22,9 @@
 
           </div>
           <div v-else>
-            <select-cell title="需要拍照的NFC" @change="changeNFC" v-model="selectNFC" :prop="prop" :dataList="dataList"/>
-            <van-button v-if="showBtn" type="info"  size="small" block @click="onConfirm">确认该照片</van-button>
+              <p>{{selectNFC}}</p>
+            <select-cell title="需要拍照的NFC" v-model="selectNFC" :prop="prop" :dataList="dataList"/>
+            <van-button v-if="selectNFC" type="info"  size="small" block @click="onConfirm">确认该照片</van-button>
           </div>
         </div>
       </div>
@@ -151,11 +152,11 @@ export default {
         nfcCode:this.selectNFC,
         url: this.nfcImage,
       }
+      alert(JSON.stringify(data));
       this.$emit('change',data);
       this.visible = false;
       this.clear();
     },
-    //切换nfc后可点击退出
     changeNFC(){
       this.showBtn = true;
     },
@@ -172,7 +173,7 @@ export default {
     show(list){
       this.visible = true;
       this.dataList = list;
-      alert( JSON.stringify(this.dataList ))
+      //alert( JSON.stringify(this.dataList ))
     },
     //上传前
     async fileChange(e){

+ 4 - 0
src/components/selectCell/index.vue

@@ -87,10 +87,12 @@ export default {
         return null;
       }
       let val;
+      console.log(this.label,'label1111');
       this.columns.forEach(v=> {
         if (v[this.prop.value] === this.value) {
           val = v;
           this.label = v[this.prop.label];
+          console.log(this.label,'label2222');
         }
       });
       return val;
@@ -101,8 +103,10 @@ export default {
       this.showPicker = false;
     },
     pickerConfirm(val){
+      console.log(val,'val')
       if(!val) return;
       this.label = val[this.prop.label];
+      console.log(this.label,'label')
       this.showPicker = false;
       this.$emit('change',val[this.prop.value])
     },

+ 19 - 6
src/views/menu/securityCheckRegister/detail.vue

@@ -38,8 +38,11 @@
                     <pre>{{ item.pointName }}</pre>
                   </template>
                   <template #right-icon>
+                    <span v-if="item.nfcList && item.nfcList.length">
+                        <span>{{ getNfcState(item.nfcList) }}</span>/<span >{{item.nfcList.length}}</span>
+                    </span>
                     <img
-                      v-if="enable && nfcState(item)"
+                      v-if="enable && item.nfcList && item.nfcList.length"
                       :src="require('../../../assets/svg/NFC.svg')"
                       class="nfc-icon"
                       @click="clickNFC(item.nfcList)"
@@ -194,6 +197,16 @@ export default {
     window.openNFCScanCallBack = null
   },
   methods: {
+    getNfcState(arr){
+        arr = arr || [];
+        let num = 0;
+        arr.forEach(v=>{
+          if(v.status === 1){
+            num++
+          }
+        })
+        return num;
+    },
     checkNFC(){
       window.openNFCScanCallBack = this.openNFCScanCallBack;
       this.useNFC();
@@ -222,7 +235,7 @@ export default {
       clearInterval(this.timer);
       let nfc = JSON.parse(nfcStr);
       let nfcCode =  nfc.content;
-      alert(nfcCode)
+      //alert(nfcCode)
       this.checkNfcFilter(nfcCode);
     },
     checkNfcFilter(nfcCode){
@@ -440,16 +453,16 @@ export default {
     },
     //添加图片时的回调
     changeNfcImg(imgItem) {
-      console.log(imgItem, this.selectArea.nfclist, 'imgItem')
-      this.selectArea.nfclist.forEach(v => {
-        if (v.nfccdoe === imgItem.nfcCode) {
+      console.log(imgItem, this.NFCList, 'imgItem')
+      this.NFCList.forEach(v => {
+        if (v.nfcCode === imgItem.nfcCode) {
           v.img = imgItem.url
           v.status = 1
           v.scanMethod = 1
           this.nfcImage.push(v)
         }
       })
-      console.log(this.selectArea.nfclist, this.nfcImage, 'nfcObj')
+      console.log(this.NFCList, this.nfcImage, 'nfcObj')
     },
 
   }