快乐的昕的电脑
2025-09-25 d3c0c5787fbe378ab4b01c88d261d7d49cbbecfe
改为本地调试
已修改2个文件
96 ■■■■ 文件已修改
pages/index.vue 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index.vue
@@ -389,63 +389,63 @@
            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 + "号注塑机"
                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);
                    uni.setStorageSync('machineNo', this.machineNo);
                    uni.setStorageSync('printMac', devMachine.printMac);
                //     console.log(devMachine.printMac);
                    console.log(devMachine.printMac);
                //     this.getWomdaaIsShow();
                // });
                    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();
    //             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为“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 + "号注塑机";
    //                 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);
    //                     uni.setStorageSync('machineNo', this.machineNo);
    //                     uni.setStorageSync('printMac', devMachine.printMac);
 
                        this.getWomdaaIsShow();
    //                     this.getWomdaaIsShow();
                    });
                }
    //                 });
    //             }
            },
            save() {
                let data = this.selectedItems();
store/index.js
@@ -11,8 +11,8 @@
            serverURLInt:'http://192.168.11.251:10054',//服务器体检 10.0.1.104:10054
            serverURL:'http://localhost:10054',//本地调试地址
            //serverAPI:'http://78566b00.r1.cpolar.top/api',//外网地址
            serverAPI:'http://192.168.0.94:10055/api', //内网地址
            // serverAPI:'http://localhost:63775/api',//本地调试地址
            //serverAPI:'http://192.168.0.94:10055/api', //内网地址
             serverAPI:'http://localhost:5106/api',//本地调试地址
        }
    },
    mutations: {