Explorar el Código

增加病虫害可视监测设备详情、图片列表、历史数据

zhangsijie hace 2 años
padre
commit
43511d7e47

+ 27 - 0
pages.json

@@ -737,6 +737,33 @@
             }
             
         }
+        ,{
+            "path" : "pages/cb/sy/detail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设备详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/sy/imgList",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "查看图片",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/sy/history",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "历史记录",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"condition": { //模式配置,仅开发期间生效
 		"current": 3, //当前激活的模式(list 的索引项)

+ 261 - 0
pages/cb/sy/detail.vue

@@ -0,0 +1,261 @@
+<template>
+	<view>
+		<view :class="['info',equipInfo.is_online==1?'on':'off']">
+			<view class="" @click="copy(equipInfo)">
+				设备ID:{{equipInfo.imei||equipInfo.device_id}}
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi">
+				</image>
+			</view>
+			<view class="">
+				设备名称:{{equipInfo.device_name==""?"无":equipInfo.device_name}}
+			</view>
+			<view class="">
+				设备类型:病虫害可视监测
+			</view>
+			<view class="">
+				最新上报时间:{{equipInfo.addtime||equipInfo.uptime | timeFormat}}
+			</view>
+			<view class="">
+				设备地址:{{equipInfo.address}}
+			</view>
+		</view>
+		<view class="caobox">
+			<view class="caobox_item" v-if="$QueryPermission(187)" @click="tophoto">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/1.png" mode="widthFix"></image>
+				<view class="">
+					查看图片
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(181)" @click="tohis">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/2.png" mode="widthFix"></image>
+				<view class="">
+					历史数据
+				</view>
+			</view>
+		</view>
+		<view class="realtime">
+			<view class="realtime_title">
+				<p>实时数据</p>
+			</view>
+			<view class="realtime_text">
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/wendu.png" mode=""></image>
+					<view class="text">
+						<p>环境温度</p>
+						<p>{{at}}℃</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/shidu.png" mode=""></image>
+					<view class="text">
+						<p>环境湿度</p>
+						<p>{{ah}}%RH</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/icon02.png" mode=""></image>
+					<view class="text">
+						<p>开机状态</p>
+						<p>{{status == 1 ? '开机' : '关机'}}</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/yujing.png" mode=""></image>
+					<view class="text">
+						<p>版本号</p>
+						<p>{{version}}</p>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				equipInfo: {},
+				trapnum: 1,
+				at: "",
+				ah: "",
+				status: "",
+				version: "",
+				xyErr: "",
+				xyErrtime: "",
+				decoytime: "",
+				yxShow: false,
+				tiemshow: false,
+				date: "",
+				fieldstyle: { //输入框样式
+					border: "2rpx solid #f6f6f6",
+					"border-radius": "24px",
+					"padding-left": "20rpx",
+					"background-color": "#f6f6f6"
+				},
+				tishitext:""
+			}
+		},
+		methods: {
+			tophoto() {
+				uni.navigateTo({
+					url: "./imgList?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+				})
+			},
+			tohis() {
+				uni.navigateTo({
+					url: "./history?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+				})
+			},
+			copy(item) {
+				console.log(item)
+				uni.setClipboardData({
+					data: item.imei || item.device_id,
+					success: function() {
+						console.log('success');
+					}
+				});
+			},
+			async getatah() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.color_attract_data',
+          data: {
+            device_id: this.equipInfo.imei,
+					}
+				})
+				console.log(res)
+				if (res) {
+					this.at = res.at/10
+          this.ah = res.ah / 10
+          this.status = res.ds
+          this.version = res.dver
+				} else {
+					this.at = "暂无"
+					this.ah = "暂无"
+				}
+			},
+		},
+		onLoad(option) {
+			var times = new Date()
+			this.date = times.getFullYear() + 1 + "-" + Number(times.getMonth() + 1) + "-" + times.getDate()
+      this.equipInfo = JSON.parse(option.detail);
+      console.log(this.equipInfo)
+      this.getatah()
+			// console.log(this.equipInfo)
+			// this.getbaseinfo()
+		},
+	}
+</script>
+
+<style lang='less'>
+	page {
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.info {
+			padding: 20rpx 40rpx;
+			color: #fff;
+			line-height: 50rpx;
+			font-size: 26rpx;
+			background-size: 100% auto;
+			background-repeat: no-repeat;
+			background-color: #0DC6B6;
+			background-position: top left;
+			box-sizing: border-box;
+			width: 100%;
+
+			.tishi {
+				width: 28rpx;
+				height: 28rpx;
+				margin: 0rpx 0 0 20rpx;
+			}
+		}
+
+		.on {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png')
+		}
+
+		.off {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png')
+		}
+
+		.caobox {
+			display: flex;
+			flex-wrap: wrap;
+			text-align: center;
+			font-size: 28rpx;
+			color: #666;
+			line-height: 50rpx;
+
+			image {
+				width: 52rpx;
+			}
+
+			.caobox_item {
+				padding: 20rpx 0;
+				box-sizing: border-box;
+				flex-basis: 25%;
+			}
+		}
+
+		.realtime {
+			width: 95%;
+			margin: 0rpx auto;
+
+			.realtime_title {
+				font-size: 32rpx;
+				display: flex;
+				justify-content: space-between;
+				font-weight: 700;
+
+				.span {
+					color: #6e6c76;
+					font-size: 24rpx;
+					display: flex;
+					justify-content: space-between;
+					margin-top: 12rpx;
+				}
+			}
+
+			.realtime_text {
+				margin-top: 20rpx;
+				display: flex;
+				justify-content: space-between;
+				flex-wrap: wrap;
+
+				.realtime_item {
+					width: 48%;
+					height: 100rpx;
+					display: flex;
+					box-shadow: 0 0 10rpx #bcb9ca;
+					margin-top: 20rpx;
+					padding: 20rpx 0;
+
+					image {
+						width: 60rpx;
+						height: 60rpx;
+						margin: 20rpx 20rpx 20rpx 40rpx;
+					}
+
+					.text {
+						padding: 10rpx 0 10rpx 30rpx;
+					}
+				}
+			}
+		}
+	}
+
+	.btn-box {
+		text-align: center;
+		padding: 20rpx 30rpx;
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 390 - 0
pages/cb/sy/history.vue

@@ -0,0 +1,390 @@
+<template>
+	<view>
+		<view class="">
+			<view class="timeandtype">
+				<view class="timebox">
+					<view class="firsttime" @click="timeshow=true">
+						<view class="" v-if="start_time!=''">
+							{{(start_time==""?'请选择开始时间':start_time)/1000|timeFormat()}}
+						</view>
+						<view class="" v-else>
+							{{start_time==""?'请选择开始时间':start_time}}
+						</view>
+					</view>
+					<view class="jiange">
+						-
+					</view>
+					<view class="endtime" @click="timeshow=true">
+						<view class="" v-if="end_time!=''">
+							{{(end_time==""?'请选择结束时间':end_time)/1000|timeFormat()}}
+						</view>
+						<view class="" v-else>
+							{{end_time==""?'请选择结束时间':end_time}}
+						</view>
+					</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" v-if="$QueryPermission(181)">
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.addtime|timeFormat()}}</td>
+							<td class="td">{{items.at==""?"--":items.ah/10}}</td>
+							<td class="td">{{items.ah==""?"--":items.at/10}}</td>
+							<td class="td">{{items.ds==1?"开机":"关机"}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 8">暂无数据</td>
+						</tr>
+					</table>
+				</scroll-view>
+				<view class="pagenumber">
+					<button @click="prev">上一页</button>
+					<view class="pagenumber_page">
+						第 {{page}} 页
+					</view>
+					<view class="pagenumber_page">
+						共 {{pagesum}} 页
+					</view>
+					<button @click="next" :disabled="forbidden">下一页</button>
+				</view>
+			</view>
+		</view>
+		<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
+	</view>
+</template>
+
+<script>
+	import uCharts from '../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	var canvaColumnA = null;
+	export default {
+		data() {
+			return {
+				styles: {
+					// width: "650rpx",
+					height: "400rpx"
+				},
+				d_id: '',
+				start_time: "",
+				end_time: "",
+				historydatas: [],
+				titletext: ["24小时", "近一个月", "近半年", "近一年"],
+				titleidnex: 0,
+				device_id: '',
+				page: 1,
+				historylistdata: [],
+				thdata: ["上报时间", "空气湿度(%RH)", "空气温度(°C)", "开机状态"],
+				forbidden: false,
+				pixelRatio: 1,
+				canvastishiTF: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
+				pagesum: 1,
+				worms: [],
+				timeshow:false,
+				mode: 'range',
+			}
+		},
+		methods: {
+			//forecast.worm_lamp.device_history_data历史数据列表
+			async historylist() { //历史数据列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.color_attract_list',
+					data: {
+						d_id: this.d_id,
+						start_time: parseInt(this.start_time / 1000),
+						end_time: parseInt(this.end_time / 1000),
+            page: this.page,
+            page_size: 10
+					}
+				})
+				this.historylistdata = res.data
+				console.log(res.data)
+				this.pagesum = Math.ceil(res.counts / 10) || 1
+				if (res.data.length == 0) {
+					this.forbidden = true
+				} else {
+					this.forbidden = false
+				}
+				console.log(this.historylistdata)
+			},
+			// forecast.send_control.get_device_config 获取当前时间的数据
+			async newdata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_mqtt',
+					data: {
+						d_id: this.d_id
+					}
+				})
+				if (res) {
+					uni.showToast({
+						title: '刷新成功',
+						duration: 2000,
+						icon: "none"
+					});
+				} else {
+					uni.showToast({
+						title: '刷新失败',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			refresh() { //获取当前时间的数据
+				this.newdata()
+			},
+			prev() { //上一页
+				if (this.page > 1) {
+					this.page--
+					this.historylist()
+				}
+			},
+			next() { //下一页
+				if (this.page < this.pagesum) {
+					this.page++
+					this.historylist()
+				}
+			},
+			clickLeft() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			closetime() {
+				this.start_time = ""
+				this.end_time = ""
+				this.listpage = 1
+				this.historylist()
+			},
+			timechange(e) {
+				console.log(e)
+				this.start_time = +new Date(e.startDate)
+				this.end_time = +new Date(e.endDate)
+				this.listpage = 1
+				this.historylist()
+			},
+		},
+		onLoad(option) {
+			console.log(option)
+			this.d_id = option.d_id
+			this.device_id = option.device_id
+		},
+		onShow() {
+			this.end_time = +new Date() + 1000
+			this.start_time = this.end_time - 24 * 60 * 60 * 1000
+			console.log(new Date(this.end_time), new Date(this.start_time))
+			this.historylist()
+		},
+		onPullDownRefresh() {
+			console.log('refresh');
+			this.historylist()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
+		}
+	}
+</script>
+
+<style lang="less">
+	.timeandtype {
+		// background-color: #F6F6FB;
+		// padding: 20rpx;
+		box-sizing: border-box;
+		width: 90%;
+		margin: 40rpx auto 0;
+		.timebox {
+			box-shadow: 0 0 10rpx #bcb9ca;
+			display: flex;
+			background-color: #fff;
+			padding: 10px;
+			border-top-right-radius: 5px;
+			border-top-left-radius: 5px;
+	
+			.jiange {
+				width: 5%;
+				text-align: center;
+			}
+	
+			.firsttime,
+			.endtime {
+				width: 45%;
+				text-align: center;
+			}
+		}
+	
+		.warntypebox {
+			display: flex;
+			justify-content: space-between;
+			background-color: #fff;
+			padding: 10px;
+			border-top: 1px solid #F6F6FB;
+			border-bottom-right-radius: 5px;
+			border-bottom-left-radius: 5px;
+		}
+	}
+	.shuju_one,
+	.shuju_two {
+		// position: absolute;
+		// top: 100px;
+		// width: 90%;
+		// left: 5%;
+		width: 90%;
+		margin: 40rpx auto;
+		box-shadow: 0 0 10rpx #bcb9ca;
+		padding-top: 20rpx;
+		height: 550rpx;
+
+		.canvastishi {
+			font-size: 32rpx;
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			margin-left: -64rpx;
+			margin-top: -21rpx;
+
+			.dataloading:after {
+				overflow: hidden;
+				display: inline-block;
+				vertical-align: bottom;
+				animation: ellipsis 2s infinite;
+				content: "\2026";
+			}
+
+			@keyframes ellipsis {
+				from {
+					width: 2px;
+				}
+
+				to {
+					width: 15px;
+				}
+			}
+		}
+
+		.shuju_one_title {
+			width: 70%;
+			margin: 0 auto;
+			display: flex;
+
+			.tltle_text {
+				width: 25%;
+				border: 2rpx solid #B2B2B2;
+				color: #57c878;
+				text-align: center;
+				font-size: 24rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+			}
+
+			.title_text_color {
+				width: 25%;
+				border: 2rpx solid #57c878;
+				background-color: #57c878;
+				color: #fff;
+				text-align: center;
+				font-size: 24rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+			}
+		}
+	}
+
+	.refresh {
+		width: 90%;
+		// margin: 40rpx auto;
+		margin-left: 5%;
+    margin-top: 20rpx;
+		width: 160rpx;
+		height: 50rpx;
+		background-color: #57c878;
+		color: #FFFFFF;
+		line-height: 50rpx;
+		text-align: center;
+	}
+
+	.condition {
+		width: 90%;
+		margin: 40rpx auto;
+		display: flex;
+		flex-wrap: wrap;
+		width: 90%;
+		box-shadow: 0 0 10rpx #bcb9ca;
+		margin-bottom: 30rpx;
+
+		.scroll-X {
+			width: 95%;
+			margin: 20rpx auto;
+
+			.table {
+				width: 100%;
+			}
+
+			.tr {
+				display: flex;
+				overflow: hidden;
+
+				.th,
+				.td {
+					display: inline-block;
+					padding: 5rpx;
+					width: 240rpx;
+					text-align: center;
+					height: 52rpx;
+					line-height: 52rpx;
+				}
+
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
+			}
+
+			.tr:nth-child(2n-1) {
+				background-color: #f5fff8;
+			}
+
+			.tr:first-child {
+				background-color: #57c878;
+				color: #fff;
+			}
+		}
+
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+      width: 100%;
+      justify-content: space-around;
+
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #FFFFFF;
+			}
+
+			.pagenumber_page {
+				// width: 100rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+			}
+		}
+	}
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+	
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 278 - 0
pages/cb/sy/imgList.vue

