11
This commit is contained in:
		
							parent
							
								
									b5acbbcde6
								
							
						
					
					
						commit
						c6d0ec5089
					
				|  | @ -18,7 +18,10 @@ | |||
| 		data() { | ||||
| 			return { | ||||
| 				obj: {}, | ||||
| 				tit: '' | ||||
| 				tit: '', | ||||
| 				bgc: { | ||||
| 					backgroundColor: " #8883F0", | ||||
| 				}, | ||||
| 			} | ||||
| 		}, | ||||
| 		// 分享到好友(会话) | ||||
|  |  | |||
|  | @ -561,6 +561,7 @@ | |||
| 							line-height: 70rpx; | ||||
| 							padding-left: 22rpx; | ||||
| 							padding-right: 72rpx; | ||||
| 							width: 100%; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
|  | @ -569,7 +570,7 @@ | |||
| 					display: flex; | ||||
| 					justify-content: space-between; | ||||
| 					margin-top: 34rpx; | ||||
| 
 | ||||
|                     align-items: center; | ||||
| 					.tit { | ||||
| 						margin-top: 12rpx; | ||||
| 						font-size: 32rpx; | ||||
|  | @ -587,6 +588,7 @@ | |||
| 							height: 70rpx; | ||||
| 							line-height: 70rpx; | ||||
| 							padding-left: 22rpx; | ||||
| 							width: 100%; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
|  |  | |||
|  | @ -99,6 +99,9 @@ | |||
| 	export default { | ||||
| 		data() { | ||||
| 			return { | ||||
| 				bgc: { | ||||
| 					backgroundColor: " #8883F0", | ||||
| 				}, | ||||
| 				btnmsk:false, | ||||
| 				checked:true, | ||||
| 				params: { | ||||
|  | @ -556,6 +559,7 @@ | |||
| 							line-height: 70rpx; | ||||
| 							padding-left: 22rpx; | ||||
| 							padding-right: 72rpx; | ||||
| 							width: 100%; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
|  | @ -564,7 +568,7 @@ | |||
| 					display: flex; | ||||
| 					justify-content: space-between; | ||||
| 					margin-top: 34rpx; | ||||
| 
 | ||||
|                     align-items: center; | ||||
| 					.tit { | ||||
| 						margin-top: 12rpx; | ||||
| 						font-size: 32rpx; | ||||
|  | @ -582,6 +586,7 @@ | |||
| 							height: 70rpx; | ||||
| 							line-height: 70rpx; | ||||
| 							padding-left: 22rpx; | ||||
| 							width: 100%; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
|  |  | |||
|  | @ -109,7 +109,6 @@ | |||
| 		}, | ||||
| 		onLoad(option) { | ||||
| 			// console.log(option); | ||||
| 			this.getluru() | ||||
| 			this.getxingh() | ||||
| 			this.storeId = option.sn | ||||
| 		}, | ||||
|  | @ -284,7 +283,7 @@ | |||
| 								} | ||||
| 							}) | ||||
| 							// console.log('蓝牙停止搜索ok') | ||||
| 							this.mengcflag = false | ||||
| 							// this.mengcflag = false | ||||
| 							if (this.devicesLists.length == 0) { | ||||
| 								this.titleflag = true | ||||
| 							} else { | ||||
|  | @ -342,122 +341,6 @@ | |||
| 				uni.navigateTo({ | ||||
| 					url:'/page_fenbao/device/joinDevice?mac='+Bluetoothmac | ||||
| 				}) | ||||
| 				 | ||||
| 				// this.arrs = '' | ||||
| 				// this.qrResult = e.name //拿到所点击的mac号 | ||||
| 				// if (this.ver_data == null) { //判断是否有连接蓝牙 | ||||
| 				// 	xBlufi.initXBlufi(1) | ||||
| 				// 	xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) | ||||
| 				// 	xBlufi.notifyStartDiscoverBle({ | ||||
| 				// 		'isStart': true | ||||
| 				// 	}) | ||||
| 				// 	this.devicesList.forEach(device => { | ||||
| 				// 		if (device.name == this.qrResult) { | ||||
| 				// 			this.deviceId = device.deviceId | ||||
| 				// 			this.name = device.name | ||||
| 				// 			this.mac = device.name.slice(5, 17) | ||||
| 				// 		} | ||||
| 				// 	}) | ||||
| 				// 	uni.showLoading({ | ||||
| 				// 		title: '连接准备中...' | ||||
| 				// 	}) | ||||
| 				// 	// 停止蓝牙搜索   | ||||
| 				// 	setTimeout(() => { | ||||
| 				// 		setTimeout(()=>{ | ||||
| 				// 			uni.showLoading({ | ||||
| 				// 				title: '连接中...' | ||||
| 				// 			}) | ||||
| 				// 			setTimeout(()=>{ | ||||
| 				// 				uni.hideLoading() | ||||
| 				// 				uni.showToast({ | ||||
| 				// 					title: '连接成功', | ||||
| 				// 					icon: 'success', | ||||
| 				// 					duration: 2000 | ||||
| 				// 				}) | ||||
| 				// 				this.devicesLists.forEach(item => { | ||||
| 				// 					if (item.name == this.qrResult) { | ||||
| 				// 						item.lj = '开关' | ||||
| 				// 					} | ||||
| 				// 				}) | ||||
| 				// 			},2000) | ||||
| 				// 		},500) | ||||
| 				// 		xBlufi.notifyStartDiscoverBle({ | ||||
| 				// 			'isStart': false | ||||
| 				// 		}) | ||||
| 				// 		xBlufi.notifyConnectBle({ | ||||
| 				// 			isStart: true, | ||||
| 				// 			deviceId: this.deviceId, | ||||
| 				// 			name: this.name | ||||
| 				// 		}) | ||||
| 				// 		xBlufi.notifyInitBleEsp32({ | ||||
| 				// 			deviceId: this.deviceId | ||||
| 				// 		}) | ||||
| 				// 	}, 1000) | ||||
| 				// }else{ //有连接则发送命令 | ||||
| 				// uni.showLoading({ | ||||
| 				// 	title: '执行中...' | ||||
| 				// }) | ||||
| 				// 	let that = this //改变this指向 | ||||
| 				// 	uni.getNetworkType({ | ||||
| 				// 		success(res) { | ||||
| 				// 			if (res.networkType !== 'none') { | ||||
| 				// 				uni.getConnectedBluetoothDevices({ | ||||
| 				// 					success(res) { | ||||
| 				// 						setTimeout(() => { //一秒后发送开启命令 | ||||
| 				// 							xBlufi.notifySendCustomData({ | ||||
| 				// 								customData: 'open' | ||||
| 				// 							}) | ||||
| 				// 							setTimeout(()=>{ //发送开启命令两秒后发送关闭命令 | ||||
| 				// 								xBlufi.notifySendCustomData({ | ||||
| 				// 									customData: 'close' | ||||
| 				// 								}) | ||||
| 				// 								setTimeout(()=>{ //发送关闭命令后一秒后断开连接 | ||||
| 				// 									uni.hideLoading() | ||||
| 				// 									that.ver_data = null | ||||
| 				// 									xBlufi.listenDeviceMsgEvent(false, that.funListenDeviceMsgEvent); | ||||
| 				// 									wx.closeBLEConnection({ | ||||
| 				// 										deviceId: that.deviceId, | ||||
| 				// 									}) | ||||
| 				// 									that.devicesLists.forEach(item => { | ||||
| 				// 										if (item.name == that.qrResult) { | ||||
| 				// 											item.lj = '连接' | ||||
| 				// 										} | ||||
| 				// 									}) | ||||
| 				// 									// console.log('guanbi'); | ||||
| 				// 								},1000) | ||||
| 				// 							},2000) | ||||
| 				// 						}, 1000) | ||||
| 				// 					}, | ||||
| 				// 					fail(err) { | ||||
| 				// 						console.error('获取已连接蓝牙设备信息失败:', err) | ||||
| 				// 					} | ||||
| 				// 				}) | ||||
| 				// 			} | ||||
| 				// 		} | ||||
| 				// 	}) | ||||
| 				// } | ||||
| 			}, | ||||
| 			// 请求已经录入设备的mac | ||||
| 			getluru() { | ||||
| 				// this.$u.get(`/app/device/listAllMac`).then(res => { | ||||
| 				// 	if (res.code == 200) { | ||||
| 				// this.lurulist = res.data | ||||
| 				// if(this.lurulist){ | ||||
| 				// xBlufi.initXBlufi(1); | ||||
| 				// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); | ||||
| 				// xBlufi.notifyStartDiscoverBle({ | ||||
| 				// 	'isStart': true | ||||
| 				// }) | ||||
| 				// // 两秒后停止蓝牙搜索   | ||||
| 				// setTimeout(() => { | ||||
| 				// 	xBlufi.notifyStartDiscoverBle({ | ||||
| 				// 		'isStart': false | ||||
| 				// 	}); | ||||
| 				// 	this.status = true | ||||
| 				// }, 1000) | ||||
| 				// } | ||||
| 				// } | ||||
| 				// }) | ||||
| 			}, | ||||
| 			parseCustomData(data) { | ||||
| 				const dataArray = data.split('@'); | ||||
|  | @ -485,49 +368,10 @@ | |||
| 				} | ||||
| 				return parsedData; | ||||
| 			}, | ||||
| 			//4、建立连接 | ||||
| 			// createBLEConnection(e) { | ||||
| 			// 	// this.deviceId = e.name | ||||
| 			// 	this.mengcflag = true | ||||
| 			// 	uni.showLoading({ | ||||
| 			// 		title: '录入中...' | ||||
| 			// 	}) | ||||
| 			// 	this.mac = e.name.substring(5) | ||||
| 			// 	// 录入设备 | ||||
| 			// 	let data = { | ||||
| 			// 		sn: this.storeId, | ||||
| 			// 		mac: this.mac, | ||||
| 			// 		modelId: this.valuexh | ||||
| 			// 	} | ||||
| 			// 	this.$u.post('/app/device', data).then((res) => { | ||||
| 			// 		if (res.code == 200) { | ||||
| 			// 			uni.showToast({ | ||||
| 			// 				title: '设备:' + this.mac + '已录入成功', | ||||
| 			// 				icon: 'success', | ||||
| 			// 				duration: 2000 | ||||
| 			// 			}) | ||||
| 			// 			this.mengcflag = false | ||||
| 			// 			uni.hideLoading() | ||||
| 			// 			this.Search() | ||||
| 			// 			// setTimeout(() => { | ||||
| 			// 			// 	uni.navigateBack() | ||||
| 			// 			// }, 1000) | ||||
| 			// 			uni.removeStorageSync('mac') | ||||
| 			// 		} else { | ||||
| 			// 			this.mengcflag = false | ||||
| 			// 			uni.hideLoading() | ||||
| 			// 			uni.showToast({ | ||||
| 			// 				title: res.msg, | ||||
| 			// 				icon: 'none', | ||||
| 			// 				duration: 2000 | ||||
| 			// 			}) | ||||
| 			// 		} | ||||
| 			// 	}) | ||||
| 			// }, | ||||
| 			// 点击重新搜索 | ||||
| 			Search() { | ||||
| 				// if (this.status) { | ||||
| 					this.seachflag = false | ||||
| 				this.seachflag = false | ||||
| 				this.mengcflag = true | ||||
| 				uni.showLoading({ | ||||
| 					title: '请稍后...' | ||||
|  | @ -553,19 +397,10 @@ | |||
| 						xBlufi.notifyStartDiscoverBle({ | ||||
| 							'isStart': false | ||||
| 						}); | ||||
| 						this.seachflag = true | ||||
| 						// 判断是否存在设备 | ||||
| 						// if (this.devicesList.length == 0) { | ||||
| 						// 	this.tishiflag = true | ||||
| 						// 	this.texts = '扫描完毕,暂无发现设备' | ||||
| 						// } else { | ||||
| 						// 	this.texts = '扫描到以下设备,请点击录入!' | ||||
| 						// } | ||||
| 					// } else { | ||||
| 					// 	xBlufi.notifyStartDiscoverBle({ | ||||
| 					// 		'isStart': true | ||||
| 					// 	}) | ||||
| 					// } | ||||
| 						setTimeout(()=>{ | ||||
| 							this.seachflag = true | ||||
| 							this.mengcflag = false | ||||
| 						},2000) | ||||
| 				}, 2000) | ||||
| 				// } | ||||
| 			}, | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| <template> | ||||
| 	<view class="page"> | ||||
| 		<u-navbar :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#000" title-color='#000' | ||||
| 		<u-navbar  :title="tittxt" :border-bottom="false" :background="bgc" back-icon-color="#000" title-color='#000' | ||||
| 			title-size='36' height='50' id="navbar"> | ||||
| 		</u-navbar> | ||||
| 		<view class="zhuhu"> | ||||
|  | @ -463,19 +463,19 @@ | |||
| 		}, | ||||
| 		onHide() { | ||||
| 			if (this.timer || this.intervalId) { | ||||
| 				clearInterval(this.intervalId); | ||||
| 				clearInterval(this.intervalId) | ||||
| 				clearInterval(this.timer) | ||||
| 				this.timer = null | ||||
| 				this.intervalId = null; | ||||
| 				this.intervalId = null | ||||
| 				console.log('已销毁') | ||||
| 			} | ||||
| 		}, | ||||
| 		onUnload: function() { | ||||
| 			if (this.timer || this.intervalId) { | ||||
| 				clearInterval(this.intervalId); | ||||
| 				clearInterval(this.intervalId) | ||||
| 				clearInterval(this.timer) | ||||
| 				this.timer = null | ||||
| 				this.intervalId = null; | ||||
| 				this.intervalId = null | ||||
| 				console.log('已销毁') | ||||
| 			} | ||||
| 			xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent); | ||||
|  | @ -487,7 +487,7 @@ | |||
| 			this.getshuax() | ||||
| 			this.getQiniuToken() | ||||
| 			// if (!this.intervalId) { | ||||
| 			// 	this.startIntervals(); | ||||
| 			// 	this.startIntervals() | ||||
| 			// } | ||||
| 		}, | ||||
| 		mounted() { | ||||
|  | @ -516,7 +516,6 @@ | |||
| 							this.sklist = res.rows[0] | ||||
| 							this.suitSurplus = res.rows[0].surplusEle | ||||
| 						} | ||||
| 						 | ||||
| 					}else{ | ||||
| 						uni.showToast({ | ||||
| 							title: res.msg, | ||||
|  | @ -525,7 +524,6 @@ | |||
| 						}) | ||||
| 					} | ||||
| 				}) | ||||
| 				 | ||||
| 			}, | ||||
| 			// 点击刷新 | ||||
| 			shuaxin(){ | ||||
|  | @ -561,11 +559,11 @@ | |||
| 			}, | ||||
| 
 | ||||
