优化套餐 设备 录入 绑定 设备排版等问题
This commit is contained in:
		
							parent
							
								
									bda070dd89
								
							
						
					
					
						commit
						766a540075
					
				|  | @ -21,7 +21,7 @@ const install = (Vue, vm) => { | |||
| 	// }); 
 | ||||
| 	Vue.prototype.$u.http.setConfig({  | ||||
| 			// baseUrl: 'http://192.168.2.143:10002',
 | ||||
| 			baseUrl: 'https://kg.chuantewulian.cn/prod-api', | ||||
| 			baseUrl: 'https://kg.chuangtewl.com/prod-api', | ||||
| 			loadingText: '努力加载中~', | ||||
| 			loadingTime: 1000, | ||||
| 			// 设置自定义头部content-type
 | ||||
|  | @ -123,11 +123,11 @@ const install = (Vue, vm) => { | |||
| 				        			// })
 | ||||
| 				        			uni.setStorageSync('token', res.token) | ||||
| 				        		} | ||||
| 				        	}); | ||||
| 				        	}) | ||||
| 				        } | ||||
| 				    }, | ||||
| 				   | ||||
| 				}); | ||||
| 				}) | ||||
| 				 | ||||
| 			} | ||||
| 			return res; | ||||
|  |  | |||
|  | @ -38,7 +38,7 @@ | |||
| 			</view> | ||||
| 			<view class="li"> | ||||
| 				<view class="tit"> | ||||
| 					类型 | ||||
| 					型号 | ||||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
|  | @ -61,14 +61,14 @@ | |||
| 					套餐设置 | ||||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
| 						<view class="iconfont icon-xiangyou1"></view> | ||||
| 					<view class="txt" style="display: flex;"> | ||||
| 					<view class="">{{taocan.length > 5 ? taocan.slice(0,5) + '...' : taocan}}</view>	<view style="padding-top: 6rpx;" class="iconfont icon-xiangyou1"></view> | ||||
| 					</view> | ||||
| 				</view> | ||||
| 			</view> | ||||
| 			<view class="li" @click.stop="sremakes()" v-if="isMch"> | ||||
| 				<view class="tit"> | ||||
| 					店铺名称 | ||||
| 					归属店铺 | ||||
| 				</view> | ||||
| 				<view class="info"> | ||||
| 					<view class="txt"> | ||||
|  | @ -223,7 +223,8 @@ | |||
| 				mac:'', | ||||
| 				name:'', | ||||
| 				deviceId:'', | ||||
| 				isMch:false | ||||
| 				isMch:false, | ||||
| 				taocan:'' | ||||
| 			} | ||||
| 		}, | ||||
| 		onLoad(option) { | ||||
|  | @ -234,8 +235,10 @@ | |||
| 			this.gettanc() | ||||
| 		}, | ||||
| 		onShow() { | ||||
| 			this.taocan = '' | ||||
| 			this.getgroup() | ||||
| 			this.getuserinfo() | ||||
| 			this.getao() | ||||
| 		}, | ||||
| 		// 分享到好友(会话) | ||||
| 		  onShareAppMessage: function () {   | ||||
|  | @ -254,6 +257,17 @@ | |||
| 		    }   | ||||
| 		  }, | ||||
| 		methods: { | ||||
| 			getao(){ | ||||
| 				this.$u.get(`/app/suit/listByDeviceId/${this.id}`).then(res => { | ||||
| 					if(res.code == 200){ | ||||
| 						if(res.data.length > 0){ | ||||
| 							res.data.forEach(item => { | ||||
| 								this.taocan += item.name + ',' | ||||
| 							}) | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
| 			}, | ||||
| 			// 点击设置套餐 | ||||
| 			btntc(){ | ||||
| 				uni.navigateTo({ | ||||
|  |  | |||
|  | @ -7,14 +7,17 @@ | |||
| 			<view class="box_list" v-for="(item, index) in list" :key="index" @click="btnactive(item.suitId,index)"> | ||||
| 				<view :class="['boxlist', { active: tcidlist.includes(item.suitId) }]"> | ||||
| 					<view :class="['toptime', { activewz: tcidlist.includes(item.suitId) }]"> | ||||
| 						<text>{{item.name}}(通电时长:{{item.value}}  <text v-if="item.timeUnit == 1">日</text>  <text v-if="item.timeUnit == 2">时</text> <text v-if="item.timeUnit == 3">分钟</text> <text v-if="item.timeUnit == 4">秒</text> )</text> <text>¥{{item.price}}</text> | ||||
| 						<text>{{item.name}}(通电时长:{{item.value}} <text v-if="item.timeUnit == 1">日</text> <text | ||||
| 								v-if="item.timeUnit == 2">时</text> <text v-if="item.timeUnit == 3">分钟</text> <text | ||||
| 								v-if="item.timeUnit == 4">秒</text> )</text> <text>¥{{item.price}}</text> | ||||
| 					</view> | ||||
| 					<view class="ccc"> | ||||
| 						<view class="bumday" v-if="item.description == null"> | ||||
| 							<text class="shi"></text></text> | ||||
| 						</view> | ||||
| 						<view class="bumday" v-else> | ||||
| 							<text :class="['shi', { activewz: tcidlist.includes(item.suitId) }]">{{item.description.length > 20 ? item.description.substring(0, 20) + '...' : item.description}}</text></text> | ||||
| 							<text | ||||
| 								:class="['shi', { activewz: tcidlist.includes(item.suitId) }]">{{item.description.length > 20 ? item.description.substring(0, 20) + '...' : item.description}}</text></text> | ||||
| 						</view> | ||||
| 						<!-- <u-checkbox-group> | ||||
| 							<u-checkbox v-model="item.checked"></u-checkbox> | ||||
|  | @ -62,11 +65,13 @@ | |||
| 				}, | ||||
| 				activeid: '', | ||||
| 				checkboxes: [], | ||||
| 				tcidlist: [] | ||||
| 				tcidlist: [], | ||||
| 				titaoc: [] | ||||
| 			}; | ||||
| 		}, | ||||
| 		onLoad(option) { | ||||
| 			this.deviceId = option.id | ||||
| 
 | ||||
| 		}, | ||||
| 		created() { | ||||
| 			// 初始化checkboxes数组,每个元素都设为false(表示初始时不显示复选框)   | ||||
|  | @ -75,24 +80,51 @@ | |||
| 		onShow() { | ||||
| 			this.tcidlist = [] | ||||
| 			this.getlist() | ||||
| 			setTimeout(() => { | ||||
| 				this.getao() | ||||
| 			}, 100) | ||||
| 		}, | ||||
| 		// 分享到好友(会话) | ||||
| 		  onShareAppMessage: function () {   | ||||
| 		    return {   | ||||
| 		      title: '创想物联',   | ||||
| 		      path: '/pages/shouye/index'   | ||||
| 		    }   | ||||
| 		  },   | ||||
| 		onShareAppMessage: function() { | ||||
| 			return { | ||||
| 				title: '创想物联', | ||||
| 				path: '/pages/shouye/index' | ||||
| 			} | ||||
| 		}, | ||||
| 
 | ||||
| 		  // 分享到朋友圈   | ||||
| 		  onShareTimeline: function () {   | ||||
| 		    return {   | ||||
| 		      title: '创想物联',   | ||||
| 		      query: '',   | ||||
| 		      path: '/pages/shouye/index'   | ||||
| 		    }   | ||||
| 		  }, | ||||
| 		// 分享到朋友圈   | ||||
| 		onShareTimeline: function() { | ||||
| 			return { | ||||
| 				title: '创想物联', | ||||
| 				query: '', | ||||
| 				path: '/pages/shouye/index' | ||||
| 			} | ||||
| 		}, | ||||
| 		methods: { | ||||
| 			// 查询本人套餐 | ||||
| 			getao() { | ||||
| 				this.$u.get(`/app/suit/listByDeviceId/${this.deviceId}`).then(res => { | ||||
| 					if (res.code == 200) { | ||||
| 						if (res.data.length > 0) { | ||||
| 							this.titaoc = res.data | ||||
| 
 | ||||
| 							this.list.forEach(item => { | ||||
| 								if (this.titaoc.some(titaocItem => titaocItem.sourceId === item.suitId)) { | ||||
| 									this.titaoc.forEach(titaocItem => { | ||||
| 										if (titaocItem.sourceId === item.suitId) { | ||||
| 											this.tcidlist.push(item.suitId) | ||||
| 										} | ||||
| 									}) | ||||
| 									let uniqueTcidlist = [...new Set(this.tcidlist)];   | ||||
| 									this.tcidlist = uniqueTcidlist | ||||
| 								} | ||||
| 							}) | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
| 			}, | ||||
| 			 | ||||
| 
 | ||||
| 			btnactive(id, index) { | ||||
| 				const indexInTcidList = this.tcidlist.indexOf(id); | ||||
| 				if (indexInTcidList !== -1) { | ||||
|  | @ -105,6 +137,8 @@ | |||
| 
 | ||||
| 			// 点击确定 | ||||
| 			btnqd() { | ||||
| 				this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res=>{}) | ||||
| 				 | ||||
| 				let numArr = this.tcidlist.map(item => parseInt(item, 10)) | ||||
| 				let data = { | ||||
| 					deviceId: this.deviceId, | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ | |||
| 				<span class="device-list-title">WIFI选择</span> | ||||
| 			</view> | ||||
| 			<view class="flex-row items-center flex-1 group"> | ||||
| 				<text class="text_3 ml-3">请选择您需要连接的wifi名称</text> | ||||
| 				<text class="text_3 ml-3">请选择您需要连接的2.4Gwifi名称</text> | ||||
| 			</view> | ||||
| 
 | ||||
| 			<!-- wifi列表 --> | ||||
|  | @ -43,7 +43,7 @@ | |||
| 
 | ||||
| 						<view class="content"> | ||||
| 							<view class="bt">{{item.SSID}}</view> | ||||
| 							<view class="wz" style="color: #8883F0 ;">{{item.BSSID}}</view> | ||||
| 							<!-- <view class="wz" style="color: #8883F0 ;">{{item.BSSID}}</view> --> | ||||
| 						</view> | ||||
| 					</view> | ||||
| 					<image src="https://api.ccttiot.com/smartmeter/img/static/uLrArPv3OrIodtWZ3gri" mode="" | ||||
|  | @ -52,7 +52,7 @@ | |||
| 				</view> | ||||
| 			</view> | ||||
| 			<view class="annius" style="display: flex;justify-content: space-between;"> | ||||
| 				<view class="" @click="btnsd">手动输入WIFI</view> | ||||
| 				<view class="" @click="btnsd">手动输入WiFi</view> | ||||
| 				<view class="" @click="btnxyb">下一步</view> | ||||
| 			</view> | ||||
| 
 | ||||
|  | @ -297,7 +297,7 @@ | |||
| 			display: inline-block; | ||||
| 			margin-top: 10rpx; | ||||
| 			width: 50rpx; | ||||
| 			height: 46rpx; | ||||
| 			height: 42rpx; | ||||
| 		} | ||||
| 	} | ||||
|     .annius{ | ||||
|  | @ -307,8 +307,8 @@ | |||
| 		transform: translateX(-50%); | ||||
| 		bottom: 50rpx; | ||||
| 		border-radius: 52rpx 52rpx 52rpx 52rpx; | ||||
| 		font-weight: 700; | ||||
| 		font-size: 20px; | ||||
| 		// font-weight: 700; | ||||
| 		font-size: 38rpx; | ||||
| 		width: 90%; | ||||
| 		view{ | ||||
| 			color: #FFFFFF; | ||||
|  | @ -446,6 +446,7 @@ | |||
| 
 | ||||
| 				view { | ||||
| 					height: 40rpx; | ||||
| 					margin-top: 20rpx; | ||||
| 				} | ||||
| 
 | ||||
| 				.wz { | ||||
|  | @ -467,7 +468,7 @@ | |||
| 
 | ||||
| 	.device-list-title { | ||||
| 		color: #50565a; | ||||
| 		font-size: 96rpx; | ||||
| 		font-size: 86rpx; | ||||
| 		font-family: SourceHanSansCN; | ||||
| 		margin-top: 100rpx; | ||||
| 	} | ||||
|  |  | |||
|  | @ -350,18 +350,13 @@ | |||
| 			}, | ||||
| 			bind() { | ||||
| 				if (this.ishave && this.isband) { | ||||
| 
 | ||||
| 					let that = this | ||||
| 					setTimeout(() => { | ||||
| 						uni.switchTab({ | ||||
| 							url: '/pages/index/index' | ||||
| 						}) | ||||
| 					}, ) | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 				} | ||||
| 
 | ||||
| 			}, | ||||
| 			// 解析自定义数据 | ||||
| 			parseCustomData(data) { | ||||
|  | @ -418,7 +413,6 @@ | |||
| 							// 	icon: 'none' | ||||
| 							// });  | ||||
| 							{ | ||||
| 
 | ||||
| 								xBlufi.notifyInitBleEsp32({ | ||||
| 									deviceId: this.deviceId | ||||
| 								}); | ||||
|  |  | |||
|  | @ -97,7 +97,7 @@ | |||
| 	export default { | ||||
| 		data() { | ||||
| 			return { | ||||
| 				checked:false, | ||||
| 				checked:true, | ||||
| 				params: { | ||||
| 					hour: true, | ||||
| 					minute: true, | ||||
|  |  | |||
|  | @ -316,9 +316,9 @@ | |||
| 				xBlufi.notifyStartDiscoverBle({ | ||||
| 					'isStart': false | ||||
| 				}); | ||||
| 				console.log(e, '蓝牙信息101010') | ||||
| 				// console.log(e, '蓝牙信息101010') | ||||
| 				this.mac = e.name.substring(5) | ||||
| 				console.log(this.mac, '54545454'); | ||||
| 				// console.log(this.mac, '54545454'); | ||||
| 				// xBlufi.notifyConnectBle({   | ||||
| 				// 	isStart: true, | ||||
| 				// 	deviceId: e.deviceId, | ||||
|  | @ -332,7 +332,7 @@ | |||
| 				this.$u.post('/app/device', data).then((res) => { | ||||
| 					if (res.code == 200) { | ||||
| 						uni.showToast({ | ||||
| 							title: '录入成功', | ||||
| 							title: '设备录入成功', | ||||
| 							icon: 'success', | ||||
| 							duration: 2000	 | ||||
| 						})  | ||||
|  | @ -340,7 +340,7 @@ | |||
| 						uni.hideLoading() | ||||
| 						setTimeout(()=>{ | ||||
| 							uni.navigateBack() | ||||
| 						},500) | ||||
| 						},2000) | ||||
| 						uni.removeStorageSync('mac'); | ||||
| 						// uni.showModal({   | ||||
| 						//     title: '提示',   | ||||
|  | @ -371,7 +371,7 @@ | |||
| 			}, | ||||
| 			// 点击重新搜索 | ||||
| 			Search() { | ||||
| 				console.log(1); | ||||
| 				// console.log(1); | ||||
| 				// if (this.status) { | ||||
| 				xBlufi.notifyStartDiscoverBle({ | ||||
| 					'isStart': true | ||||
|  |  | |||
|  | @ -28,21 +28,21 @@ | |||
| 				</view> | ||||
| 				<view class="cen"> | ||||
| 					<view class="cena" style="font-weight: 600;"> | ||||
| 						{{listobj.name}} | ||||
| 						{{listobj.name == undefined ? '--' : listobj.name}} | ||||
| 					</view> | ||||
| 					<view class="cenb"> | ||||
| 						<image src="https://api.ccttiot.com/smartmeter/img/static/uHK2aJHvzEm3nbOPwpdr" mode=""></image> | ||||
| 						{{listobj.address}} | ||||
| 						{{listobj.address == undefined ? '--' : listobj.address}} | ||||
| 					</view> | ||||
| 					<view class="cenc"> | ||||
| 						共享时间:{{listobj.businessTimeStart}}-{{listobj.businessTimeEnd}} <text | ||||
| 						共享时间:{{listobj.businessTimeStart == undefined ? '--' : listobj.businessTimeStart}}-{{listobj.businessTimeEnd == undefined ? '--' : listobj.businessTimeEnd}} <text | ||||
| 							class="bu">{{listobj.availableDeviceCount}}台可共享</text> | ||||
| 					</view> | ||||
| 				</view> | ||||
| 			</view> | ||||
| 			<view class="chakan" @click="btnchak(listobj.storeId)"> | ||||
| 				<view class=""> | ||||
| 					本店共有{{listobj.deviceCount}}台共享设备 | ||||
| 					本店共有{{listobj.deviceCount == undefined ? '--' : listobj.deviceCount}}台共享设备 | ||||
| 				</view> | ||||
| 				<view class=""> | ||||
| 					查看 <u-icon name="arrow-right" color="#6863D9" size="24" style="margin-left: 10rpx;"></u-icon> | ||||
|  |  | |||
|  | @ -86,7 +86,7 @@ | |||
| 								<image src="https://api.ccttiot.com/smartmeter/img/static/uKrpw3p37UHW56IypPJU" mode="" | ||||
| 									style="width: 58rpx;height: 56rpx;"></image> | ||||
| 							</view> | ||||
| 							<view class="bot">充值记录</view> | ||||
| 							<view class="bot" style="margin-top: 18rpx;">充值记录</view> | ||||
| 						</view> | ||||
| 						<view class="cont"  @click="topage(1)"> | ||||
| 							<view class="top"> | ||||
|  | @ -122,7 +122,7 @@ | |||
| 								<image src="https://api.ccttiot.com/smartmeter/img/static/umjPUc8nDKf1JwVqRAeb" mode="" | ||||
| 									style="width: 58rpx;height: 60rpx;"></image> | ||||
| 							</view> | ||||
| 							<view class="bot">收费方式</view> | ||||
| 							<view class="bot" style="margin-top: 10rpx;">收费方式</view> | ||||
| 						</view> | ||||
| 						<view class="cont"  @click="topage(4)"> | ||||
| 							<view class="top"> | ||||
|  | @ -328,16 +328,17 @@ | |||
| 			// 开启和关闭 | ||||
| 			btnkq(){ | ||||
| 				if(this.tdtxt == '开启'){ | ||||
| 					this.$u.put(`/app/device/${this.id}/changePower?status=1`).then((res) => { | ||||
| 					this.$u.put(`/app/device/${this.id}/changePower?status=0`).then((res) => { | ||||
| 						if (res.code == 200) { | ||||
| 							this.tdtxt = '关闭' | ||||
| 							this.checked = true | ||||
| 							this.checked = false | ||||
| 							uni.showToast({ | ||||
| 								title: res.msg, | ||||
| 								icon: 'success', | ||||
| 								duration: 2000 | ||||
| 							}) | ||||
| 						}else{ | ||||
| 							this.checked = false | ||||
| 							uni.showToast({ | ||||
| 								title: res.msg, | ||||
| 								icon: 'none', | ||||
|  | @ -346,9 +347,9 @@ | |||
| 						} | ||||
| 					}) | ||||
| 				}else{ | ||||
| 					this.$u.put(`/app/device/${this.id}/changePower?status=0`).then((res) => { | ||||
| 					this.$u.put(`/app/device/${this.id}/changePower?status=1`).then((res) => { | ||||
| 						if (res.code == 200) { | ||||
| 							this.checked = false | ||||
| 							this.checked = true | ||||
| 							this.tdtxt = '开启' | ||||
| 							uni.showToast({ | ||||
| 								title: res.msg, | ||||
|  | @ -356,6 +357,7 @@ | |||
| 								duration: 2000 | ||||
| 							}) | ||||
| 						}else{ | ||||
| 							this.checked = false | ||||
| 							uni.showToast({ | ||||
| 								title: res.msg, | ||||
| 								icon: 'none', | ||||
|  | @ -446,31 +448,38 @@ | |||
| 								this.startTimer() | ||||
| 							} | ||||
| 						} | ||||
| 						if(res.data.powerStatus == 0){ | ||||
| 							this.checked = false | ||||
| 							this.tdtxt = '关闭' | ||||
| 						}else{ | ||||
| 							this.checked = true | ||||
| 							this.tdtxt = '开启' | ||||
| 						} | ||||
| 						this.loadings = true | ||||
| 					} | ||||
| 				}); | ||||
| 				}) | ||||
| 			}, | ||||
| 			startTimer() {   | ||||
| 			      this.timer = setInterval(() => {   | ||||
| 			        if (this.timeday.seconds > 0) {   | ||||
| 			          this.timeday.seconds--;   | ||||
| 			          this.timeday.seconds--  | ||||
| 			        } else if (this.timeday.minutes > 0) {   | ||||
| 			          this.timeday.seconds = 59; // 重置秒数为59   | ||||
| 			          this.timeday.minutes--;   | ||||
| 			          this.timeday.seconds = 59 // 重置秒数为59   | ||||
| 			          this.timeday.minutes--   | ||||
| 			        } else if (this.timeday.hours > 0) {   | ||||
| 			          this.timeday.minutes = 59; // 重置分钟数为59   | ||||
| 			          this.timeday.hours--;   | ||||
| 			          this.timeday.seconds = 0; // 同时重置秒数为0   | ||||
| 			          this.timeday.minutes = 59 // 重置分钟数为59   | ||||
| 			          this.timeday.hours--   | ||||
| 			          this.timeday.seconds = 0 // 同时重置秒数为0   | ||||
| 			        } else if (this.timeday.days > 0) {   | ||||
| 			          this.timeday.hours = 23; // 重置小时数为23   | ||||
| 			          this.timeday.minutes = 59; // 重置分钟数为59   | ||||
| 			          this.timeday.seconds = 0; // 重置秒数为0   | ||||
| 			          this.timeday.days--;   | ||||
| 			          this.timeday.hours = 23 // 重置小时数为23   | ||||
| 			          this.timeday.minutes = 59 // 重置分钟数为59   | ||||
| 			          this.timeday.seconds = 0 // 重置秒数为0   | ||||
| 			          this.timeday.days--   | ||||
| 			        } else {   | ||||
| 			          // 所有时间单位都已减为0,停止定时器   | ||||
| 			          clearInterval(this.timer);   | ||||
| 			          clearInterval(this.timer)  | ||||
| 			          this.timer = null;   | ||||
| 			          console.log('时间已到期');   | ||||
| 			          // console.log('时间已到期')  | ||||
| 			        }   | ||||
| 			      }, 1000); // 每秒执行一次   | ||||
| 				}, | ||||
|  | @ -499,7 +508,7 @@ | |||
| 				} else { | ||||
| 					stause = 1 | ||||
| 				} | ||||
| 				console.log(stause, 'stausestause'); | ||||
| 				// console.log(stause, 'stausestause'); | ||||
| 				this.$u.put(`/app/device/${this.deviceInfo.deviceId}/changePower?status=` + stause).then((res) => { | ||||
| 					// this.$forceUpdate() | ||||
| 					if (res.code == 200) { | ||||
|  | @ -559,6 +568,8 @@ | |||
| 							    			duration: 2000 | ||||
| 							    		}) | ||||
| 							    		that.getDevice(that.id) | ||||
| 										this.checked = false | ||||
| 										this.tdtxt = '关闭' | ||||
| 							    	} else if (res.msg == '设备剩余时间不足,无需归零') { | ||||
| 							    		uni.showToast({ | ||||
| 							    			title: '设备剩余时间不足,无需归零', | ||||
|  | @ -624,7 +635,10 @@ | |||
| 						url: '/page_user/setting?id=' + this.id | ||||
| 					}) | ||||
| 				} else if (num == 5) { | ||||
| 					console.log(this.deviceId,'idididididdidii'); | ||||
| 					uni.showLoading({ | ||||
| 						title: '蓝牙连接中...' | ||||
| 					}) | ||||
| 					// console.log(this.deviceId,'idididididdidii'); | ||||
| 					if(this.deviceId == ''){ | ||||
| 						xBlufi.initXBlufi(1); | ||||
| 						xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); | ||||
|  | @ -636,8 +650,7 @@ | |||
| 						setTimeout(() => { | ||||
| 							xBlufi.notifyStartDiscoverBle({ | ||||
| 								'isStart': false | ||||
| 							}); | ||||
| 						 | ||||
| 							}) | ||||
| 							xBlufi.notifyConnectBle({ | ||||
| 								isStart: true, | ||||
| 								deviceId: this.deviceId, | ||||
|  | @ -704,11 +717,11 @@ | |||
| 						} | ||||
| 						this.$u.put('/app/device/bind', data).then((res) => { | ||||
| 							if (res.code == 200) { | ||||
| 								uni.showToast({ | ||||
| 									title: '绑定成功', | ||||
| 									icon: 'none', | ||||
| 									duration: 2000 | ||||
| 								}) | ||||
| 								// uni.showToast({ | ||||
| 								// 	title: '绑定成功', | ||||
| 								// 	icon: 'none', | ||||
| 								// 	duration: 2000 | ||||
| 								// }) | ||||
| 								uni.hideLoading(); | ||||
| 								uni.removeStorageSync('mac'); | ||||
| 								let systemInfo = uni.getSystemInfoSync(); | ||||
|  | @ -723,19 +736,23 @@ | |||
| 										url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name | ||||
| 									}) | ||||
| 								} | ||||
| 							}else if(res.msg == '设备编号和mac不能同时为空'){ | ||||
| 							}else { | ||||
| 								if(res.msg == '设备编号和mac不能同时为空'){ | ||||
| 									    uni.hideLoading() | ||||
| 										uni.showToast({ | ||||
| 											title: '未找到设备', | ||||
| 											icon: 'none', | ||||
| 											duration: 2000 | ||||
| 										}) | ||||
| 								} else { | ||||
| 									uni.hideLoading() | ||||
| 									uni.showToast({ | ||||
| 										title: '未找到设备', | ||||
| 										title:res.msg, | ||||
| 										icon: 'none', | ||||
| 										duration: 2000 | ||||
| 									}); | ||||
| 							} else { | ||||
| 								uni.showToast({ | ||||
| 									title:res.msg, | ||||
| 									icon: 'none', | ||||
| 									duration: 2000 | ||||
| 								}); | ||||
| 								// uni.navigateBack() | ||||
| 									}) | ||||
| 									// uni.navigateBack() | ||||
| 								} | ||||
| 							} | ||||
| 						}) | ||||
| 					} | ||||
|  | @ -746,7 +763,7 @@ | |||
| 			}, | ||||
| 			trueje(){ | ||||
| 				if (this.timer) { | ||||
| 				  clearInterval(this.timer);   | ||||
| 				  clearInterval(this.timer) | ||||
| 				  this.timer = null;  | ||||
| 				}   | ||||
| 				let id = this.deviceInfo.deviceId | ||||
|  | @ -811,18 +828,16 @@ | |||
| 						// console.log("文件读取中", options.data); | ||||
| 						break; | ||||
| 					case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: | ||||
| 
 | ||||
| 						let ver_data =  this.parseCustomData(options.data)  | ||||
| 						this.setMode = Math.floor(ver_data.setMode / 60) | ||||
| 						console.log("1收到设备发来的自定义数据结果:", ver_data,this.setMode); | ||||
| 						console.log("1收到设备发来的自定义数据结果:", ver_data,this.setMode) | ||||
| 						break; | ||||
| 
 | ||||
| 					case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: | ||||
| 						if (options.result) { | ||||
| 							let devicesarr = options.data | ||||
| 							// console.log(devicesarr,'devicesarrdevicesarr'); | ||||
| 							devicesarr.forEach(device => { | ||||
| 								const mac = device.name.substring(5); | ||||
| 								const mac = device.name.substring(5) | ||||
| 								if (device.name == this.qrResult) { | ||||
| 									this.deviceId = device.deviceId | ||||
| 									this.name = device.name | ||||
|  | @ -848,17 +863,20 @@ | |||
| 							} | ||||
| 						} else { | ||||
| 							uni.hideLoading() | ||||
| 							uni.showToast({ | ||||
| 								title: '设备离线或不在范围内', | ||||
| 								icon: 'none', | ||||
| 								duration: 2000 | ||||
| 							}) | ||||
| 							// uni.showToast({ | ||||
| 							// 	title: '设备离线或不在范围内', | ||||
| 							// 	icon: 'none', | ||||
| 							// 	duration: 2000 | ||||
| 							// }) | ||||
| 						} | ||||
| 
 | ||||
| 						break; | ||||
| 
 | ||||
| 					case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: | ||||
| 						if (!options.result) { | ||||
| 							setTimeout(()=>{ | ||||
| 								uni.hideLoading() | ||||
| 							},3000) | ||||
| 							console.log("蓝牙未开启", options); | ||||
| 							// uni.showToast({ | ||||
| 							// 	title: '蓝牙未开启', | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
| 				<span class="device-list-title">WIFI连接</span> | ||||
| 			</view> | ||||
| 			<view class="flex-row items-center flex-1 group"> | ||||
| 				<text class="text_3 ml-3">请选择您的WiFi网络详细信息</text> | ||||
| 				<text class="text_3 ml-3">请输入您的WiFi名称和密码</text> | ||||
| 			</view> | ||||
| 
 | ||||
| 			<!-- wifi信息 --> | ||||
|  | @ -282,7 +282,7 @@ | |||
| 
 | ||||
| 	.device-list-title { | ||||
| 		color: #50565a; | ||||
| 		font-size: 96rpx; | ||||
| 		font-size: 86rpx; | ||||
| 		font-family: SourceHanSansCN; | ||||
| 		// margin-top: 100rpx; | ||||
| 	} | ||||
|  |  | |||
|  | @ -100,14 +100,15 @@ | |||
| 										<view class="sta_txt" v-if="item.status==1" style="color:seagreen;"> | ||||
| 											空闲 | ||||
| 										</view> | ||||
| 										<view @click="sremakes(item)" v-if="item.storeId == null" class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 180rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-left: 20rpx;"> | ||||
| 											未分配店铺 | ||||
| 										</view> | ||||
| 									 | ||||
| 									</view> | ||||
| 									<view class="card_left_no" @click="todetail(item.deviceId)"> | ||||
| 										S/N码:{{item.deviceNo}} | ||||
| 									</view> | ||||
| 									<view v-if="curtitidx==0" style="color: #ccc;margin-top: 20rpx;" @click="todetail(item.deviceId)"> | ||||
| 									<view @click="sremakes(item)" v-if="item.storeId == null" class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 180rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-top: 20rpx;"> | ||||
| 										未分配店铺 | ||||
| 									</view> | ||||
| 									<view v-else style="color: #ccc;margin-top: 20rpx;" @click="todetail(item.deviceId)"> | ||||
| 									   归属店铺:	{{item.storeName == null ? '--' : item.storeName}} | ||||
| 									</view> | ||||
| 									<!-- <view @click="sremakes(item)" v-else class="dianpu" style="border: 1px solid #8883F0;padding: 5rpx;box-sizing: border-box;width: 200rpx;border-radius: 20rpx;color: #8883F0;text-align: center;margin-top: 20rpx;"> | ||||
|  | @ -732,14 +733,12 @@ | |||
| 						this.deviceInfo = res.data | ||||
| 						this.loadings = true | ||||
| 					} | ||||
| 				}); | ||||
| 
 | ||||
| 				}) | ||||
| 			}, | ||||
| 			getuserinfo() { | ||||
| 				this.$u.get("/app/user/userInfo").then((res) => { | ||||
| 					// this.$forceUpdate() | ||||
| 					if (res.code == 200) { | ||||
| 
 | ||||
| 						// uni.setStorageSync('userType', res.data.userType) | ||||
| 						this.userType = res.data.userType | ||||
| 						if (this.userType == '01') { | ||||
|  | @ -747,7 +746,6 @@ | |||
| 						} else if (this.userType == '00') { | ||||
| 							this.getdevice() | ||||
| 						} | ||||
| 
 | ||||
| 					} else { | ||||
| 						this.jmlogin() | ||||
| 					} | ||||
|  | @ -767,22 +765,20 @@ | |||
| 										url: '/pages/login/login' | ||||
| 									}) | ||||
| 								} else if (res.code == 200) { | ||||
| 									uni.setStorageSync('token', res.token); | ||||
| 									uni.setStorageSync('token', res.token) | ||||
| 									taht.logins() | ||||
| 								} | ||||
| 							}); | ||||
| 							}) | ||||
| 						} | ||||
| 					}, | ||||
| 
 | ||||
| 				}); | ||||
| 				}) | ||||
| 			}, | ||||
| 			getDeviceList() { | ||||
| 				this.$u.get("/app/device/list").then((res) => { | ||||
| 					// this.$forceUpdate() | ||||
| 					if (res.code == 200) { | ||||
| 						this.deviceList = res.rows.filter(row => row.isDefault === true) | ||||
| 						console.log(this.deviceList); | ||||
| 
 | ||||
| 						// console.log(this.deviceList) | ||||
| 						this.total = res.total | ||||
| 						if (this.deviceList == '') { | ||||
| 							this.addflag = true | ||||
|  | @ -792,8 +788,7 @@ | |||
| 							this.sbflag = true | ||||
| 						} | ||||
| 					} | ||||
| 				}); | ||||
| 
 | ||||
| 				}) | ||||
| 			}, | ||||
| 			swiperchange(e) { | ||||
| 				uni.showLoading({ | ||||
|  | @ -819,7 +814,7 @@ | |||
| 					uni.setStorageSync('deviceId', this.deviceInfo.deviceId) | ||||
| 					// this.initChart() | ||||
| 					this.order() | ||||
| 				}); | ||||
| 				}) | ||||
| 			}, | ||||
| 			changeidx(index) { | ||||
| 				this.pagenum = 1 | ||||
|  | @ -875,7 +870,6 @@ | |||
| 			left: 72rpx; | ||||
| 			top: 788rpx; | ||||
| 			width: 610rpx; | ||||
| 			// height: 282rpx; | ||||
| 			background: #F7FAFE; | ||||
| 			border-radius: 30rpx 30rpx 30rpx 30rpx; | ||||
| 			z-index: 10000000; | ||||
|  | @ -1322,12 +1316,10 @@ | |||
| 			.fd_top { | ||||
| 				display: flex; | ||||
| 				flex-wrap: nowrap; | ||||
| 				// justify-content: space-between; | ||||
| 				align-items: center; | ||||
| 
 | ||||
| 				.fd_da { | ||||
| 					width: 600rpx; | ||||
| 					// overflow-x: scroll; | ||||
| 					overflow: hidden; | ||||
| 					overflow-x: auto; | ||||
| 					white-space: nowrap; | ||||
|  | @ -1341,7 +1333,6 @@ | |||
| 					} | ||||
| 
 | ||||
| 					.fd_lt { | ||||
| 						// width: 100vh; | ||||
| 						display: flex; | ||||
| 						transition: transform 0.3s ease; | ||||
|                         padding-top: 10rpx; | ||||
|  | @ -1373,9 +1364,6 @@ | |||
| 					align-items: center; | ||||
| 
 | ||||
| 					.fd_set { | ||||
| 						// margin-bottom: 10rpx; | ||||
| 						// margin-left: 200rpx; | ||||
| 						// margin-left: auto; | ||||
| 						font-size: 60rpx; | ||||
| 					} | ||||
| 
 | ||||
|  | @ -1402,7 +1390,6 @@ | |||
| 
 | ||||
| 			.swiper { | ||||
| 
 | ||||
| 				// height: 100vh; | ||||
| 				.swiper-item { | ||||
| 					height: 100vh; | ||||
| 					overflow-y: auto; | ||||
|  | @ -1415,7 +1402,6 @@ | |||
| 
 | ||||
| 						.card { | ||||
| 							display: flex; | ||||
| 							// align-items: center; | ||||
| 							margin-top: 20rpx; | ||||
| 							width: 658rpx; | ||||
| 							max-height: 300rpx; | ||||
|  | @ -1427,7 +1413,7 @@ | |||
| 
 | ||||
| 							.card_left { | ||||
| 								width: 310rpx; | ||||
| 								margin-top: 46rpx; | ||||
| 								margin-top: 20rpx; | ||||
| 								margin-left: 50rpx; | ||||
| 
 | ||||
| 								.card_left_tit { | ||||
|  | @ -1521,4 +1507,5 @@ | |||
| 			box-sizing: border-box; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| </style> | ||||
|  | @ -130,24 +130,45 @@ | |||
| 						this.deviceobj = res.data | ||||
| 					}  | ||||
| 				}) | ||||
| 
 | ||||
| 				let that = this | ||||
| 				uni.showModal({ | ||||
| 					title: '提示', | ||||
| 					content: '该设备未被绑定,你需进行绑定吗?', | ||||
| 					success: function(res) { | ||||
| 						if (res.confirm) { | ||||
| 				// uni.showModal({ | ||||
| 					// title: '提示', | ||||
| 					// content: '该设备未被绑定,你需进行绑定吗?', | ||||
| 					// success: function(res) { | ||||
| 						// if (res.confirm) { | ||||
| 							let data = { | ||||
| 								deviceNo: id | ||||
| 							} | ||||
| 							that.$u.put("/app/device/bind", data).then(res => { | ||||
| 								if (res.code == 200) { | ||||
| 									uni.navigateTo({ | ||||
| 										url: '/page_components/bindsz?id=' + that.deviceobj.deviceId | ||||
| 									uni.showModal({ | ||||
| 										title: '提示', | ||||
| 										content: '该设备未绑定,你需进行绑定吗?', | ||||
| 										success: function(res) { | ||||
| 											if (res.confirm) { | ||||
| 									            uni.navigateTo({ | ||||
| 									            	url: '/page_components/bindsz?id=' + that.deviceobj.deviceId | ||||
| 									            }) | ||||
| 											} else if (res.cancel) { | ||||
| 												 | ||||
| 											} | ||||
| 										} | ||||
| 									}) | ||||
| 								} else { | ||||
| 									if (res.msg == '设备未录入') { | ||||
| 										uni.navigateTo({ | ||||
| 											url: '/page_fenbao/zhuce?sn=' + id | ||||
| 										uni.showModal({ | ||||
| 											title: '提示', | ||||
| 											content: '该设备未录入,你需进行录入吗?', | ||||
| 											success: function(res) { | ||||
| 												if (res.confirm) { | ||||
| 										           uni.navigateTo({ | ||||
| 										           	url: '/page_fenbao/zhuce?sn=' + id | ||||
| 										           }) | ||||
| 												} else if (res.cancel) { | ||||
| 													 | ||||
| 												} | ||||
| 											} | ||||
| 										}) | ||||
| 									} else { | ||||
| 										uni.showToast({ | ||||
|  | @ -158,13 +179,13 @@ | |||
| 									} | ||||
| 								} | ||||
| 							}) | ||||
| 						} else if (res.cancel) { | ||||
| 						// } else if (res.cancel) { | ||||
| 							// uni.navigateTo({ | ||||
| 							// 	url: '/pages/shouye/index' | ||||
| 							// }) | ||||
| 						} | ||||
| 					} | ||||
| 				}) | ||||
| 						// } | ||||
| 					// } | ||||
| 				// }) | ||||
| 			} | ||||
| 		}, | ||||
| 		// 分享到好友(会话)   | ||||
|  | @ -210,8 +231,6 @@ | |||
| 				}) | ||||
| 			}, | ||||
| 			 | ||||
| 			 | ||||
| 			 | ||||
| 			btnitem(deviceId){ | ||||
| 				uni.navigateTo({ | ||||
| 					url:'/page_components/eletj?id=' + deviceId | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user