@@ -0,0 +1,278 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;">
+			<view style="position: fixed;z-index: 100;">
+				<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="selecttimes" @click="tiemshow=!tiemshow">
+				<view class="timesbox">
+					<image
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
+						mode=""></image>
+					<p>{{timetab(timestate)}}</p>
+					<p class="or">~</p>
+					<p>{{timetab(timeend)}}</p>
+					<u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon>
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+			</view>
+			<view class="imglist">
+				<view class="imglist_box" v-for="(item,index) in imglists" :key="index">
+					<view class="imglist_left">
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/jiazai.ui.gif" mode="">
+						</image>
+						<image :src="item.addr" mode="" @click="examine(index)"></image>
+					</view>
+					<view class="imglist_right">
+						<view class="">
+							{{item.time}}
+						</view>
+						<view class="">
+							害虫数量:{{item.pest_counts}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'"
+				mode=""></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tiemshow:false,
+				timestate:"",
+				timeend:"",
+				isTop:false,
+				imglists:[],
+				device_id:"",
+				page:1,
+				d_id:""
+			}
+		},
+		methods: {
+			clickLeft(){
+				uni.navigateBack({
+					delta:1
+				})
+			},
+			clickRight(){
+				this.takephoto()
+			},
+			timetab(e) {
+				e = new Date(e * 1000)
+				var year = e.getFullYear()
+				var month = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1
+				var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate()
+				var time = year + "/" + month + "/" + day
+				return time
+			},
+			examine(index){
+				var imgarr = []
+				for (var i = 0; i < this.imglists.length; i++) {
+					imgarr.push(this.imglists[i].addr)
+				}
+				uni.previewImage({
+					urls: imgarr,
+					current: index
+				});
+			},
+			async getimglist(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.forecast_system.device_photo_list',
+					data: {
+						cmd: "color",
+						device_id: this.device_id,
+						page: this.page,
+						page_number: "12",
+						time_begin: Math.floor(this.timestate),
+						time_end: Math.floor(this.timeend),
+					}
+				})
+				console.log(res)
+				this.imglists = res.data
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
+			tiemchange(e){
+				// console.log(e)
+				this.imglists = []
+				this.page = 1
+				console.log(e)
+				this.timestate = +new Date(e.startDate) / 1000 - 8 * 60 * 60
+				this.timeend = +new Date(e.endDate) / 1000 + 16 * 60 * 60
+				this.getimglist()
+			},
+			async takephoto() { //拍照
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						device_type_id: 8,
+						d_id: this.d_id,
+						cmd: "takephoto"
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+					var that = this
+					setTimeout(() => {
+						that.getimglist()
+					}, 1000)
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			
+			},
+		},
+		onLoad(option) {
+			this.d_id =  option.d_id
+			this.device_id = option.device_id
+			this.timeend = +new Date() / 1000
+			this.timestate = this.timeend - 60 * 60 * 24
+			this.getimglist()
+		},
+		onReachBottom() {
+			this.page++
+			this.getimglist()
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.tishi {
+		position: absolute;
+		top: 104px;
+		width: 95%;
+		left: 2.5%;
+		text-align: center;
+		font-size: 40rpx;
+	}
+
+	.selecttimes {
+		width: 100%;
+		position: fixed;
+		top: 85px;
+		left: 0;
+		z-index: 100;
+		background-color: #fff;
+		padding-top: 30rpx;
+
+		.timesbox {
+			display: flex;
+			width: 95%;
+			margin: 0 auto;
+			justify-content: space-around;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 10rpx 20rpx;
+			box-sizing: border-box;
+
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				margin-top: 6rpx;
+			}
+
+			.icon {
+				color: #949494;
+				text-align: right;
+				margin-left: 30rpx;
+
+			}
+		}
+
+		/deep/.u-calendar__action {
+			display: flex;
+			justify-content: space-around;
+
+			.u-calendar__action__text {
+				line-height: 25px;
+			}
+		}
+	}
+	.imglist {
+		position: absolute;
+		top: 100px;
+		width: 95%;
+		left: 2.5%;
+	
+		.imglist_box {
+			display: flex;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx;
+			margin-bottom: 20rpx;
+			height: 155px;
+		}
+	
+		.imglist_left {
+			width: 50%;
+			position: relative;
+	
+			image {
+				position: absolute;
+				top: 0;
+				left: 0;
+				width: 100%;
+				height: 280rpx;
+			}
+		}
+	
+		.imglist_right {
+			margin-left: 40rpx;
+			padding: 10rpx 0;
+	
+			.icon_box {
+				margin-bottom: 12rpx;
+				font-size: 24rpx;
+	
+				.iconfont {
+					margin-right: 20rpx;
+					color: #56C877;
+					font-size: 32rpx;
+				}
+			}
+	
+			p:last-child {
+				margin-bottom: 0;
+			}
+	
+		}
+	}
+.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>