| 			capture() { | ||||
| 				var pages = getCurrentPages(); //获取当前页面信息 | ||||
| 				var page = pages[pages.length - 1]; | ||||
| 				var pages = getCurrentPages() //获取当前页面信息 | ||||
| 				var page = pages[pages.length - 1] | ||||
| 				var bitmap = null; | ||||
| 				var currentWebview = page.$getAppWebview(); | ||||
| 				bitmap = new plus.nativeObj.Bitmap('amway_img'); | ||||
| 				var currentWebview = page.$getAppWebview() | ||||
| 				bitmap = new plus.nativeObj.Bitmap('amway_img') | ||||
| 				// 将webview内容绘制到Bitmap对象中 | ||||
| 				currentWebview.draw(bitmap, function() { | ||||
| 					// console.log('截屏绘制图片成功'); | ||||
|  | @ -582,23 +580,23 @@ | |||
| 									title: '保存图片成功', | ||||
| 									mask: false, | ||||
| 									duration: 1500 | ||||
| 								}); | ||||
| 								}) | ||||
| 							} | ||||
| 						}); | ||||
| 						}) | ||||
| 					}, function(e) { | ||||
| 						console.log('保存图片失败:' + JSON.stringify(e)); | ||||
| 					}); | ||||
| 						console.log('保存图片失败:' + JSON.stringify(e)) | ||||
| 					}) | ||||
| 				}, function(e) { | ||||
| 					console.log('截屏绘制图片失败:' + JSON.stringify(e)); | ||||
| 				}); | ||||
| 				//currentWebview.append(amway_bit); | ||||
| 					console.log('截屏绘制图片失败:' + JSON.stringify(e)) | ||||
| 				}) | ||||
| 				//currentWebview.append(amway_bit) | ||||
| 			}, | ||||
| 
 | ||||
| 
 | ||||
| 			drawCanvas() { | ||||
| 				const ctx = uni.createCanvasContext('qrcode', this); | ||||
| 				ctx.setFillStyle('#fff'); | ||||
| 				ctx.fillRect(10, 10, 250, 250); | ||||
| 				const ctx = uni.createCanvasContext('qrcode', this) | ||||
| 				ctx.setFillStyle('#fff') | ||||
| 				ctx.fillRect(10, 10, 250, 250) | ||||
| 				ctx.draw(); | ||||
| 			}, | ||||
| 			// 长按保存二维码 | ||||
|  | @ -606,19 +604,19 @@ | |||
| 				uni.canvasToTempFilePath({ | ||||
| 					canvasId: 'qrcode', | ||||
| 					success: (res) => { | ||||
| 						console.log(res.tempFilePath); // 打印图片路径   | ||||
| 						console.log(res.tempFilePath)// 打印图片路径   | ||||
| 						uni.saveImageToPhotosAlbum({ | ||||
| 							filePath: res.tempFilePath, | ||||
| 							success: function() { | ||||
| 								uni.showToast({ | ||||
| 									title: '保存成功', | ||||
| 									icon: 'success' | ||||
| 								}); | ||||
| 								}) | ||||
| 							} | ||||
| 						}); | ||||
| 						}) | ||||
| 					}, | ||||
| 					fail: (err) => { | ||||
| 						console.error(err); | ||||
| 						console.error(err) | ||||
| 					} | ||||
| 				}); | ||||
| 			}, | ||||
|  | @ -730,7 +728,7 @@ | |||
| 								} | ||||
| 							}, 1000) | ||||
| 						} else { | ||||
| 							// console.log(this.tdtxt,'020202'); | ||||
| 							// console.log(this.tdtxt,'020202') | ||||
| 							if (this.tdtxt == '开启') { | ||||
| 								let that = this | ||||
| 								uni.getNetworkType({ | ||||
|  | @ -739,7 +737,7 @@ | |||
| 											uni.getConnectedBluetoothDevices({ | ||||
| 												success(res) { | ||||
| 													setTimeout(() => { | ||||
| 														// console.log('close关闭'); | ||||
| 														// console.log('close关闭') | ||||
| 														that.tdtxt = '关闭' | ||||
| 														that.imgflag = false | ||||
| 														that.deviceInfo.status = 1 | ||||
|  | @ -815,7 +813,7 @@ | |||
| 			}, | ||||
| 			onok(ev) { | ||||
| 				this.url = "" | ||||
| 				this.path = ev.path; | ||||
| 				this.path = ev.path | ||||
| 				let _this = this | ||||
| 				let math = 'static/' + _this.$u.guid(20) | ||||
| 				wx.uploadFile({ | ||||
|  | @ -2127,14 +2125,11 @@ | |||
| 				background: #8883F0; | ||||
| 				box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1); | ||||
| 				border-radius: 52rpx 52rpx 52rpx 52rpx; | ||||
| 
 | ||||
| 				font-size: 32rpx; | ||||
| 				font-family: HarmonyOS Sans SC, HarmonyOS Sans SC; | ||||
| 				font-weight: 400; | ||||
| 				color: #FFFFFF; | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 
 | ||||
| 	} | ||||
| </style> | ||||
							
								
								
									
										525
									
								
								pages.json
									
									
									
									
									
								
							
							
						
						
									
										525
									
								
								pages.json
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -150,7 +150,10 @@ | |||
| 		<image v-if="curtitidx == 0" class="saoyisao" @click="saoyisao" | ||||
| 			src="https://api.ccttiot.com/smartmeter/img/static/uiDR6MnGHguBRNSYFTVw" mode="aspectFit"></image> | ||||
| 
 | ||||
| 		<tab-bar :indexs='0'></tab-bar> | ||||
| 		<!-- #ifdef MP-WEIXIN --> | ||||
|              <tab-bar :indexs='0'></tab-bar> | ||||
| 		<!-- #endif --> | ||||
| 
 | ||||
| 
 | ||||
| 		<view class="dd"> | ||||
| 			<u-select v-model="show" :list="list" title='添加方式' @confirm="confirm"></u-select> | ||||
|  | @ -302,7 +305,7 @@ | |||
| 			} | ||||
| 		}, | ||||
| 		onLoad() { | ||||
|            | ||||
|             | ||||
| 		}, | ||||
| 
 | ||||
| 		onShow() { | ||||
|  |  | |||
|  | @ -114,8 +114,9 @@ | |||
| 			</view> | ||||
| 		</view> | ||||
| 		 | ||||
| 		 | ||||
| 		<tab-bar :indexs='2' style=""></tab-bar> | ||||
| 		<!-- #ifdef MP-WEIXIN --> | ||||
| 		       <tab-bar :indexs='2' style=""></tab-bar> | ||||
| 		<!-- #endif --> | ||||
| 	 | ||||
| 		 | ||||
| 	</view> | ||||
|  |  | |||
|  | @ -239,6 +239,9 @@ | |||
| 			this.getzf() | ||||
| 			this.gethuidaio() | ||||
| 			this.getshiy() | ||||
| 			setTimeout(()=>{ | ||||
|                 this.onControltap()				 | ||||
| 			},2000) | ||||
| 		}, | ||||
| 		onReady() { | ||||
| 			this.mapContext = uni.createMapContext('map', this) | ||||
|  | @ -568,6 +571,7 @@ | |||
| 				uni.getLocation({ | ||||
| 					type: 'wgs84', | ||||
| 					success: (res) => { | ||||
| 						console.log(res,'resresres'); | ||||
| 						// this.jinweidu = res.longitude + ',' + res.latitude; | ||||
| 						// this.latitude = res.latitude; | ||||
| 						// this.longitude = res.longitude; | ||||
|  |  | |||
|  | @ -73,7 +73,10 @@ | |||
| 				</view> | ||||
| 			</view> --> | ||||
| 		</view> | ||||
| 		<tab-bar :indexs='1'></tab-bar> | ||||
| 		<!-- #ifdef MP-WEIXIN --> | ||||
|                <tab-bar :indexs='1'></tab-bar> | ||||
| 		<!-- #endif --> | ||||
| 
 | ||||
| 	</view> | ||||
| </template> | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user