开关完善
This commit is contained in:
		
							parent
							
								
									763b37c5a4
								
							
						
					
					
						commit
						ba6b85fe31
					
				|  | @ -37,7 +37,10 @@ | |||
| 				充值 | ||||
| 			</view> | ||||
| 		</view> | ||||
| 
 | ||||
|           | ||||
| 		 <view class="masks" v-if="maskflag"> | ||||
| 		 	 | ||||
| 		 </view> | ||||
| 		<!-- <view class="anniu" @click="Search"> | ||||
| 			<button>重新扫描</button> | ||||
| 		</view> --> | ||||
|  | @ -93,7 +96,8 @@ | |||
| 				bgc: { | ||||
| 					background: '#8883F0' | ||||
| 				}, | ||||
| 				billNo: '' | ||||
| 				billNo: '', | ||||
| 				maskflag:true | ||||
| 			} | ||||
| 		}, | ||||
| 		onLoad(e) { | ||||
|  | @ -130,6 +134,7 @@ | |||
| 				}); | ||||
| 				// 判断是否存在浇花器设备 | ||||
| 				if (this.devicesList.length == 0) { | ||||
| 					 | ||||
| 					uni.showToast({ | ||||
| 						title: '暂无发现对应设备,请靠近设备', | ||||
| 						icon: 'none', | ||||
|  | @ -145,7 +150,7 @@ | |||
|                     // uni.hideLoading() | ||||
| 				} | ||||
| 				this.status = true | ||||
| 			}, 2000) | ||||
| 			}, 4000) | ||||
| 
 | ||||
