From 6050beb7c315bb0450e7c039a0455b96d4c1ce8f Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期三, 12 六月 2024 18:16:05 +0800 Subject: [PATCH] rfid扫码 --- pages/login/index.vue | 37 +++++++++++++++++++++++++++++++------ 1 files changed, 31 insertions(+), 6 deletions(-) diff --git a/pages/login/index.vue b/pages/login/index.vue index 1892cdf..df5707a 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -308,12 +308,14 @@ console.log('褰撳墠宸叉槸鏈�柊鐗堟湰') } } else { - uni.showModal({ - title: "鎻愮ず", - content: '璇锋眰澶辫触锛�+ err, - showCancel: false, - confirmText: "鍙栨秷" - }); + // if(res.statusCode === 404){ + // uni.showModal({ + // title: "鎻愮ず", + // content: '璇锋眰澶辫触锛屾壘涓嶅埌鏇存柊鍖呯増鏈枃妗o細'+url, + // showCancel: false, + // confirmText: "鍙栨秷" + // }); + // } } }, fail(err) { @@ -598,6 +600,29 @@ } }, onLoad() { + //鑾峰彇mac鍦板潃 + var net = plus.android.importClass("java.net.NetworkInterface"); + var wl0 = net.getByName('wlan0'); + var macByte = wl0.getHardwareAddress(); + var deviceId = '' + //涓嬮潰杩欐浠g爜鏉ヨ嚜缃戠粶 + for (var i = 0; i < macByte.length; i++) { + var tmp = ""; + var num = macByte[i]; + if (num < 0) { + tmp =(255+num+1).toString(16); + } else { + tmp = num.toString(16); + } + if (tmp.length == 1) { + tmp = "0" + tmp; + } + deviceId += tmp; + } + //78b8d67511ca + this.$store.commit("setDeviceId", deviceId); + console.log('Android璁惧鐨刣eviceId:', deviceId); + plus.runtime.getProperty(plus.runtime.appid, (info) => { // console.log(info); this.$data.version = info.version; -- Gitblit v1.9.1