+ 1 - 1
pages/cb/thxydetail/thxyhisdata.vue

@@ -224,7 +224,7 @@
 						d_id: this.equipInfo.d_id,
 						start_time: Math.floor(+new Date(this.start_time) / 1000),
 						end_time: Math.floor(+new Date(this.end_time) / 1000),
-						device_id: this.equipInfo.imei,
+						device_id: this.equipInfo.device_id,
 						page: this.page,
 					}
 				})

+ 1 - 1
pages/cb/xy2.0/historydatas.vue

@@ -167,7 +167,7 @@
 					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_history',
 					data: {
 						device_id: this.device_id,
-						strat_time: parseInt(this.start_time / 1000),
+						start_time: parseInt(this.start_time / 1000),
 						end_time: parseInt(this.end_time / 1000),
 						page: this.page
 					}

+ 7 - 2
pages/equipList/index.vue

@@ -82,7 +82,7 @@
             </view>
             <view
               class="list_item_btn"
-              v-if="$QueryPermission(108) && ![13, 17, 18, 11, 19, 20].includes(type_id)"
+              v-if="$QueryPermission(108) && ![13, 17, 18, 11, 19, 20, 14].includes(type_id)"
               @click.stop="modification(item)"
             >
               信息修改
@@ -214,7 +214,6 @@ export default {
       console.log(res);
       for (var i = 0; i < res.length; i++) {
         if (
-          res[i].type_name == "病虫害可视监测" ||
           res[i].type_name == "温室大棚"
         ) {
           continue;
@@ -270,6 +269,12 @@ export default {
     historys(item) {
       console.log("item", item);
       switch (this.type_id) {
+        // 病虫害可视监测
+        case 14: 
+          uni.navigateTo({
+            url: "../cb/sy/detail?detail=" + JSON.stringify(item),
+          });
+        break
         case 2:
           uni.navigateTo({
             url:

+ 20 - 0
pages/qxzyj/cbwarn.vue

@@ -275,6 +275,9 @@
 				this.getwranlistdata()
 			},
 			async getwranlistdata() {
+				uni.showLoading({
+					title: '加载中'
+				});
 				var end_time = ""
 				var start_time = ""
 				if(this.end_time!=""){
@@ -298,6 +301,7 @@
 					}
 				})
 				console.log(res)
+				uni.hideLoading()
 				this.wranlistdata = this.wranlistdata.concat(res.data)
 			},
 			tomap(data) {
@@ -383,6 +387,9 @@
 				})
 			},
 			async allread() {
+				uni.showLoading({
+					title: '加载中'
+				});
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
 					data: {
@@ -390,6 +397,7 @@
 						device_type: this.device_type
 					}
 				})
+				uni.hideLoading()
 				if (res) {
 					uni.showToast({
 						title: "已完成一键已读",
@@ -404,6 +412,9 @@
 				this.warmstatus = data
 			},
 			async singlereadsure() {
+				uni.showLoading({
+					title: '加载中'
+				});
 				if (this.warmstatus.status == 0) {
 					const res = await this.$myRequest({
 						url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
@@ -411,6 +422,7 @@
 							id: this.warmstatus.id
 						}
 					})
+					uni.hideLoading()
 					if (res) {
 						uni.showToast({
 							title: "此条预警已读",
@@ -429,6 +441,9 @@
 				});
 			},
 			async getconfiglist() {
+				uni.showLoading({
+					title: '加载中'
+				});
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_config_list',
 					data: {
@@ -438,6 +453,7 @@
 						page_size: "10",
 					}
 				})
+				uni.hideLoading()
 				console.log(res.data)
 				this.configlist = []
 				for (var i = 0; i < res.data.length; i++) {
@@ -447,6 +463,9 @@
 				console.log(this.configlist)
 			},
 			async swichchange(e, id) {
+				uni.showLoading({
+					title: '加载中'
+				});
 				// console.log(e, id)
 				// console.log(this.configlist)
 				const res = await this.$myRequest({
@@ -456,6 +475,7 @@
 						status: e ? 1 : 0,
 					}
 				})
+				uni.hideLoading()
 				if (res) {
 					uni.showToast({
 						title: "状态修改成功",

+ 4 - 0
pages/qxzyj/warnset.vue

@@ -207,6 +207,9 @@
 				this.tongdaolist[this.selindex].valuenum = e[0].value
 			},
 			async getbasetongdao(device_id) {
+				uni.showLoading({
+					title: '加载中'
+				});
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=weather.weather.qxz_early_warning',
 					data: {
@@ -215,6 +218,7 @@
 						status: "see"
 					}
 				})
+				uni.hideLoading()
 				console.log(res.conf)
 				this.tongdaolist = []
 				for (var key in res.conf) {

+ 2 - 2
util/api.js

@@ -4,8 +4,8 @@ export const myRequest = (options) => {
 	let BASE_URL = uni.getStorageSync('http')
 	console.log(BASE_URL,'my request',process.env.NODE_ENV)
 	if (BASE_URL == '') {
-		// BASE_URL = 'http://8.136.98.49:8002'//线上
-		BASE_URL = process.env.NODE_ENV === 'development' ? "http://192.168.0.36:8003" : "http://8.136.98.49:8002"
+		// BASE_URL = 'http://114.55.0.7:8002'//测试
+		BASE_URL = process.env.NODE_ENV === 'development' ? "http://192.168.0.214:8003" : "http://8.136.98.49:8002"
 		// BASE_URL = 'http://192.168.1.77:8002'
 	}
 	// BASE_URL = 'http://192.168.1.52:8003'