zhangyun 5 лет назад
Родитель
Сommit
ca7eec3e7e
41 измененных файлов с 4372 добавлено и 3411 удалено
  1. 9 34
      pages.json
  2. 69 15
      pages/cb/bzy/equip-set/bzyhistoryile.vue
  3. 2 0
      pages/cb/cbd/equip-set/equip-set.vue
  4. 77 23
      pages/cb/cbd/equip-set/historyfile.vue
  5. 10 3
      pages/cb/cbd/equip-set/imgpage.vue
  6. 3 3
      pages/cb/equip-detail/equip-detail.vue
  7. 112 105
      pages/cb/index/index.vue
  8. 216 0
      pages/cb/index/search.vue
  9. 55 12
      pages/cb/xy/equip-set/xyhistoryile.vue
  10. 59 61
      pages/disandpests/index.vue
  11. 19 8
      pages/distribution/index.vue
  12. 3 1
      pages/equipMange/index/addusers.vue
  13. 7 6
      pages/equipMange/index/useroperation.vue
  14. 1 0
      pages/login/login.vue
  15. 3 3
      pages/my/index/index.vue
  16. 48 40
      pages/prevention/sim.vue
  17. 51 6
      pages/prevention/ucharts.vue
  18. 0 50
      pages/search/search.vue
  19. BIN
      static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png
  20. BIN
      static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png
  21. 2 2
      unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js
  22. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-service.js
  23. 1 1
      unpackage/cache/wgt/__UNI__DBA6730/app-view.js
  24. BIN
      unpackage/cache/wgt/__UNI__DBA6730/static/image/6209a98f0cb3b5086f2ca36152c9269.png
  25. BIN
      unpackage/cache/wgt/__UNI__DBA6730/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png
  26. BIN
      unpackage/cache/wgt/__UNI__DBA6730/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png
  27. 2 2
      unpackage/dist/build/app-plus/app-config-service.js
  28. 1 1
      unpackage/dist/build/app-plus/app-service.js
  29. 1 1
      unpackage/dist/build/app-plus/app-view.js
  30. BIN
      unpackage/dist/build/app-plus/static/image/6209a98f0cb3b5086f2ca36152c9269.png
  31. BIN
      unpackage/dist/build/app-plus/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png
  32. BIN
      unpackage/dist/build/app-plus/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png
  33. 2 2
      unpackage/dist/dev/app-plus/app-config-service.js
  34. 1757 1507
      unpackage/dist/dev/app-plus/app-service.js
  35. 1861 1524
      unpackage/dist/dev/app-plus/app-view.js
  36. BIN
      unpackage/dist/dev/app-plus/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png
  37. BIN
      unpackage/dist/dev/app-plus/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png
  38. BIN
      unpackage/release/apk/__UNI__DBA6730_20210402114507.apk
  39. BIN
      unpackage/release/apk/__UNI__DBA6730_20210402115159.apk
  40. BIN
      unpackage/release/apk/__UNI__DBA6730_20210402165806.apk
  41. BIN
      unpackage/release/apk/__UNI__DBA6730_20210408090006.apk

+ 9 - 34
pages.json

@@ -10,7 +10,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		},
 		{
 			"path": "pages/index/index",
@@ -45,13 +44,6 @@
 			}
 
 		}, {
-			"path": "pages/search/search",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false,
-				"app-plus": {}
-			}
-		}, {
 			"path": "pages/my/about/about",
 			"style": {
 				"navigationBarTitleText": "关于",
@@ -80,26 +72,6 @@
 			}
 
 		}, {
-			"path": "pages/search/search",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false,
-				"app-plus": {
-					"bounce": "none",
-					"titleNView": {
-						"searchInput": {
-							"autoFocus": true,
-							"align": "center",
-							"placeholder": "输入设备号搜索",
-							"borderRadius": "50px",
-							"backgroundColor": "#E4E4E4",
-							"placeholderColor": "#333"
-						}
-					}
-				}
-			}
-
-		}, {
 			"path": "pages/cb/equip-detail/equip-detail",
 			"style": {
 				"navigationBarTitleText": "设备详情",
@@ -425,7 +397,7 @@
 			"path": "pages/cb/cbd/equip-set/historyfile",
 			"style": {
 				"navigationBarTitleText": "测报灯历史记录",
-				"enablePullDownRefresh": false,
+				"enablePullDownRefresh": true,
 				"navigationStyle": "custom"
 			}
 
@@ -709,7 +681,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		}, {
 			"path": "pages/environment/search",
 			"style": {
@@ -717,7 +688,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		}, {
 			"path": "pages/environment/equipment",
 			"style": {
@@ -725,7 +695,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		}, {
 			"path": "pages/environment/contros",
 			"style": {
@@ -733,7 +702,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		}, {
 			"path": "pages/environment/onedaythedata",
 			"style": {
@@ -741,7 +709,6 @@
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
 			}
-
 		}, {
 			"path": "pages/environment/history",
 			"style": {
@@ -838,6 +805,14 @@
 				}
 			}
 
+		}, {
+			"path": "pages/cb/index/search",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
+
 		}
 	],
 	"condition": { //模式配置,仅开发期间生效

+ 69 - 15
pages/cb/bzy/equip-set/bzyhistoryile.vue

@@ -18,6 +18,9 @@
 				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
 				 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
+			<view class="refresh" @click="refresh">
+				刷 新
+			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
 					<!-- @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" -->
@@ -63,8 +66,6 @@
 <script>
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
 	var canvaColumnA = null;
-	var newtime = +new Date()
-	var strrttime = newtime - 24 * 60 * 60 * 1000
 	export default {
 		data() {
 			return {
@@ -73,16 +74,17 @@
 					height: "400rpx"
 				},
 				d_id: '',
-				start_time: strrttime,
-				end_time: newtime,
+				start_time: "",
+				end_time: "",
 				historydatas: [],
 				titletext: ["24小时", "近一个月", "近半年", "近一年"],
 				titleidnex: 0,
 				device_id: '',
 				page: 1,
-				pagesum:null,
+				pagesum: null,
 				historylistdata: [],
-				thdata: ["上报时间","设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓温度设定温度(°C)", "保温仓温度当前温度(°C)", "电池状态", "雨控状态", "摄像头状态", "信号强度", "电流(mA)",
+				thdata: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓温度设定温度(°C)", "保温仓温度当前温度(°C)", "电池状态", "雨控状态", "摄像头状态", "信号强度",
+					"电流(mA)",
 					"电压(V)", "设备版本"
 				],
 				forbidden: false,
@@ -123,9 +125,9 @@
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
 						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
-						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
-						arr3.unshift(res[i].others==""?"0":res[i].others)
+						arr1.unshift(res[i].temperature == "" ? "0" : res[i].temperature)
+						arr2.unshift(res[i].humidity == "" ? "0" : res[i].humidity)
+						arr3.unshift(res[i].others == "" ? "0" : res[i].others)
 					}
 					var obj = [{
 						name: '温度',
@@ -156,7 +158,7 @@
 					}
 				})
 				this.historylistdata = res.data
-				this.pagesum = Math.ceil(res.counts/10+1)
+				this.pagesum = Math.ceil(res.counts / 10 + 1)
 				if (res.data.length == 0) {
 					this.forbidden = true
 					console.log(res.data.length)
@@ -171,7 +173,7 @@
 				var now = new Date()
 				this.$forceUpdate()
 				if (index == 0) {
-					this.start_time = strrttime
+					this.start_time = this.end_time - 24 * 60 * 60 * 1000
 					this.history()
 					this.historylist()
 				} else if (index == 1) {
@@ -258,14 +260,49 @@
 					}
 				});
 			},
+			async newdata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.get_device_config',
+					data: {
+						device_type_id: 7,
+						d_id: this.d_id,
+						control_type: "data"
+					}
+				})
+				if(res){
+					uni.showToast({
+						title: '刷新成功',
+						duration: 2000,
+						icon: "none"
+					});
+					uni.navigateBack({
+						delta: 1
+					})
+				}else{
+					uni.showToast({
+						title: '刷新失败',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			refresh() { //获取当前时间的数据
+				this.newdata()
+			},
 		},
 		onLoad(option) {
 			this.d_id = option.d_id
 			this.device_id = option.device_id
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
-			this.history()
-			this.historylist()
+		},
+		onShow() {
+			this.end_time = +new Date() 
+			this.start_time = this.end_time - 24 * 60 * 60 * 1000
+			setTimeout(()=>{
+				this.history()
+				this.historylist()
+			},1000)
 		}
 	}
 </script>
@@ -280,7 +317,8 @@
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding-top: 20rpx;
 		height: 550rpx;
-		.canvastishi{
+
+		.canvastishi {
 			font-size: 32rpx;
 			position: absolute;
 			top: 50%;
@@ -288,6 +326,7 @@
 			margin-left: -64rpx;
 			margin-top: -21rpx;
 		}
+
 		.shuju_one_title {
 			width: 70%;
 			margin: 0 auto;
@@ -315,9 +354,21 @@
 		}
 	}
 
-	.condition {
+	.refresh {
 		position: absolute;
 		top: 700rpx;
+		left: 5%;
+		width: 160rpx;
+		height: 50rpx;
+		background-color: #28AE4F;
+		color: #FFFFFF;
+		line-height: 50rpx;
+		text-align: center;
+	}
+
+	.condition {
+		position: absolute;
+		top: 770rpx;
 		display: flex;
 		flex-wrap: wrap;
 		width: 90%;
@@ -343,9 +394,11 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
+
 				.th {
 					height: 100rpx;
 				}
+
 				.th:first-child,
 				.td:first-child {
 					width: 300rpx;
@@ -356,6 +409,7 @@
 		.pagenumber {
 			display: flex;
 			margin: 20rpx auto;
+
 			button {
 				width: 150rpx;
 				height: 50rpx;

+ 2 - 0
pages/cb/cbd/equip-set/equip-set.vue

@@ -440,6 +440,8 @@
 			},
 			async submit(){
 				console.log(this.equipContrlForm)
+				this.equipContrlForm.st =  String(this.equipContrlForm.st)
+				this.equipContrlForm.et =  String(this.equipContrlForm.et)
 				let res=await this.$myRequest({
 					url:'/api/api_gateway?method=forecast.send_control.device_control',
 					data:{

+ 77 - 23
pages/cb/cbd/equip-set/historyfile.vue

@@ -18,6 +18,9 @@
 				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
 				 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
+			<view class="refresh" @click="refresh">
+				刷 新
+			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
 					<table class="table">
@@ -62,8 +65,6 @@
 <script>
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
 	var canvaColumnA = null;
-	var newtime = +new Date()
-	var strrttime = newtime - 24 * 60 * 60 * 1000
 	export default {
 		data() {
 			return {
@@ -72,21 +73,23 @@
 					height: "400rpx"
 				},
 				d_id: '',
-				start_time: strrttime,
-				end_time: newtime,
+				start_time: "",
+				end_time: "",
 				historydatas: [],
 				titletext: ["24小时", "近一个月", "近半年", "近一年"],
 				titleidnex: 0,
 				device_id: '',
 				page: 1,
 				historylistdata: [],
-				thdata: ["上报时间","环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态","光控状态","灯管状态","信号强度", "电流(mA)", "电压(V)", "经度", "纬度"],
+				thdata: ["上报时间", "环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态", "光控状态", "灯管状态", "信号强度", "电流(mA)", "电压(V)",
+					"经度", "纬度"
+				],
 				forbidden: false,
 				cWidth: '400',
 				cHeight: '400',
 				pixelRatio: 1,
-				canvastishiTF:false,
-				pagesum:null
+				canvastishiTF: false,
+				pagesum: null
 			}
 		},
 		methods: {
@@ -114,9 +117,9 @@
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
 						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
-						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
-						arr3.unshift(res[i].others==""?"0":res[i].others)
+						arr1.unshift(res[i].temperature == "" ? "0" : res[i].temperature)
+						arr2.unshift(res[i].humidity == "" ? "0" : res[i].humidity)
+						arr3.unshift(res[i].others == "" ? "0" : res[i].others)
 					}
 					// console.log(arr1)
 					var obj = [{
@@ -148,7 +151,7 @@
 					}
 				})
 				this.historylistdata = res.data
-				this.pagesum =Math.ceil(res.counts/10)+1
+				this.pagesum = Math.ceil(res.counts / 10) + 1
 				if (res.data.length == 0) {
 					this.forbidden = true
 					console.log(res.data.length)
@@ -156,19 +159,49 @@
 					this.forbidden = false
 					console.log(res.data.length)
 				}
-				for(var i=0;i<this.historylistdata.length;i++){
-					if(Number(this.historylistdata[i].d_h_t.ws) == 0){
-						this.historylistdata[i].d_h_t.dg = "待机" 
-					}else if(Number(this.historylistdata[i].d_h_t.ws) == 1){
-						if(Number(this.historylistdata[i].d_h_t.lamp) == 0){
-							this.historylistdata[i].d_h_t.dg  = "工作" 
-						}else if(Number(this.historylistdata[i].d_h_t.lamp) == 1){
-							this.historylistdata[i].d_h_t.dg  = "异常" 
+				for (var i = 0; i < this.historylistdata.length; i++) {
+					if (Number(this.historylistdata[i].d_h_t.ws) == 0) {
+						this.historylistdata[i].d_h_t.dg = "待机"
+					} else if (Number(this.historylistdata[i].d_h_t.ws) == 1) {
+						if (Number(this.historylistdata[i].d_h_t.lamp) == 0) {
+							this.historylistdata[i].d_h_t.dg = "工作"
+						} else if (Number(this.historylistdata[i].d_h_t.lamp) == 1) {
+							this.historylistdata[i].d_h_t.dg = "异常"
 						}
 					}
 				}
 				console.log(this.historylistdata)
 			},
+			// forecast.send_control.get_device_config 获取当前时间的数据
+			async newdata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.get_device_config',
+					data: {
+						device_type_id: 3,
+						d_id: this.d_id,
+						control_type: "data"
+					}
+				})
+				if(res){
+					uni.showToast({
+						title: '刷新成功',
+						duration: 2000,
+						icon: "none"
+					});
+					uni.navigateBack({
+						delta: 1
+					})
+				}else{
+					uni.showToast({
+						title: '刷新失败',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			refresh() { //获取当前时间的数据
+				this.newdata()
+			},
 			changeindex(index) {
 				this.titleidnex = index
 				var now = new Date()
@@ -267,8 +300,14 @@
 			this.device_id = option.device_id
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
-			this.history()
-			this.historylist()
+		},
+		onShow(){
+			this.end_time = +new  Date() + 1000
+			this.start_time = this.end_time - 24 * 60 * 60 * 1000
+			setTimeout(()=>{
+				this.history()
+				this.historylist()
+			},1000)
 		}
 	}
 </script>
@@ -283,7 +322,8 @@
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding-top: 20rpx;
 		height: 550rpx;
-		.canvastishi{
+
+		.canvastishi {
 			font-size: 32rpx;
 			position: absolute;
 			top: 50%;
@@ -291,6 +331,7 @@
 			margin-left: -64rpx;
 			margin-top: -21rpx;
 		}
+
 		.shuju_one_title {
 			width: 70%;
 			margin: 0 auto;
@@ -318,9 +359,21 @@
 		}
 	}
 
-	.condition {
+	.refresh {
 		position: absolute;
 		top: 700rpx;
+		left: 5%;
+		width: 160rpx;
+		height: 50rpx;
+		background-color: #28AE4F;
+		color: #FFFFFF;
+		line-height: 50rpx;
+		text-align: center;
+	}
+
+	.condition {
+		position: absolute;
+		top: 770rpx;
 		display: flex;
 		flex-wrap: wrap;
 		width: 90%;
@@ -346,6 +399,7 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
+
 				.th:first-child,
 				.td:first-child {
 					width: 300rpx;

+ 10 - 3
pages/cb/cbd/equip-set/imgpage.vue

@@ -6,7 +6,7 @@
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片" rightIcon="camera" @clickRight="clickRight"></uni-nav-bar>
 			</view>
 			<p class="tishi" v-if="tishi">暂无数据</p>
-			<view class="timeshow" v-else>
+			<view class="timeshow">
 				<view class="timeshow_tate" @click="selecttimestate">
 					{{timestate|timeFormat()}}
 				</view>
@@ -139,6 +139,9 @@
 						duration: 2000
 					});
 				}
+				uni.navigateBack({
+					delta:1
+				})
 			},
 			clickLeft() {
 				uni.navigateBack({
@@ -216,7 +219,11 @@
 			console.log(option)
 			this.device_id = option.device_id
 			this.d_id = option.d_id
-			this.imglistdata('','')
+		},
+		onShow(){
+			setTimeout(()=>{
+				this.imglistdata('','')
+			},1000)
 			this.timeend = +new Date() / 1000
 			this.timestate = this.timeend - 60 * 60 * 24
 		},
@@ -241,7 +248,7 @@
 <style lang="scss">
 	.tishi {
 		position: absolute;
-		top: 84px;
+		top: 104px;
 		width: 95%;
 		left: 2.5%;
 		text-align: center;

+ 3 - 3
pages/cb/equip-detail/equip-detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view :class="['info',equipInfo.device_status==1?'on':'off']">
+		<view :class="['info',equipInfo.is_online==1?'on':'off']">
 			<view class="">
 				设备ID:{{equipInfo.imei}}
 			</view>
@@ -295,11 +295,11 @@
 							}, {
 								icon: '/static/image/cb/icon09.png',
 								txt: '保温仓当前温度',
-								value: this.newState.dver
+								value: this.newState.pre_temp
 							}, {
 								icon: '/static/image/cb/icon08.png',
 								txt: '保温仓设定温度',
-								value: this.newState.dver
+								value: this.newState.set_temp
 							}, {
 								icon: '/static/image/prevention/107.png',
 								txt: '经度',

+ 112 - 105
pages/cb/index/index.vue

@@ -3,24 +3,21 @@
 		<view class="status_bar"></view>
 		<view class="" style="position: relative;top: 44px;">
 			<view style="position: fixed;z-index: 100;">
-				<uni-nav-bar @clickRight="clickRight" @clickLeft="clickLeft" left-icon="back" left-text="返回"  right-icon="search" title="测报灯系统"></uni-nav-bar>
+				<uni-nav-bar @clickRight="clickRight" @clickLeft="clickLeft" left-icon="back" left-text="返回" right-icon="search"
+				 title="测报灯系统"></uni-nav-bar>
 				<view>
 					<image src="../../../static/image/cb/banner.jpg" mode="widthFix"></image>
 				</view>
 				<view class="tab-box">
-					<view 
-					v-for="(item,index) in equipArr" 
-					:key="item.type" 
-					@click="tabClick(index)" 
-					:class="['tab-item',active==index?'active':'']">
-					<text>{{item.name}}</text>
-					<text class="bottom-line"></text>
+					<view v-for="(item,index) in equipArr" :key="item.type" @click="tabClick(index)" :class="['tab-item',active==index?'active':'']">
+						<text>{{item.name}}</text>
+						<text class="bottom-line"></text>
 					</view>
 				</view>
 			</view>
 			<view class="" style="position: absolute;top: 180px;width: 100%;">
 				<view class="content">
-					<template v-for="(item,index) in equipArr[active].list" >
+					<template v-for="(item,index) in equipArr[active].list">
 						<equipItem @click.native="itemClick(item)" v-bind:item="item" :key="index">
 							<view class="date">
 								最新上报时间:{{item.addtime|timeFormat}}
@@ -37,57 +34,57 @@
 </template>
 
 <script>
-	import equipItem from "../../../components/equip-item/equip-item" 
+	import equipItem from "../../../components/equip-item/equip-item"
 	import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue"
 	export default {
 		data() {
 			return {
-				active:0,//默认选中虫情测报
-				equipArr:[{
-					name:'虫情测报',
-					type:3, //3虫情测报灯 7孢子仪 4智能性诱
-					list:[],
-					pageIndex:1,
-				},{
-					name:'孢子仪',
-					type:7, //3虫情测报灯 7孢子仪 4智能性诱
-					list:[],
-					pageIndex:1,
-				},{
-					name:'性诱测报',
-					type:4, //3虫情测报灯 7孢子仪 4智能性诱
-					list:[],
-					pageIndex:1,
+				active: 0, //默认选中虫情测报
+				equipArr: [{
+					name: '虫情测报',
+					type: 3, //3虫情测报灯 7孢子仪 4智能性诱
+					list: [],
+					pageIndex: 1,
+				}, {
+					name: '孢子仪',
+					type: 7, //3虫情测报灯 7孢子仪 4智能性诱
+					list: [],
+					pageIndex: 1,
+				}, {
+					name: '性诱测报',
+					type: 4, //3虫情测报灯 7孢子仪 4智能性诱
+					list: [],
+					pageIndex: 1,
 				}],
-				device_id:'',//筛选的设备id
-				isTop:false
+				device_id: '3', //筛选的设备id
+				isTop: false
 			}
 		},
-		onLoad(){
+		onLoad() {
 			this.getEquipList(0)
 			this.getEquipList(1)
 			this.getEquipList(2)
 		},
-		onShow(){
-			
+		onShow() {
+
 		},
-		onHide(){
-			
+		onHide() {
+
 		},
-		onUnload(){
-			
+		onUnload() {
+
 		},
-		onPullDownRefresh(){
-			this.equipArr[this.active].pageIndex=1
-			this.equipArr[this.active].list=[]
+		onPullDownRefresh() {
+			this.equipArr[this.active].pageIndex = 1
+			this.equipArr[this.active].list = []
 			this.getEquipList(this.active)
-			setTimeout(()=>{
+			setTimeout(() => {
 				uni.stopPullDownRefresh()
-			},1000)
+			}, 1000)
 		},
-		onReachBottom(){
-			let act=this.active
-			if(this.equipArr[act].list.length<this.equipArr[act].pageIndex*10){ //判断是否数据请求完
+		onReachBottom() {
+			let act = this.active
+			if (this.equipArr[act].list.length < this.equipArr[act].pageIndex * 10) { //判断是否数据请求完
 				return false
 			}
 			this.equipArr[act].pageIndex++;
@@ -100,48 +97,46 @@
 				this.isTop = false
 			}
 		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
 		methods: {
-			async getEquipList(act){
-			 const res=await this.$myRequest({
-					url:'/api/api_gateway?method=forecast.worm_lamp.lamp_list',
-					data:{
-						device_type_id:this.equipArr[act].type,
-						page:this.equipArr[act].pageIndex,
-						page_size:10,
+			async getEquipList(act) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: this.equipArr[act].type,
+						page: this.equipArr[act].pageIndex,
+						page_size: 10,
 					}
 				})
 				console.log(res)
-				this.equipArr[act].list=[...this.equipArr[act].list,...res.data]
+				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
 				console.log(this.equipArr[act].list)
 			},
-			async searchEquip(){
-				const res=await this.$myRequest({
-					url:'/api/api_gateway?method=forecast.worm_lamp.lamp_list',
-					data:{
-						device_type_id:this.equipArr[this.active].type,
-						device_id:this.device_id,
-					}
-				})
-				this.equipArr[this.active].list=res.data
-			},
-			tabClick(index){
-				this.active=index;
+			tabClick(index) {
+				this.active = index;
+				this.device_id = this.equipArr[index].type
 			},
-			clickRight(){
+			clickRight() {
 				uni.navigateTo({
-				    url: '/pages/search/search?device_type_id='+this.equipArr[this.active].type
-					})
+					url: "./search?device_id="+this.device_id
+				})
 			},
-			itemClick(item){
-				item.type=this.equipArr[this.active].type
-				let data=JSON.stringify(item)
+			itemClick(item) {
+				item.type = this.equipArr[this.active].type
+				let data = JSON.stringify(item)
 				uni.navigateTo({
-				    url: '/pages/cb/equip-detail/equip-detail?info='+data
+					url: '/pages/cb/equip-detail/equip-detail?info=' + data
 				});
 			},
-			clickLeft(){
+			clickLeft() {
 				uni.switchTab({
-					url:"../../index/index"
+					url: "../../index/index"
 				})
 			},
 			top() {
@@ -151,7 +146,7 @@
 				})
 			}
 		},
-		components:{
+		components: {
 			equipItem,
 			uniNavBar
 		}
@@ -159,44 +154,56 @@
 </script>
 
 <style lang="scss">
-page {
-	background:$uni-bg-color-grey;
-	.content{padding:0 20rpx 20rpx 20rpx;box-sizing: border-box;}
-}
-image{
-	width:100%;
-}
-.tab-box{
-	display:flex;
-	justify-content: space-around;
-	font-size:30rpx;
-	line-height:80rpx;
-	background-color: #FFFFFF;
-	margin-top: -10rpx;
-	.tab-item{
-		cursor:pointer;
-		position:relative;
-	};
-	.tab-item.active{
-		.bottom-line{
-			bottom:0;
-			position:absolute;
-			display: inline-block;
-			width:90rpx;
-			height:6rpx;
-			left:0;
-			right:0;
-			margin:auto;
-			background:$uni-color-success;
+	page {
+		background: $uni-bg-color-grey;
+
+		.content {
+			padding: 0 20rpx 20rpx 20rpx;
+			box-sizing: border-box;
+		}
+	}
+
+	image {
+		width: 100%;
+	}
+
+	.tab-box {
+		display: flex;
+		justify-content: space-around;
+		font-size: 30rpx;
+		line-height: 80rpx;
+		background-color: #FFFFFF;
+		margin-top: -10rpx;
+
+		.tab-item {
+			cursor: pointer;
+			position: relative;
+		}
+
+		;
+
+		.tab-item.active {
+			.bottom-line {
+				bottom: 0;
+				position: absolute;
+				display: inline-block;
+				width: 90rpx;
+				height: 6rpx;
+				left: 0;
+				right: 0;
+				margin: auto;
+				background: $uni-color-success;
+			}
 		}
 	}
-}
-.top {
+
+	.top {
 		position: fixed;
 		right: 30px;
 		bottom: 100px;
 		z-index: 100;
-		image{
+
+		image {
 			width: 100rpx;
 			height: 100rpx;
 		}

+ 216 - 0
pages/cb/index/search.vue

@@ -0,0 +1,216 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;top: 44px;">
+			<view style="position: fixed;z-index: 100;padding-top: 20rpx;background-color: #FFFFFF;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"></uni-nav-bar>
+				<view class="search_top_input">
+					<input type="text" value="" placeholder="请输入设备ID" v-model="imports" @input="searchinp" />
+					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
+				</view>
+			</view>
+			<view class="nonetishi" v-if="none">
+				暂无此设备
+			</view>
+			<view class="prevents" v-else>
+				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
+					<image :src="item.is_online==1?'../../../static/image/prevention/6.png':'../../../static/image/prevention/7.png'" mode=""
+					 class="prevents_item_img"></image>
+					<view class="prevents_item_top">
+						<p>设备 ID:{{item.imei}}</p>
+						<p :class="item.is_online==1?'green':'red'" v-text="item.is_online==1?'在线':'离线'"></p>
+					</view>
+					<view class="prevents_item_bot">
+						最新上报时间:{{item.addtime|timeFormat()}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image src="../../../static/image/6209a98f0cb3b5086f2ca36152c9269.png" mode=""></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		Debounce,
+		Throttle
+	} from "../../../util/anitthro.js"
+	export default {
+		data() {
+			return {
+				imports:"",
+				device_id:'',
+				page:1,
+				eqlistdata:[],
+				isTop:false,
+				none:false
+			}
+		},
+		methods: {
+			async searchEquip() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: this.device_id,
+						device_id: this.imports,
+						page:this.page
+					}
+				})
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				console.log(res)
+				if(this.eqlistdata.length==0){
+					this.none = true
+				}else{
+					this.none = false
+				}
+			},
+			searchinp(){
+				Debounce(() => {
+					this.eqlistdata = []
+					this.page = 1
+					this.searchEquip()
+				}, 1000)()
+			},
+			search(){
+				this.eqlistdata = []
+				this.page = 1
+				this.searchEquip()
+			},
+			clickLeft(){
+				uni.navigateTo({
+					url:"./index"
+				})
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
+			eqdetails(item){
+				item.type = Number(this.device_id)
+				console.log(item)
+				let data = JSON.stringify(item)
+				uni.navigateTo({
+					url: '/pages/cb/equip-detail/equip-detail?info=' + data
+				});
+			}
+		},
+		onLoad(option){
+			this.device_id = option.device_id
+			console.log(this.device_id)
+		},
+		onReachBottom() {
+			this.page++
+			console.log(1)
+			this.searchEquip()
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.search_top_input {
+		width: 80%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		position: absolute;
+		top: 33rpx;
+		right: 18rpx;
+		padding-top: 8rpx;
+		box-sizing: border-box;
+	
+		input {
+			width: 85%;
+			text-indent: 1rem;
+			font-size: 26rpx;
+		}
+	
+		.icon {
+			position: absolute;
+			top: 8rpx;
+			right: 26rpx;
+		}
+	}
+	.nonetishi{
+		width: 100%;
+		position: absolute;
+		top: 60px;
+		height: 200rpx;
+		text-align: center;
+		line-height: 200rpx;
+		font-size: 22px;
+	}
+	.prevents {
+		width: 100%;
+		position: absolute;
+		top: 60px;
+		.prevents_item {
+			width: 95%;
+			margin: 0 auto 30rpx;
+			border-radius: 10rpx;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx 40rpx 20rpx 80rpx;
+			box-sizing: border-box;
+			position: relative;
+	
+			.prevents_item_img {
+				width: 30rpx;
+				height: 50rpx;
+				position: absolute;
+				top: -4rpx;
+				left: 30rpx;
+			}
+	
+			.prevents_item_top {
+				display: flex;
+				justify-content: space-between;
+				height: 60rpx;
+				border-bottom: 2rpx solid #F4F4F4;
+				line-height: 60rpx;
+				font-size: 26rpx;
+	
+				.red {
+					color: #ff0000;
+				}
+	
+				.green {
+					color: #7DBB91;
+				}
+			}
+	
+			.prevents_item_bot {
+				margin-top: 20rpx;
+				font-size: 26rpx;
+				color: #BDBDBD;
+			}
+		}
+	}
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+		image{
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>
+

+ 55 - 12
pages/cb/xy/equip-set/xyhistoryile.vue

@@ -31,6 +31,9 @@
 					</view>
 				</view>
 			</view>
+			<view class="refresh" @click="refresh">
+				刷 新
+			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
 					<!-- @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" -->
@@ -72,14 +75,9 @@
 		</view>
 	</view>
 </template>
-<style lang="scss">
-
-</style>
 <script>
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
 	var canvaColumnA = null;
-	var newtime = +new Date()
-	var strrttime = newtime - 24 * 60 * 60 * 1000
 	export default {
 		data() {
 			return {
@@ -88,8 +86,8 @@
 				pixelRatio: 1,
 				canvastishiTF: false,
 				d_id: '',
-				start_time: strrttime,
-				end_time: newtime,
+				start_time: "",
+				end_time: "",
 				historydatas: [],
 				titletext: ["24小时", "近一个月", "近半年", "近一年"],
 				titleidnex: 0,
@@ -207,7 +205,7 @@
 				var now = new Date()
 				this.$forceUpdate()
 				if (index == 0) {
-					this.start_time = strrttime
+					this.start_time = this.end_time - 24 * 60 * 60 * 1000
 					this.history()
 					this.historylist()
 				} else if (index == 1) {
@@ -294,14 +292,49 @@
 					}
 				});
 			},
+			async newdata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.get_device_config',
+					data: {
+						device_type_id: 4,
+						d_id: this.d_id,
+						control_type: "data"
+					}
+				})
+				if(res){
+					uni.showToast({
+						title: '刷新成功',
+						duration: 2000,
+						icon: "none"
+					});
+					uni.navigateBack({
+						delta: 1
+					})
+				}else{
+					uni.showToast({
+						title: '刷新失败',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			refresh() { //获取当前时间的数据
+				this.newdata()
+			},
 		},
 		onLoad(option) {
 			this.d_id = option.d_id
 			this.device_id = option.device_id
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
-			this.history()
-			this.historylist()
+		},
+		onShow() {
+			this.end_time = +new Date() + 1000
+			this.start_time = this.end_time - 24 * 60 * 60 * 1000
+			setTimeout(()=>{
+				this.history()
+				this.historylist()
+			},1000)
 		}
 	}
 </script>
@@ -384,10 +417,20 @@
 			}
 		}
 	}
-
-	.condition {
+	.refresh{
 		position: absolute;
 		top: 1000rpx;
+		left: 5%;
+		width: 160rpx;
+		height: 50rpx;
+		background-color: #28AE4F;
+		color: #FFFFFF;
+		line-height: 50rpx;
+		text-align: center;
+	}
+	.condition {
+		position: absolute;
+		top: 1070rpx;
 		display: flex;
 		flex-wrap: wrap;
 		width: 90%;

+ 59 - 61
pages/disandpests/index.vue

@@ -6,14 +6,14 @@
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="病虫害识别"></uni-nav-bar>
 			</view>
 			<view class="image_box">
-				<image :src="path" mode="" class="image"></image>
+				<image :src="path" mode="" class="image" @click="examine(path)"></image>
 			</view>
 			<view class="recognition" v-if="datasTF">
 				<p class="recognition_title">{{name}}</p>
 				<view :class="tishi?'recognition_img':'recognition_img_two'">
-					<image :src="path2" mode="" @error="error"></image>
+					<image :src="path2" mode="" @error="error" @click="examine(path2)"></image>
 				</view>
-				<button class="recognition_details" v-if="tishi" @click="examine">查看详情</button>
+				<button class="recognition_details" v-if="tishi" @click="examines">查看详情</button>
 				<button class="recognition_details" v-if="!tishi" @click="show=!show">再拍一张</button>
 			</view>
 			<view class="datas" v-else>
@@ -25,11 +25,14 @@
 					</view>
 					<p class="prevention_con">{{item}}</p>
 				</view>
-				<button class="recognition_details" v-if="tishi" @click="examine">查看图片</button>
+				<button class="recognition_details" v-if="tishi" @click="examines">查看图片</button>
 			</view>
 			<u-modal v-model="show" :mask-close-able="true" title="" :show-cancel-button="true" confirm-text="拍病害" cancel-text="拍虫害"
 			 content="拍照识别病虫害" @confirm="confirm" @cancel="cancel"></u-modal>
-			<kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
+		</view>
+		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="imgdata" :fixed="false" :blob="true"></kps-image-cutter>
+		<view class="loading" v-if="loadTF">
+			<u-loading  mode="flower" size="100" :show="true" ></u-loading>
 		</view>
 	</view>
 </template>
@@ -49,86 +52,50 @@
 				prevention: "",
 				datasTF: true,
 				show: false,
-				url: "",
+				imgdata: "",
 				preventionArr: [],
-				regexptitle: []
+				regexptitle: [],
+				loadTF:false
 			}
 		},
 		methods: {
-			// pest.pests.insect_discern 虫害
-			async worm(data) {
-				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=pest.pests.insect_discern',
-					data: {
-						img_file: data
-					}
-				})
-				// this.res = res.data
-				console.log(res)
-				if (res.data.img_urls == undefined) {
-					this.name = "识别失败,请换张图片"
-					this.tishi = false
-					this.path2 = "../../static/image/10ca93e17420371a82826073c8425c0.png"
-				} else {
-					this.path2 = res.data.img_urls
-					this.name = res.data.name
-					this.tishi = true
-					this.prevention = res.data.prevention
-				}
-			},
-			//pest.pests.insect_discern病害识别
-			async disease(data) {
-				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=pest.pests.plant_discern',
-					data: {
-						img_file: data
-					}
-				})
-				console.log(res)
-				// this.res = res.data
-				if (res.data.img_urls == undefined) {
-					this.name = "识别失败,请换张图片"
-					this.tishi = false
-					this.path2 = "../../static/image/10ca93e17420371a82826073c8425c0.png"
-				} else {
-					this.path2 = res.data.img_urls
-					this.name = res.data.name
-					this.tishi = true
-					this.prevention = res.data.prevention
-				}
-			},
 			clickLeft() {
 				uni.switchTab({
 					url: "../index/index"
 				})
 			},
-			examine() {
+			examines() {
 				this.datasTF = !this.datasTF
 			},
 			confirm() {
 				this.flag = 1
+				var that = this
+				// console.log(1)
 				uni.chooseImage({
 					count: 1, //默认9
 					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['camera', 'album'], //从相册选择
 					success: (res) => {
-						this.url = res.tempFilePaths[0]
-					}
+						that.imgdata = res.tempFilePaths[0]
+						that.path = res.tempFilePaths[0]
+					},
 				});
 			},
 			cancel() {
+				var that = this
 				this.flag = 2
 				uni.chooseImage({
 					count: 1, //默认9
 					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 					sourceType: ['camera', 'album'], //从相册选择
 					success: (res) => {
-						console.log(1)
-						this.url = res.tempFilePaths[0]
+						that.imgdata = res.tempFilePaths[0]
+						that.path = res.tempFilePaths[0]
 					}
 				});
 			},
 			onok(ev) {
+				this.loadTF = !this.loadTF
 				if (this.flag == 2) {
 					// pest.pests.insect_discern 虫害
 					uni.uploadFile({
@@ -141,6 +108,7 @@
 						},
 						success: (uploadFileRes) => {
 							console.log(JSON.parse(uploadFileRes.data))
+							this.loadTF = !this.loadTF
 							this.optionverify(JSON.parse(uploadFileRes.data).data)
 						}
 					});
@@ -156,26 +124,32 @@
 						},
 						success: (uploadFileRes) => {
 							console.log(JSON.parse(uploadFileRes.data))
+							this.loadTF = !this.loadTF
 							this.optionverify(JSON.parse(uploadFileRes.data).data)
 						}
 					});
 				}
-				this.url = "";
+				this.imgdata = "";
 			},
 			oncancle() {
 				// url设置为空,隐藏控件
-				this.url = ''
+				this.imgdata = ''
 			},
 			error() {
 				this.path2 = "../../static/image/e1cd85dc59139760f43ddbac15136f2.png"
 			},
 			optionverify(data) {
+				console.log(data)
 				if (data == null) {
 					this.name = "识别失败,请换张图片"
 					this.tishi = false
 					this.path2 = "../../static/image/10ca93e17420371a82826073c8425c0.png"
 				} else {
-					this.path2 = data.img_urls
+					if(data.img_urls==""){
+						this.path2 = "../../static/image/e1cd85dc59139760f43ddbac15136f2.png"
+					}else{
+						this.path2 = data.img_urls
+					}
 					this.name = data.name
 					this.tishi = true
 					this.prevention = data.prevention
@@ -187,14 +161,27 @@
 						arrindex.push(str.indexOf(arr[i]))
 					}
 					for (var i = 0; i < arr.length; i++) {
-						this.preventionArr.push(str.slice(arrindex[i] + arr[i].length, arrindex[i + 1]))
+						if(str.slice(arrindex[i] + arr[i].length, arrindex[i + 1]) == " null" || str.slice(arrindex[i] + arr[i].length, arrindex[i + 1])== "" ||str.slice(arrindex[i] + arr[i].length, arrindex[i + 1]) == "null"){
+							this.preventionArr.push("暂无信息")
+						}else{
+							this.preventionArr.push(str.slice(arrindex[i] + arr[i].length, arrindex[i + 1]))
+						}
 					}
+					
 					for (var i = 0; i < arr.length; i++) {
 						arr[i] = arr[i].slice(1, arr[i].length - 1)
 					}
 					this.regexptitle = arr
 				}
-			}
+			},
+			examine(url) {
+				var imgarr =[]
+				imgarr.push(url)
+				console.log(imgarr)
+				uni.previewImage({
+					urls: imgarr
+				});
+			},
 		},
 		onLoad(option) {
 			console.log(option)
@@ -205,6 +192,18 @@
 </script>
 
 <style lang="scss">
+	.loading{
+		position: absolute;
+		top: 0;
+		left: 0;
+		z-index: 100;
+		width:100%;
+		height: 100vh;
+		background-color: rgba(0,0,0,0.5);
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
 	.image_box {
 		position: absolute;
 		top: 44px;
@@ -258,10 +257,9 @@
 			image {
 				margin-top: 10rpx;
 				width: 340rpx;
-				height: 340rpx;
+				height: 340rpx; 
 			}
 		}
-
 		.recognition_details {
 			width: 400rpx;
 			height: 80rpx;

+ 19 - 8
pages/distribution/index.vue

@@ -26,9 +26,9 @@
 						</view>
 					</view>
 				</view>
-				<view class="distri_ser" v-if="serTF">
+				<view class="distri_ser" v-if="serTF" :style="disstyle">
 					<view class="distri_ser_input">
-						<input type="number" v-model="device_id" placeholder="请输入设备ID" @confirm="doSearch" />
+						<input type="number" v-model="device_id" placeholder="请输入设备ID" @confirm="doSearch" :adjust-position="false" @focus="focus" auto-blur @blur="disblur"/>
 						<u-icon name="search" size="38rpx" @click="search"></u-icon>
 					</view>
 					<p class="distri_ser_title">请选择设备类型(点击选择)</p>
@@ -73,7 +73,7 @@
 				}, {
 					name: "监控设备"
 				}, {
-					name: "孢子仪"
+					name: "孢子仪",
 				}],
 				current: 0,
 				icon: [{
@@ -90,7 +90,7 @@
 					},
 					{
 						id: 4, //性诱测报
-						url: "../../static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png"
+						url: "../../static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png"
 					},
 					{
 						id: 5, //环境检测
@@ -118,6 +118,10 @@
 					height: "85%",
 				},
 				listindex:1,//以选择设备名称
+				disstyle:{
+					position:"absolute",
+					bottom:"0rpx"
+				}
 			}
 		},
 		onLoad() {
@@ -175,7 +179,6 @@
 				this.search()
 			},
 			search() { //点击搜索
-				// this.history()
 				if (this.type == '') {
 					uni.showToast({
 						title: '请选择设备类型',
@@ -185,6 +188,7 @@
 				} else {
 					this.history()
 					this.serTF = !this.serTF
+					this.style.height = "85%"
 				}
 			},
 			serTFs() {
@@ -198,6 +202,14 @@
 			btnT() { //确定
 				this.search()
 			},
+			focus(e){
+				this.disstyle.bottom = e.detail.height-170+"rpx"
+				this.style.height = "55%"
+			},
+			disblur(){
+				this.disstyle.bottom = 0
+				this.style.height = "65%"
+			},
 			eqinfo() { //设备信息
 				if (this.punctuation_id == '') {
 					uni.showToast({
@@ -297,12 +309,11 @@
 
 	.distri_ser {
 		position: absolute;
-		bottom: 17rpx;
+		bottom: 0rpx;
 		right: 0px;
 		width: 100%;
-		height: 400rpx;
+		height: 440rpx;
 		background-color: #FFFFFF;
-
 		.distri_ser_input {
 			width: 90%;
 			margin: 20rpx auto;

+ 3 - 1
pages/equipMange/index/addusers.vue

@@ -186,7 +186,9 @@
 					let obj = {}
 					obj.text = res.data[i].role_describe
 					obj.role_id = res.data[i].id
-					this.theme.push(obj)
+					if(obj.text != ''){
+						this.theme.push(obj)
+					}
 				}
 			},
 			async getaddusers() {

+ 7 - 6
pages/equipMange/index/useroperation.vue

@@ -24,7 +24,7 @@
 					<view class="uFormbg">
 						<u-form-item label="主题" left-icon="calendar" :left-icon-style="lefticonstyle" label-width="160rpx" :border-bottom="borderbottom"
 						 prop="passwold">
-							<u-input v-model="theme_items" :clearable="clearable" input-align="right" :disabled="alterTF" :class="{'uuinput':alterTF==false}"
+							<u-input v-model="theme_items" :clearable="clearable" input-align="right" :disabled="true" :class="{'uuinput':alterTF==false}"
 							 type="selete" @click="theme_show = !alterTF" />
 							<u-action-sheet :list="theme" v-model="theme_show" @click="themes" scroll-y="true"></u-action-sheet>
 						</u-form-item>
@@ -37,7 +37,7 @@
 					<view class="uFormbg">
 						<u-form-item label="用户角色" left-icon="account-fill" :left-icon-style="lefticonstyle" label-width="160rpx"
 						 :border-bottom="borderbottom">
-							<u-input v-model="user_meg.role_name" :clearable="clearable" input-align="right" placeholder="请选择主题" :disabled="alterTF"
+							<u-input v-model="user_meg.role_name" :clearable="clearable" input-align="right" placeholder="请选择主题" :disabled="true"
 							 :class="{'uuinput':alterTF==false}" @click="users_type_show = !alterTF" />
 						</u-form-item>
 					</view>
@@ -70,7 +70,7 @@
 					<button type="default" @click="modification" :disabled="tijiaotf">确定</button>
 				</view>
 			</view>
-			<u-popup v-model="users_type_show" mode="bottom" length="40%" class="pop-up">
+			<u-popup v-model="users_type_show" mode="bottom" length="30%" class="pop-up">
 				<scroll-view scroll-y="true" class="sheet">
 					<view class="sheet-text" v-for="(item,index) in roles" :key="index">
 						<p @click="typesofroles(index)">{{item.text}}</p>
@@ -150,10 +150,13 @@
 					let obj = {}
 					obj.text = res.data[i].role_describe
 					obj.id = res.data[i].id
-					this.theme.push(obj)
+					if(obj.text != ''){
+						this.theme.push(obj)
+					}
 					if (this.user_meg.user_group_id == res.data[i].id) { //根据主题id更改主题
 						this.theme_items = res.data[i].role_describe
 					}
+					console.log(this.theme)
 				}
 			},
 			async getThemes() { //获取用户角色
@@ -359,10 +362,8 @@
 			background-color: white;
 			height: 400rpx;
 			overflow: hidden;
-
 			.sheet-text {
 				height: 80rpx;
-
 				p {
 					text-align: center;
 					height: 80rpx;

+ 1 - 0
pages/login/login.vue

@@ -66,6 +66,7 @@
 			uni.getStorage({
 				key: 'session_key',
 				success: (res) => {
+					console.log(res)
 					if(res.data!=""){
 						uni.switchTab({
 							url: "../index/index"

+ 3 - 3
pages/my/index/index.vue

@@ -90,12 +90,12 @@
 					success: (res) => {
 						if (res.confirm) {
 							this.getlogout()
-							uni.navigateTo({
-								url: "../../login/login"
-							})
 							uni.removeStorage({
 								key:"session_key"
 							})
+							uni.navigateTo({
+								url: "../../login/login"
+							})
 						} else if (res.cancel) {
 							console.log('用户点击取消');
 						}

+ 48 - 40
pages/prevention/sim.vue

@@ -1,21 +1,24 @@
 <template>
 	<view>
-		<view style="position: fixed;z-index: 100;width: 100%;">
-			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="sim卡详情"></uni-nav-bar>
-		</view>
-		<view class="sim_info">
-			<view class="sim_info_title">
-				<image src="../../static/image/cb/sim1.png" mode=""></image>
-				<p>sim卡查询</p>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;top: 44px;">
+			<view style="position: fixed;z-index: 100;width: 100%;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="sim卡详情"></uni-nav-bar>
 			</view>
-			<view class="sim_info_text">
-				<p>运营商:{{siminfo.data.carrier}}</p>
-				<p>ICCID:{{iccid}}</p>
-				<p>状态:{{state[siminfo.data.account_status]}}</p>
-				<p>套餐:{{siminfo.data.data_plan}}MB</p>
-				<p>已用流量:{{siminfo.data.data_usage}}MB</p>
-				<p>剩余流量:{{siminfo.data.data_balance}}MB</p>
-				<p>到期时间:{{siminfo.data.outbound_date|timeFormat()}}</p>
+			<view class="sim_info">
+				<view class="sim_info_title">
+					<image src="../../static/image/cb/sim1.png" mode=""></image>
+					<p>sim卡查询</p>
+				</view>
+				<view class="sim_info_text">
+					<p>运营商:{{siminfo.data.carrier}}</p>
+					<p>ICCID:{{iccid}}</p>
+					<p>状态:{{state[siminfo.data.account_status]}}</p>
+					<p>套餐:{{siminfo.data.data_plan}}MB</p>
+					<p>已用流量:{{siminfo.data.data_usage}}MB</p>
+					<p>剩余流量:{{siminfo.data.data_balance}}MB</p>
+					<p>到期时间:{{siminfo.data.outbound_date|timeFormat()}}</p>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -25,19 +28,19 @@
 	export default {
 		data() {
 			return {
-				iccid:'',
-				siminfo:{
-					data:{
-						carrier:"--",
-						account_status:"--",
-						data_plan:"--",
-						data_usage:"--",
-						data_balance:"--",
-						outbound_date:+new Date()/1000
+				iccid: '',
+				siminfo: {
+					data: {
+						carrier: "--",
+						account_status: "--",
+						data_plan: "--",
+						data_usage: "--",
+						data_balance: "--",
+						outbound_date: +new Date() / 1000
 					}
 				},
-				state:['未知', '测试期' ,'沉默期' ,'使用中' ,'停机', '停机保号' ,'预销号' ,'销号'],
-				id:''
+				state: ['未知', '测试期', '沉默期', '使用中', '停机', '停机保号', '预销号', '销号'],
+				id: ''
 			}
 		},
 		methods: {
@@ -45,32 +48,32 @@
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.send_control.device_sim',
 					data: {
-						 d_id:data,
-						 type:'sim'
+						d_id: data,
+						type: 'sim'
 					}
 				})
 				this.iccid = res[0].iccid
 				this.simdata(this.iccid)
 				console.log(this.iccid)
 			},
-			
+
 			async simdata(data) { //设备列表
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.send_control.sim_query',
 					data: {
-						iccid:data
+						iccid: data
 					}
 				})
 				this.siminfo = JSON.parse(res.data)
 				console.log(this.siminfo.data)
 			},
-			clickLeft(){
+			clickLeft() {
 				uni.navigateBack({
-					delta:1
+					delta: 1
 				})
 			}
 		},
-		onLoad(option){
+		onLoad(option) {
 			this.id = option.id
 			this.simid(this.id)
 		}
@@ -78,31 +81,36 @@
 </script>
 
 <style lang="scss">
-	.sim_info{
+	.sim_info {
 		width: 90%;
 		position: absolute;
-		top:54px;
+		top: 54px;
 		left: 5%;
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding: 30rpx 20rpx 50rpx;
 		border-radius: 20rpx;
 		box-sizing: border-box;
-		.sim_info_title{
+
+		.sim_info_title {
 			width: 100%;
 			display: flex;
-			image{
+
+			image {
 				width: 24rpx;
 				height: 32rpx;
 				margin: 6rpx 20rpx 0 0;
 			}
-			p{
+
+			p {
 				font-weight: 700;
 			}
 		}
-		.sim_info_text{
+
+		.sim_info_text {
 			width: 100%;
 			padding-left: 44rpx;
-			p{
+
+			p {
 				height: 30rpx;
 				margin-top: 20rpx;
 				font-size: 26rpx;

+ 51 - 6
pages/prevention/ucharts.vue

@@ -53,6 +53,9 @@
 					</view>
 				</view>
 			</view>
+			<view class="refresh" @click="refresh">
+				刷 新
+			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
 					<table class="table">
@@ -99,7 +102,6 @@
 	import uCharts from '../../components/js_sdk/u-charts/u-charts/u-charts.js';
 	var canvaColumnA = null;
 	var canvaColumnB = null;
-	var presenttime = +new Date();
 	// var oldpresenttime = presenttime - 24*60*60*1000
 	export default {
 		data() {
@@ -139,15 +141,19 @@
 		},
 		// 页面加载执行的函数
 		onLoad(option) {
-			console.log(option)
 			this.times.d_id = option.d_id
 			this.times.imei = option.imei
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
-			this.getServerData(parseInt(presenttime / 1000), parseInt((presenttime - 24 * 60 * 60 * 1000) / 1000))
-			this.historydata(parseInt(presenttime / 1000), parseInt((presenttime - 24 * 60 * 60 * 1000) / 1000))
+		},
+		onShow(){
+			var presenttime = +new Date();
 			this.oldtime = parseInt((presenttime - 24 * 60 * 60 * 1000) / 1000)
 			this.newtime = parseInt(presenttime / 1000)
+			setTimeout(()=>{
+				this.getServerData(parseInt(presenttime / 1000), parseInt((presenttime - 24 * 60 * 60 * 1000) / 1000))
+				this.historydata(parseInt(presenttime / 1000), parseInt((presenttime - 24 * 60 * 60 * 1000) / 1000))
+			},1000)
 		},
 		methods: { // 
 			//forecast.worm_lamp.device_polyline_data
@@ -404,6 +410,35 @@
 					}
 				});
 			},
+			async newdata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.get_device_config',
+					data: {
+						device_type_id: 2,
+						d_id: this.times.d_id,
+						control_type: "data"
+					}
+				})
+				if(res){
+					uni.showToast({
+						title: '刷新成功',
+						duration: 2000,
+						icon: "none"
+					});
+					uni.navigateBack({
+						delta: 1
+					})
+				}else{
+					uni.showToast({
+						title: '刷新失败',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			refresh() { //获取当前时间的数据
+				this.newdata()
+			},
 		}
 	}
 </script>
@@ -528,10 +563,20 @@
 			}
 		}
 	}
-
-	.condition {
+	.refresh{
 		position: absolute;
 		top: 1530rpx;
+		left: 5%;
+		width: 160rpx;
+		height: 50rpx;
+		background-color: #28AE4F;
+		color: #FFFFFF;
+		line-height: 50rpx;
+		text-align: center;
+	}
+	.condition {
+		position: absolute;
+		top: 1600rpx;
 		display: flex;
 		flex-wrap: wrap;
 		width: 90%;

+ 0 - 50
pages/search/search.vue

@@ -1,50 +0,0 @@
-<template>
-	<view>
-		
-		<!-- <uni-nav-bar @clickRight="clickRight" left-icon="back" left-text="返回"  >
-			<view slot="default">
-				<input type="text" confirm-type="search" value="对对对" />
-			</view>
-		</uni-nav-bar> -->
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				device_type_id:''
-			}
-		},
-		onLoad(option){
-			this.device_type_id=option.device_type_id
-		},
-		async onNavigationBarSearchInputConfirmed(e) {
-		  //在这里执行搜索操作
-		  let pages = getCurrentPages()
-		  let nowPage = pages[ pages.length - 1];  //当前页页面实例
-		  let prevPage = pages[ pages.length - 2 ];  //上一页页面实例
-		  // prevPage.$vm.searchVal = 1211
-		  prevPage.$vm.device_id=e.text
-		  prevPage.$vm.searchEquip()
-		  uni.navigateBack({
-		      delta: 1
-		  });
-		  // let _this=this
-		  // const res=await this.$myRequest({
-		  // 	url:'/api/api_gateway?method=forecast.worm_lamp.lamp_list',
-		  // 	data:{
-		  // 		device_type_id:this.device_type_id,
-		  // 		device_id:e.text,
-		  // 	}
-		  // })
-		},
-		methods: {
-			
-		},
-	}
-</script>
-
-<style>
-
-</style>

BIN
static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png


BIN
static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
unpackage/cache/wgt/__UNI__DBA6730/app-config-service.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-service.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-view.js


BIN
unpackage/cache/wgt/__UNI__DBA6730/static/image/6209a98f0cb3b5086f2ca36152c9269.png


BIN
unpackage/cache/wgt/__UNI__DBA6730/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png


BIN
unpackage/cache/wgt/__UNI__DBA6730/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
unpackage/dist/build/app-plus/app-config-service.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
unpackage/dist/build/app-plus/app-service.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


BIN
unpackage/dist/build/app-plus/static/image/6209a98f0cb3b5086f2ca36152c9269.png


BIN
unpackage/dist/build/app-plus/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png


BIN
unpackage/dist/build/app-plus/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js


Разница между файлами не показана из-за своего большого размера
+ 1757 - 1507
unpackage/dist/dev/app-plus/app-service.js


Разница между файлами не показана из-за своего большого размера
+ 1861 - 1524
unpackage/dist/dev/app-plus/app-view.js


BIN
unpackage/dist/dev/app-plus/static/image/distribution/be5c1cfed22713a9544f020cf41c25f.png


BIN
unpackage/dist/dev/app-plus/static/image/distribution/e19abf8bb442aefd6208f9c4687b57d.png


BIN
unpackage/release/apk/__UNI__DBA6730_20210402114507.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210402115159.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210402165806.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210408090006.apk