| | |
| | | getPrintInfo() { |
| | | var mac = "ac:f4:2c:20:0d:b4"; |
| | | |
| | | // mac = "e8:51:9e:7d:dc:95"; |
| | | // this.$post({ |
| | | // url: "/DevMachine/GetDevMachineByPdaMac", |
| | | // data: { |
| | | // pdaMac: mac, |
| | | // } |
| | | // }).then(res => { |
| | | // let devMachine = res.data.tbBillList; |
| | | // this.machineNo = devMachine.machineNo; |
| | | // this.machineName = "调试模式:" + this.machineNo + "号注塑机" |
| | | |
| | | // uni.setStorageSync('machineNo', this.machineNo); |
| | | // uni.setStorageSync('printMac', devMachine.printMac); |
| | | |
| | | // console.log(devMachine.printMac); |
| | | |
| | | // this.getWomdaaIsShow(); |
| | | // }); |
| | | |
| | | |
| | | if (plus.os.name == "Android") { |
| | | //获取手机MAC地址 |
| | | var Context = plus.android.importClass("android.content.Context"); |
| | | var WifiManager = plus.android.importClass("android.net.wifi.WifiManager"); |
| | | var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE); |
| | | var WifiInfo = plus.android.importClass("android.net.wifi.WifiInfo"); |
| | | var wifiInfo = wifiManager.getConnectionInfo(); |
| | | mac = wifiInfo.getMacAddress(); |
| | | |
| | | //如果mac为“02:00:00:00:00:00”,则可能是安卓6.0以上版本,则使用另一种方法获取mac地址 |
| | | if (mac == "02:00:00:00:00:00") { |
| | | mac = this.getMacNew(); |
| | | } |
| | | //如果mac使用新方法依然是“02:00:00:00:00:00”则不进行保存 |
| | | if (mac == "02:00:00:00:00:00") { |
| | | return; |
| | | } |
| | | uni.setStorageSync('pdaMac', mac); |
| | | |
| | | mac = "e8:51:9e:7d:dc:95"; |
| | | this.$post({ |
| | | url: "/DevMachine/GetDevMachineByPdaMac", |
| | | data: { |
| | |
| | | }).then(res => { |
| | | let devMachine = res.data.tbBillList; |
| | | this.machineNo = devMachine.machineNo; |
| | | this.machineName = "当前机台:" + this.machineNo + "号注塑机"; |
| | | this.machineName = "调试模式:" + this.machineNo + "号注塑机" |
| | | |
| | | uni.setStorageSync('machineNo', this.machineNo); |
| | | uni.setStorageSync('printMac', devMachine.printMac); |
| | | |
| | | console.log(devMachine.printMac); |
| | | |
| | | this.getWomdaaIsShow(); |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | // if (plus.os.name == "Android") { |
| | | // //获取手机MAC地址 |
| | | // var Context = plus.android.importClass("android.content.Context"); |
| | | // var WifiManager = plus.android.importClass("android.net.wifi.WifiManager"); |
| | | // var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE); |
| | | // var WifiInfo = plus.android.importClass("android.net.wifi.WifiInfo"); |
| | | // var wifiInfo = wifiManager.getConnectionInfo(); |
| | | // mac = wifiInfo.getMacAddress(); |
| | | |
| | | // //如果mac为“02:00:00:00:00:00”,则可能是安卓6.0以上版本,则使用另一种方法获取mac地址 |
| | | // if (mac == "02:00:00:00:00:00") { |
| | | // mac = this.getMacNew(); |
| | | // } |
| | | // //如果mac使用新方法依然是“02:00:00:00:00:00”则不进行保存 |
| | | // if (mac == "02:00:00:00:00:00") { |
| | | // return; |
| | | // } |
| | | // uni.setStorageSync('pdaMac', mac); |
| | | |
| | | // this.$post({ |
| | | // url: "/DevMachine/GetDevMachineByPdaMac", |
| | | // data: { |
| | | // pdaMac: mac, |
| | | // } |
| | | // }).then(res => { |
| | | // let devMachine = res.data.tbBillList; |
| | | // this.machineNo = devMachine.machineNo; |
| | | // this.machineName = "当前机台:" + this.machineNo + "号注塑机"; |
| | | |
| | | // uni.setStorageSync('machineNo', this.machineNo); |
| | | // uni.setStorageSync('printMac', devMachine.printMac); |
| | | |
| | | |
| | | // this.getWomdaaIsShow(); |
| | | |
| | | // }); |
| | | // } |
| | | }, |
| | | save() { |
| | | let data = this.selectedItems(); |