| 		}, | ||||
| 		onShow: function() { | ||||
|  | @ -371,6 +376,7 @@ | |||
| 								} | ||||
| 							} | ||||
| 						}else{ | ||||
| 							this.maskflag = false | ||||
| 							uni.hideLoading() | ||||
| 							uni.showToast({ | ||||
| 								title: '未连接到设备,请靠近设备尝试', | ||||
|  | @ -382,6 +388,7 @@ | |||
| 					case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: | ||||
| 
 | ||||
| 						this.ver_data = this.parseCustomData(options.data) | ||||
| 						this.maskflag = false | ||||
| 						uni.hideLoading() | ||||
| 						console.log("1收到设备发来的自定义数据结果:", this.ver_data); | ||||
| 						break; | ||||
|  | @ -499,7 +506,18 @@ | |||
| 	page { | ||||
| 		background-color: #F7FAFE !important; | ||||
| 	} | ||||
| 
 | ||||
|      | ||||
| 	.masks{ | ||||
| 		width: 100%; | ||||
| 		height: 100vh; | ||||
| 		position: fixed; | ||||
| 		top: 0; | ||||
| 		left: 50%; | ||||
| 		transform: translateX(-50%); | ||||
| 		background-color: #ccc; | ||||
| 		opacity: .6; | ||||
| 	}    | ||||
| 	 | ||||
| 	.card { | ||||
| 		margin-top: 50rpx; | ||||
| 		display: flex; | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ | |||
| 					<view class="mid_right"> | ||||
| 						<view class="mid_top"> | ||||
| 							{{ deviceInfo.deviceName == null ? '' : deviceInfo.deviceName }} | ||||
| 							<view class="" style="font-size: 26rpx;"> | ||||
| 							<view class="" style="font-size: 26rpx;margin-top: 8rpx;"> | ||||
| 								更新时间:{{deviceInfo.lastPullTime}}</view> | ||||
| 						</view> | ||||
| 						<view class="mid_bot"> | ||||
|  | @ -114,7 +114,7 @@ | |||
| 					<view class="cont" style="text-align: center;"> | ||||
| 						<view class="tit"> | ||||
| 							{{timeday}}  | ||||
| 							sb:{{setMode}} | ||||
| 							<!-- sb:{{setMode}} --> | ||||
| 						</view> | ||||
| 						<view class="txt"> | ||||
| 							剩余分钟 | ||||
|  | @ -128,7 +128,7 @@ | |||
| 				<view class="tit">其他</view> | ||||
| 				<view class="cont_box" style="display: block;"> | ||||
| 					<view class="" style="display: flex;justify-content: space-between;"> | ||||
| 						<view class="cont" style="width: 120rpx;" @click="topage(0)"> | ||||
| 						<view class="cont" style="width: 120rpx;margin-right: 50rpx;" @click="topage(0)"> | ||||
| 							<view class="top"> | ||||
| 								<image src="https://api.ccttiot.com/smartmeter/img/static/uKrpw3p37UHW56IypPJU" mode="" | ||||
| 									style="width: 58rpx;height: 56rpx;"></image> | ||||
|  | @ -158,14 +158,14 @@ | |||
| 						</view> | ||||
| 					</view> | ||||
| 					<view class="" style="display: flex;margin-top: 20rpx;"> | ||||
| 						<view class="cont" style="width: 120rpx;" @click="topage(3)"> | ||||
| 						<view class="cont" style="width: 120rpx;margin-right: 56rpx;" @click="topage(3)"> | ||||
| 							<view class="top"> | ||||
| 								<image src="https://api.ccttiot.com/smartmeter/img/static/umjPUc8nDKf1JwVqRAeb" mode="" | ||||
| 									style="width: 58rpx;height: 60rpx;"></image> | ||||
| 							</view> | ||||
| 							<view class="bot">收费方式</view> | ||||
| 						</view> | ||||
| 						<view class="cont" style="width: 60rpx;" @click="topage(4)"> | ||||
| 						<view class="cont" style="width: 66rpx;" @click="topage(4)"> | ||||
| 							<view class="top"> | ||||
| 								<image src="https://api.ccttiot.com/smartmeter/img/static/u2Uco0iXf8aure0H2ihz" mode=""> | ||||
| 								</image> | ||||
|  | @ -259,27 +259,27 @@ | |||
| 			this.id = id | ||||
| 			this.getDevice(id) | ||||
| 
 | ||||
| 			xBlufi.initXBlufi(1); | ||||
| 			xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); | ||||
| 			xBlufi.notifyStartDiscoverBle({ | ||||
| 				'isStart': true | ||||
| 			}) | ||||
| 			// xBlufi.initXBlufi(1); | ||||
| 			// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); | ||||
| 			// xBlufi.notifyStartDiscoverBle({ | ||||
| 			// 	'isStart': true | ||||
| 			// }) | ||||
| 
 | ||||
| 			// 停止蓝牙搜索   | ||||
| 			setTimeout(() => { | ||||
| 				xBlufi.notifyStartDiscoverBle({ | ||||
| 					'isStart': false | ||||
| 				}); | ||||
| 			// setTimeout(() => { | ||||
| 			// 	xBlufi.notifyStartDiscoverBle({ | ||||
| 			// 		'isStart': false | ||||
| 			// 	}); | ||||
| 
 | ||||
| 				xBlufi.notifyConnectBle({ | ||||
| 					isStart: true, | ||||
| 					deviceId: this.deviceId, | ||||
| 					name: this.name | ||||
| 				}) | ||||
| 				xBlufi.notifyInitBleEsp32({ | ||||
| 					deviceId: this.deviceId | ||||
| 				}); | ||||
| 			}, 2000) | ||||
| 			// 	xBlufi.notifyConnectBle({ | ||||
| 			// 		isStart: true, | ||||
| 			// 		deviceId: this.deviceId, | ||||
| 			// 		name: this.name | ||||
| 			// 	}) | ||||
| 			// 	xBlufi.notifyInitBleEsp32({ | ||||
| 			// 		deviceId: this.deviceId | ||||
| 			// 	}); | ||||
| 			// }, 2000) | ||||
| 
 | ||||
| 		}, | ||||
| 		onShow() { | ||||
|  | @ -323,34 +323,29 @@ | |||
| 					} | ||||
| 				}); | ||||
| 			}, | ||||
| 			btnpic() { | ||||
| 			btnpic(e) { | ||||
| 				let _this = this | ||||
| 				let math = 'static/' + _this.$u.guid(20) | ||||
| 				uni.chooseImage({ | ||||
| 					count: 1, | ||||
| 					type: 'all', | ||||
| 					success(res) { | ||||
| 						const tempFilePaths = res.tempFiles | ||||
| 						wx.uploadFile({ | ||||
| 							url: 'https://up-z2.qiniup.com', | ||||
| 							name: 'file', | ||||
| 							filePath: tempFilePaths[0].path, | ||||
| 							formData: { | ||||
| 								token: _this.token, //后端返回的token | ||||
| 								key: 'smartmeter/img/' + math | ||||
| 							}, | ||||
| 							success: function(res) { | ||||
| 								let str = JSON.parse(res.data) | ||||
| 								_this.userImgs = 'https://api.ccttiot.com/' + str.key | ||||
| 								_this.imglist = _this.userImgs | ||||
| 								let data = { | ||||
| 									deviceId: _this.id, | ||||
| 									customPicture: _this.imglist | ||||
| 								} | ||||
| 								_this.putdevice(data) | ||||
| 
 | ||||
| 				const tempFilePaths = e.detail.avatarUrl | ||||
| 				wx.uploadFile({ | ||||
| 					url: 'https://up-z2.qiniup.com', | ||||
| 					name: 'file', | ||||
| 					filePath: tempFilePaths, | ||||
| 					formData: { | ||||
| 						token: _this.token, | ||||
| 						key: 'smartmeter/img/' + math | ||||
| 					}, | ||||
| 					success: function(res) { | ||||
| 						let str = JSON.parse(res.data) | ||||
| 						console.log(str.key) | ||||
| 							_this.userImgs = 'https://api.ccttiot.com/' + str.key | ||||
| 							_this.imglist = _this.userImgs | ||||
| 							_this.imgflag = false | ||||
| 							let data = { | ||||
| 								deviceId:_this.id, | ||||
| 								customPicture:_this.imglist | ||||
| 							} | ||||
| 						}); | ||||
| 							_this.putdevice(data) | ||||
| 					} | ||||
| 				}) | ||||
| 			}, | ||||
|  | @ -362,9 +357,9 @@ | |||
| 							icon: 'success', | ||||
| 							duration: 2000 | ||||
| 						}) | ||||
| 					} else if (res.code == 500) { | ||||
| 					} else { | ||||
| 						uni.showToast({ | ||||
| 							title: '设备不在线', | ||||
| 							title: res.msg, | ||||
| 							icon: 'none', | ||||
| 							duration: 2000 | ||||
| 						}) | ||||
|  | @ -393,7 +388,7 @@ | |||
| 						let now = new Date(); | ||||
| 						let differenceInMs = expireDate - now; | ||||
| 						if (differenceInMs <= 0) { | ||||
| 							this.timeday = null | ||||
| 							this.timeday = 0 | ||||
| 						} else { | ||||
| 							this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60))); | ||||
| 						} | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ | |||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
| 						{{remake}} | ||||
| 						{{remake == null ? '' : remake}} | ||||
| 					</view> | ||||
| 					<view class="iconfont icon-xiangyou1"></view> | ||||
| 				</view> | ||||
|  | @ -43,7 +43,7 @@ | |||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
| 						{{listobj.deviceNo}} | ||||
| 						{{listobj.deviceNo == null ? '' : listobj.deviceNo}} | ||||
| 					</view> | ||||
| 				</view> | ||||
| 			</view> | ||||
|  | @ -53,7 +53,7 @@ | |||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
| 						{{listobj.model}} | ||||
| 						{{listobj.model == null ? '' : listobj.model}} | ||||
| 					</view> | ||||
| 				</view> | ||||
| 			</view> | ||||
|  |  | |||
|  | @ -807,7 +807,6 @@ | |||
| 					display: flex; | ||||
| 					align-items: center; | ||||
| 					justify-content: center; | ||||
| 
 | ||||
| 					border-left: 2rpx solid #D8D8D8; | ||||
| 					font-weight: 500; | ||||
| 					font-size: 36rpx; | ||||
|  | @ -855,7 +854,6 @@ | |||
| 				height: 96rpx; | ||||
| 				background: #8883F0; | ||||
| 				border-radius: 16rpx; | ||||
| 
 | ||||
| 				font-weight: 500; | ||||
| 				font-size: 36rpx; | ||||
| 				color: #FFFFFF; | ||||
|  | @ -1312,7 +1310,7 @@ | |||
| 							// align-items: center; | ||||
| 							margin-top: 20rpx; | ||||
| 							width: 658rpx; | ||||
| 							height: 282rpx; | ||||
| 							height: 250rpx; | ||||
| 							background: #fff; | ||||
| 							box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0); | ||||
| 							border-radius: 24rpx 24rpx 24rpx 24rpx; | ||||
|  | @ -1367,7 +1365,7 @@ | |||
| 
 | ||||
| 								image { | ||||
| 									width: 180rpx; | ||||
| 									height: 200rpx; | ||||
| 									height: 180rpx; | ||||
| 								} | ||||
| 							} | ||||
| 						} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user