From 5ad02cdbb8b596683c45751f78aa82d015a85143 Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期二, 07 一月 2025 09:27:10 +0800
Subject: [PATCH] 1.其它出库增加发料数量字段,修改扫条码的逻辑 2.销售出库待发区增加库位

---
 pages/CangKuManage/print_setting.html |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/pages/CangKuManage/print_setting.html b/pages/CangKuManage/print_setting.html
index 3fea46a..320655a 100644
--- a/pages/CangKuManage/print_setting.html
+++ b/pages/CangKuManage/print_setting.html
@@ -106,8 +106,11 @@
 					var main = plus.android.runtimeMainActivity();
 					var BluetoothAdapter = plus.android.importClass("android.bluetooth.BluetoothAdapter");
 					var UUID = plus.android.importClass("java.util.UUID");
-
+                    
 					uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
+					
+					console.log(JSON.stringify(uuid, null, 2));
+					
 					var BAdapter = BluetoothAdapter.getDefaultAdapter();
 					BAdapter.cancelDiscovery(); //鍋滄鎵弿  
 
@@ -115,15 +118,26 @@
 					var address_mac = api_localStorageGet("printMac") ? api_localStorageGet("printMac") :
 						"DC:1D:30:3F:D2:50";
 					device = BAdapter.getRemoteDevice(address_mac);
+					
+	                
+	                plus.android.requestPermissions(['android.permission.BLUETOOTH_SCAN','android.permission.BLUETOOTH_CONNECT']);
+	                
+					console.log(231);
+					
 					plus.android.importClass(device);
 
 					bluetoothSocket = device.createInsecureRfcommSocketToServiceRecord(uuid);
+					
+					console.log(231);
+					
+					 console.log(JSON.stringify(bluetoothSocket, null, 2));
+					
 					plus.android.importClass(bluetoothSocket);
 				} catch (err) {
 
 					console.log(err);
 					//mui.alert(err)
-					plus.ui.toast("钃濈墮杩炴帴寮傚父锛�");
+					plus.ui.toast("钃濈墮杩炴帴寮傚父锛�"+ err);
 				}
 			})
 
@@ -292,6 +306,7 @@
 				//鑾峰彇鎵撳嵃淇℃伅
 				var pdaMac = $("#pdaMac").val();
 				var printMac = $("#printMac").val();
+				console.log(pdaMac);
 				//鎵ц鎵撳嵃
 				//console.log(pdaMac + "-0-" + printMac)
 				doPrintTest(pdaMac, printMac);
@@ -343,10 +358,18 @@
 			//鎵ц鎵撳嵃
 			function doPrintTest(pdaMac, printMac) {
 				try {
+					
+					console.log(1);
+					
+					console.log(bluetoothSocket);
+					
 					if (!bluetoothSocket.isConnected()) {
 						plus.ui.toast("閲嶆柊杩炴帴");
 						bluetoothSocket.connect();
 					}
+					
+					
+					
 					var outputStream = bluetoothSocket.getOutputStream();
 					plus.android.importClass(outputStream);
 
@@ -396,12 +419,19 @@
 					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浠ヤ笂鐗堟湰锛屽垯浣跨敤鍙︿竴绉嶆柟娉曡幏鍙杕ac鍦板潃
 					if (mac == "02:00:00:00:00:00") {
 						mac = getMacNew();
 					}
-					//console.log(mac)
+					//濡傛灉mac浣跨敤鏂版柟娉曚緷鐒舵槸鈥�02:00:00:00:00:00鈥濆垯涓嶈繘琛屼繚瀛�
+					if(mac == "02:00:00:00:00:00") {
+						return;
+					}
+					
 					api_localStorageSave("pdaMac", mac);
+					//console.log(mac)
+					
 				}
 			}
 			//瀹夊崜6.0浠ヤ笂鐗堟湰鑾峰彇Mac鍦板潃

--
Gitblit v1.9.3