Browse Source

瓦斯巡检更新

lxh 1 month ago
parent
commit
6e28ccca4b

+ 1 - 0
common/service/config.service.js

@@ -3,6 +3,7 @@ let BASE_URL = "";
 if (process.env.NODE_ENV == "development") {
   BASE_URL = "http://182.92.126.35:9999"; // 开发环境
 } else {
+  // BASE_URL = "http://182.92.126.35:9999"; // 开发环境
   // BASE_URL = "http://10.246.95.4:9999"; // 布尔台
   // BASE_URL = "http://10.248.135.10:9999"; // 大柳塔进
   // BASE_URL = "http://10.248.135.121:9999"; // 活鸡兔井

+ 4 - 0
common/util/hexiii-nfc.js

@@ -141,6 +141,7 @@ export default {
             let tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
             console.log(tag.toString(), '90909')
             let ndef = Ndef.get(tag);
+            console.log(ndef,'ndef------')
             if (ndef != null) {
                 // 待写入的数据长度
                 let size = message.toByteArray().length;
@@ -164,6 +165,9 @@ export default {
                         format.connect();
                         format.format(message);
                         toast('格式化tag并且写入message');
+                        setTimeout(()=>{
+                            that.writeData()
+                        },1000)
                         return;
                     } catch (e) {
                         toast('格式化tag失败.');

+ 10 - 5
pages/gasreport/components/gasRecordCard.vue

@@ -46,20 +46,22 @@ export default {
         }
     },
     computed: {
-        cardIds:function(){
+        cardIds: function () {
             return this.$store.getters.nfcreadtxt;
         }
     },
-    watch:{
-        cardIds:{
-            handler(newV,oldV){
-                console.log(newV,'newV------------------------')
+    watch: {
+        cardIds: {
+            handler(newV, oldV) {
+                console.log(newV, 'newV------------------------')
                 this.getCardLists(newV)
             },
+            immediate: true
         }
     },
     mounted() {
         testNfc.listenNFCStatus()
+        // testNfc.Into()
     },
     methods: {
         //获取NFC卡读取内容
@@ -114,6 +116,9 @@ export default {
                                 icon: false,
                                 message: response.data.message,
                             })
+                             // 调用 js 文件里面的方法
+                            //  testNfc.setTxt(that.cardId);
+                            //     testNfc.writeData();
                         }
                     })