shish há 5 anos atrás
pai
commit
71d9b4eb9a

+ 2 - 2
ghsApp/dist/build/mp-weixin/admin/home/components/module/operate.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/admin/home/components/plugin/time-axis.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
ghsApp/dist/build/mp-weixin/common/vendor.js


+ 2 - 2
ghsApp/dist/build/mp-weixin/components/app-coupon-sel.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/app-date-picker.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/app-img.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/app-result.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/module/app-footer-cart.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/module/app-search.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/module/app-share-mask.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/plugin/bottom-popup.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/plugin/fab.json

@@ -1,4 +1,4 @@
 {
-  "component": true,
-  "usingComponents": {}
+  "usingComponents": {},
+  "component": true
 }

+ 2 - 2
ghsApp/dist/build/mp-weixin/components/plugin/selectList.json

@@ -1,4 +1,4 @@
 {
-  "usingComponents": {},
-  "component": true
+  "component": true,
+  "usingComponents": {}
 }

+ 73 - 24
ghsApp/src/mixins/BLE.js

@@ -57,12 +57,16 @@ export default {
 		},
 		//初始化蓝牙
 		searchBle() {
+			uni.showToast({
+				title: '搜索中...',
+				duration: 2000
+				});
 			var that = this;
 			that.isAutoBle = false;
 			uni.openBluetoothAdapter({
 				success(res) {
 					console.log(res,"打开 蓝牙模块");
-					that.onDevice();//监听搜索新设备
+					//that.onDevice();//监听搜索新设备
 					//获取本机蓝牙适配器状态。
 					uni.getBluetoothAdapterState({
 						success: function(res) {
@@ -77,6 +81,7 @@ export default {
 								uni.startBluetoothDevicesDiscovery({
 									success(res) {
 										console.log(res);
+										that.getBluetoothDevices()
 									}
 								});
 							} else {
@@ -87,36 +92,80 @@ export default {
 				}
 			});
 		},
-		onDevice() {
-			var that = this;
-			//监听寻找到新设备的事件
-			uni.onBluetoothDeviceFound(function(devices) {
-				console.log(devices,'设备列表');
-				var re = JSON.parse(JSON.stringify(devices));
-				let name = re.devices[0].name?re.devices[0].name:'未知设备';
-				if (name != "未知设备" && name != "") {
-					let deviceId = re.devices[0].deviceId;
-					switch(uni.getSystemInfoSync().platform){
-						case 'android':
-							that.devices.push({name: name,deviceId: deviceId,services: []});
-							break;
-						case 'ios':
-							for (let i=0;i<that.devices.length;i++){
-								console.log(that.devices[i].name,'----',name)
-								if (that.devices[i].name==name) {return}
+		getBluetoothDevices(){
+			let that = this;
+			uni.getBluetoothDevices({
+				success: re => {
+					//let devices = res.devices;
+					console.log(re,'设备列表');
+					//var re = JSON.parse(JSON.stringify(devices));
+					if(re.devices && re.devices.length > 0){
+
+						re.devices.forEach(function(item){
+ 
+							    //code something
+							 
+							  
+						let name = item.name?item.name:'未知设备';
+						if (name != "未知设备" && name != "") {
+							let deviceId = item.deviceId;
+							switch(uni.getSystemInfoSync().platform){
+								case 'android':
+									that.devices.push({name: name,deviceId: deviceId,services: []});
+									break;
+								case 'ios':
+									for (let i=0;i<that.devices.length;i++){
+										console.log(that.devices[i].name,'----',name)
+										if (that.devices[i].name==name) {return}
+									}
+									that.devices.push({name: name,deviceId: deviceId,services: []});
+									break;
 							}
-							that.devices.push({name: name,deviceId: deviceId,services: []});
-							break;
-					}
+		
+						}else{
+							console.log('name',name)
+							console.log('re.devices[0]',re.devices[0])
+						}
 
+					});
 
-					// that.$nextTick(()=>{
-					// 	that.$util.unique(that.devices);
-					// })
+					}
+
+				
 
 				}
 			});
 		},
+		// onDevice() {
+		// 	var that = this;
+		// 	//监听寻找到新设备的事件
+		// 	uni.onBluetoothDeviceFound(function(devices) {
+		// 		console.log(devices,'设备列表');
+		// 		var re = JSON.parse(JSON.stringify(devices));
+		// 		let name = re.devices[0].name?re.devices[0].name:'未知设备';
+		// 		if (name != "未知设备" && name != "") {
+		// 			let deviceId = re.devices[0].deviceId;
+		// 			switch(uni.getSystemInfoSync().platform){
+		// 				case 'android':
+		// 					that.devices.push({name: name,deviceId: deviceId,services: []});
+		// 					break;
+		// 				case 'ios':
+		// 					for (let i=0;i<that.devices.length;i++){
+		// 						console.log(that.devices[i].name,'----',name)
+		// 						if (that.devices[i].name==name) {return}
+		// 					}
+		// 					that.devices.push({name: name,deviceId: deviceId,services: []});
+		// 					break;
+		// 			}
+
+
+		// 			// that.$nextTick(()=>{
+		// 			// 	that.$util.unique(that.devices);
+		// 			// })
+
+		// 		}
+		// 	});
+		// },
 		//自动链接蓝牙-初始化蓝牙模块
 		autoLinkBle(BleVal){
 			this.BleVal = BleVal;

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff