Browse Source

代码更新

zhangyun 3 years atrás
parent
commit
a87544b445

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "云控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.4.3",
-    "versionCode" : 143,
+    "versionName" : "1.4.7",
+    "versionCode" : 147,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 0 - 1
pages.json

@@ -35,7 +35,6 @@
 				"navigationBarTitleText": "关于",
 				"enablePullDownRefresh": false
 			}
-
 		}, {
 			"path": "pages/cb/equip-detail/equip-detail",
 			"style": {

+ 4 - 4
pages/afterSale/addafter.vue

@@ -76,7 +76,7 @@
 		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="imgs" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
 		<u-modal v-model="videoshow" :mask-close-able="true" :show-confirm-button="false" title="视频预览" class="model">
 			<view class="model_box">
-				<video :src="BASE_URL+selfList" controls style="width:90%;"></video>
+				<video :src="'http://8.136.98.49:8002'+selfList" controls style="width:90%;"></video>
 			</view>
 		</u-modal>
 	</view>
@@ -89,7 +89,7 @@
 		},
 		data() {
 			return {
-				BASE_URL: 'http://114.115.147.140:8002',
+				BASE_URL: 'http://8.136.98.49:8002',
 				adddata:{//设备参数
 					id:'',
 					name:'',
@@ -185,7 +185,7 @@
 				    success:(res)=> {
 						console.log(res)
 						uni.uploadFile({
-						    url: 'http://114.115.147.140:8002/api/api_gateway?method=after_sale.after_sale_manage.video_upload', //仅为示例,非真实的接口地址
+						    url: 'http://8.136.98.49:8002/api/api_gateway?method=after_sale.after_sale_manage.video_upload', //仅为示例,非真实的接口地址
 						    filePath: res.tempFilePath,
 						    name: 'upload',
 							fileType:"video",
@@ -335,7 +335,7 @@
 			},
 			onok(ev){
 				uni.uploadFile({
-				    url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+				    url: 'http://8.136.98.49:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
 					filePath: ev.path,
 				    name: 'img_file',
 				    formData: {

+ 63 - 44
pages/afterSale/index.vue

@@ -25,24 +25,32 @@
 					<span>设备 ID:{{item.device_id}}</span>
 				</view>
 				<view class="aftersale_item_con">
+					<p>设备类型:{{devtype[item.device_type]}}</p>
 					<p>联系人:{{item.user?item.user:"无"}}</p>
 					<p>联系电话:{{item.userphone?item.userphone:"无"}}</p>
 					<p>位置:{{item.addr?item.addr:"无"}}</p>
-					<p>故障上报时间:{{item.uptime|timeFormat()}}</p>
+					<!-- <p>故障上报时间:{{item.uptime|timeFormat()}}</p> -->
+					<p>故障信息:{{item.errordesc}}</p>
 				</view>
 				<view class="aftersale_item_operate">
-					<button :class="item.errordesc?'fault':'none'" :disabled="!item.errordesc"
-						@click="fault(item.errordesc)">故障原因</button>
-					<button :class="item.errorimg.length!=0?'imgs':'none'" :disabled="item.errorimg.length==0"
-						@click="faultImg(item.errorimg)">图片</button>
-					<button :class="item.errorvideo?'video':'none'" :disabled="!item.errorvideo"
-						@click="faultVideo(item.errorvideo)">视频</button>
+					<view class="aftersale_item_operate_tiem">
+						{{item.uptime|timeFormat()}}
+					</view>
+					<view class="aftersale_item_operate_btn">
+						<button :class="item.errorimg.length!=0?'imgs':'none'" :disabled="item.errorimg.length==0"
+							@click="faultImg(item.errorimg)">图片</button>
+						<button :class="item.errorvideo?'video':'none'" :disabled="!item.errorvideo"
+							@click="faultVideo(item.errorvideo)">视频</button>
+					</view>
+					<!-- <button :class="item.errordesc?'fault':'none'" :disabled="!item.errordesc"
+						@click="fault(item.errordesc)">故障原因</button> -->
+
 				</view>
-				<view class="aftersale_item_icon">
+				<!-- <view class="aftersale_item_icon">
 					<image
-						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+aftersale_icon[Number(item.device_type)-2].src"
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app/image/afterSale/'+item.device_type+'.png'"
 						mode=""></image>
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<view class="addindent" @click="addf">
@@ -58,8 +66,8 @@
 			</view>
 		</u-modal>
 		<view class="top" v-if="isTop" @click="top">
-			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'"
-				mode=""></image>
+			<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/6209a98f0cb3b5086f2ca36152c9269.png" mode="">
+			</image>
 		</view>
 	</view>
 </template>
@@ -71,27 +79,8 @@
 	export default {
 		data() {
 			return {
-				BASE_URL: 'http://114.115.147.140:8002',
+				BASE_URL: 'http://8.136.98.49:8002',
 				faultdata: [],
-				aftersale_icon: [{
-						src: '/image/afterSale/6.png'
-					},
-					{
-						src: '/image/afterSale/1.png'
-					},
-					{
-						src: '/image/afterSale/4.png'
-					},
-					{
-						src: '/image/afterSale/3.png'
-					},
-					{
-						src: '/image/afterSale/5.png'
-					},
-					{
-						src: '/image/afterSale/2.png'
-					}
-				],
 				title: "", //弹框标题
 				show: false, //弹框先显示
 				maskcloseable: true,
@@ -105,14 +94,17 @@
 				page: 1,
 				aftersaleTF: true,
 				isTop: false,
-				imports:"",//搜索设备id
-				width:0,//顶部搜索框的宽度
-				loadingtf:false,//loading
+				imports: "", //搜索设备id
+				width: 0, //顶部搜索框的宽度
+				loadingtf: false, //loading
+				devtype: {
+
+				}
 			}
 		},
 		methods: {
 			async getAftersale() {
-				this.loadingtf= true
+				this.loadingtf = true
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=after_sale.after_sale_manage.aftersale_info',
 					data: {
@@ -212,9 +204,20 @@
 					this.getAftersale()
 				}, 1000)()
 			},
+			async getdevtype() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=home.homes.user_device_type',
+					data: {}
+				})
+				console.log(res)
+				for (var i = 0; i < res.length; i++) {
+					this.devtype[res[i].id] = res[i].type_name
+				}
+				console.log(this.devtype)
+			}
 		},
 		onLoad() {
-
+			this.getdevtype()
 		},
 		onShow() {
 			this.page = 1
@@ -264,17 +267,20 @@
 		padding-top: 40rpx;
 		font-size: 20px;
 	}
-	.loading{
+
+	.loading {
 		position: fixed;
 		top: 440px;
 		width: 95%;
 		left: 2.5%;
 		text-align: center;
-		.img{
+
+		.img {
 			width: 300rpx;
 			height: 40rpx;
 		}
 	}
+
 	.inputs {
 		height: 54rpx;
 		background-color: #E4E4E4;
@@ -329,22 +335,35 @@
 				margin-top: 20rpx;
 
 				p {
-					height: 48rpx;
+					// height: 48rpx;
+					line-height: 48rpx;
 					font-size: 24rpx;
-					color: #BEBEBE;
+					color: #7d7d7d;
 				}
 			}
 
 			.aftersale_item_operate {
-				width: 70%;
+				width: 100%;
 				display: flex;
-				margin: 18rpx 0 0 30%;
-
+				justify-content: space-between;
+				margin-top: 20rpx;
+				.aftersale_item_operate_btn{
+					display: flex;
+				}
+				.aftersale_item_operate_tiem{
+					// line-height: 60rpx;
+					height: 60rpx;
+					padding-top: 30rpx;
+					color: #BEBEBE;
+					font-size: 12px;
+					box-sizing: border-box;
+				}
 				button {
 					width: 130rpx;
 					padding: 0;
 					font-size: 24rpx;
 					color: #FFFFFF;
+					margin-left: 20rpx;
 				}
 
 				.fault {

+ 15 - 6
pages/cb/cbd/equip-set/imgpage.vue

@@ -36,13 +36,16 @@
 						<view class="icon_box" @click="delimg(item.id)">
 							<p class="iconfont icon-shanchu">删除</p>
 						</view>
-						<view class="icon_box" @click="shibie(item.id,item.addr)">
+						<view class="icon_box" @click="shibie(item.id,item.addr)" v-if="disable==1 && device_type!=7">
 							<p class="iconfont icon-shibie">识别</p>
 						</view>
-						<view class="icon_box" @click="tongji(item)">
+						<view class="icon_box" v-else-if="disable==2 && device_type!=7">
+							<p class="iconfont icon-shibie">计数:{{item.des_nums}}只</p>
+						</view>
+						<view class="icon_box" @click="tongji(item)" v-if="device_type!=7">
 							<p class="iconfont icon-tongji2">手动统计</p>
 						</view>
-						<view class="icon_box" @click="add(item)">
+						<view class="icon_box" @click="add(item)" v-if="device_type!=7">
 							<p class="iconfont icon-iconzhengli_shouxieqianpi">手动添加</p>
 						</view>
 						<p style="color: #06B535;">{{item.addtime|timeFormat()}}</p>
@@ -82,6 +85,8 @@
 				titletext: ["24小时", "近一个月", "近半年", "近一年"],
 				titleidnex:0,
 				tiemshow:false,//时间选择器
+				disable:"",
+				device_type:""
 			}
 		},
 		methods: {
@@ -239,7 +244,7 @@
 				this.imglists=[]
 				this.page =1
 				console.log(e)
-				this.timestate = +new Date(e.startDate) / 1000
+				this.timestate = +new Date(e.startDate) / 1000 - 8 * 60 * 60
 				this.timeend = +new Date(e.endDate) / 1000 + 16 * 60 * 60
 				this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
 			},
@@ -258,12 +263,15 @@
 			console.log(option)
 			this.device_id = option.device_id
 			this.d_id = option.d_id
-		},
-		onShow(){
 			this.imglists=[]
+			this.disable = option.disable
+			this.device_type = option.device_type
 			console.log(this.timestate)
 			this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
 		},
+		onShow(){
+			
+		},
 		onReachBottom() {
 			this.page++
 			console.log(this.timestate)
@@ -384,6 +392,7 @@
 			box-shadow: 0 0 10rpx #bcb9ca;
 			padding: 20rpx;
 			margin-bottom: 20rpx;
+			height: 140px;
 		}
 
 		.imglist_left {

+ 14 - 8
pages/cb/cbd/equip-set/statistics.vue

@@ -136,8 +136,6 @@
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
 	var canvaColumnA = null;
 	var canvasRing = null;
-	var newtime = +new Date()
-	var strrttime = newtime - 24 * 60 * 60 * 1000
 	export default {
 		data() {
 			return {
@@ -146,8 +144,8 @@
 				pixelRatio: 1,
 				canvastishiTF: false,
 				d_id: '',
-				start_time: strrttime,
-				end_time: newtime,
+				start_time: +new Date() - 24 * 60 * 60 * 1000,
+				end_time: +new Date(),
 				titletext: ["24小时", "近一个月", "近半年", "近一年"],
 				device_id: '',
 				pest_name: '',
@@ -171,6 +169,7 @@
 						d_id: this.d_id,
 						start_time: parseInt(this.start_time / 1000),
 						end_time: parseInt(this.end_time / 1000),
+						pest_name: ""
 					}
 				})
 
@@ -186,6 +185,7 @@
 					for (var i = 0; i < res.percentage.length; i++) {
 						this.wormdata.unshift(res.percentage[i].name_num)
 					}
+					this.wormdata.unshift("全部")
 					var arr1 = []
 					var arr2 = []
 					var arr3 = []
@@ -193,7 +193,7 @@
 					var ringarr = []
 					for (var i = 0; i < res.date.length; i++) {
 						var times = new Date(res.date[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
 						arr1.unshift(res.date[i].temperature == "" ? "0" : res.date[i].temperature)
 						arr2.unshift(res.date[i].humidity == "" ? "0" : res.date[i].humidity)
 						arr3.unshift(res.date[i]._sums == "" ? "0" : res.date[i]._sums)
@@ -202,7 +202,7 @@
 					for(var i = 0; i < res.percentage.length; i++){
 						var obj = {}
 						obj.name = res.percentage[i].name_num
-						obj.data = Number(res.percentage[i].num)
+						obj.data = Number(res.percentage[i].sum)
 						maxnumarr.unshift(obj)
 					}
 					var temp;
@@ -314,6 +314,7 @@
 					for (var i = 0; i < res.date.length; i++) {
 						this.wormdata.unshift(res.date[i].pest_name)
 					}
+					this.wormdata.unshift("全部")
 					var arr1 = []
 					var xtitle = []
 					var ringarr = []
@@ -358,7 +359,7 @@
 					var xtitle = []
 					for (var i = 0; i < res.pests.pest_list.length; i++) {
 						var times = new Date(res.pests.pest_list[i].add_time * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getSeconds())
+						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
 						arr1.unshift(res.pests.pest_list[i].pest_num == "" ? "0" : res.pests.pest_list[i].pest_num)
 					}
 					var obj = [{
@@ -447,7 +448,12 @@
 				console.log(index)
 				console.log(this.wormdata)
 				this.indextwo = index[0]
-				this.pest_name = this.wormdata[this.indextwo]
+				if(this.indextwo==0){
+					this.pest_name = ""
+				}else{
+					this.pest_name = this.wormdata[this.indextwo]
+				}
+				
 				if (this.topindex == 0) {
 					this.history()
 				} else {

+ 46 - 34
pages/cb/equip-detail/equip-detail.vue

@@ -213,8 +213,8 @@
 				yxShow: false, //诱芯弹框
 				xyErr: '',
 				decoy: '',
-				newtishitf: false,//暂无数据提示
-				dataloadingtf:true,//加载中提示
+				newtishitf: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
 				date: "" //最大可选时间
 			}
 		},
@@ -236,14 +236,14 @@
 						if (this.newState.lamp != undefined) {
 							if (this.newState.ws == 1) {
 								if (this.newState.lamp == 1) {
-									blbs = "工作中";
+									blbs = "异常";
 								} else if (equipState.lux == 0) {
 									blbs = "N/A(未检测到传感器)";
-								} else {
-									blbs = "异常";
+								} else if (this.newState.lamp == 0){
+									blbs = "工作";
 								}
 							} else {
-								blbs = "关闭";
+								blbs = "待机";
 							}
 						} else {
 							blbs = "--";
@@ -466,12 +466,12 @@
 			this.device_status = this.equipInfo.is_online
 			this.getState()
 			console.log(this.equipInfo)
-			if(this.equipInfo.disable){
-				if(this.equipInfo.disable==0){
-					this.cbd[3].tf=false
-				}else{
-					this.cbd[3].tf=true
-				}	
+			if (this.equipInfo.disable) {
+				if (this.equipInfo.disable == 0) {
+					this.cbd[3].tf = false
+				} else {
+					this.cbd[3].tf = true
+				}
 			}
 			this.selectaddress(Number(this.equipInfo.lat), Number(this.equipInfo.lng))
 			var times = new Date()
@@ -481,20 +481,23 @@
 				success: (res) => {
 					console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item) => {
-						return item.pur_id == 36//"测报系统"
+						return item.pur_id == 36 //"测报系统"
 					})
 					console.log(items)
 					let items2 = items[0].children.filter((item) => {
-						return item.pur_id == 37//"虫情测报灯"
+						return item.pur_id == 37 //"虫情测报灯"
 					})
 					let items3 = items[0].children.filter((item) => {
-						return item.pur_id == 38//"性诱测报"
+						return item.pur_id == 38 //"性诱测报"
 					})
 					let items4 = items[0].children.filter((item) => {
-						return item.pur_id == 39//"孢子仪"
+						return item.pur_id == 39 //"孢子仪"
 					})
-					console.log(items2)
-					var arr = items2[0].children
+					console.log(items2[0].children)
+					var arr = []
+					if (items2[0]) {
+						arr = items2[0].children
+					}
 					for (var i = 0; i < arr.length; i++) {
 						switch (arr[i].pur_id) {
 							case 60:
@@ -504,43 +507,51 @@
 								this.cbd[0].tf = true //"查看图片"
 								break
 							case 62:
-								this.cbd[2].tf = true//"设备控制"
+								this.cbd[2].tf = true //"设备控制"
 								break
 							case 63:
-								this.cbd[1].tf = true//"害虫统计"
+								this.cbd[1].tf = true //"害虫统计"
 								break
 						}
 					}
-					// console.log(items3[0].children)
-					var arr2 = items3[0].children
+					console.log(items3[0])
+					var arr2 = []
+					if (items3[0]) {
+						arr2 = items3[0].children
+					}
 					for (var i = 0; i < arr2.length; i++) {
 						switch (arr2[i].pur_id) {
 							case 65:
-								this.xy[0].tf = true//"设备控制"
+								this.xy[0].tf = true //"设备控制"
 								break;
 							case 66:
-								this.xy[1].tf = true//"SIM卡"
+								this.xy[1].tf = true //"SIM卡"
 								break;
 							case 67:
-								this.xy[2].tf = true//"数据详情"
+								this.xy[2].tf = true //"数据详情"
 								break;
 						}
 					}
 					console.log(items4[0].children)
-					var arr3 = items4[0].children
+					// var arr3 = items4[0].children
+					var arr3 = []
+					if (items4[0]) {
+						arr3 = items4[0].children
+					}
+					console.log(arr3)
 					for (var i = 0; i < arr3.length; i++) {
 						switch (arr3[i].pur_id) {
 							case 69:
-								this.bzy[0].tf = true//"设备控制"
+								this.bzy[0].tf = true //"设备控制"
 								break;
 							case 68:
 								this.bzy[1].tf = true //"查看图片"
 								break;
 							case 71:
-								this.bzy[2].tf = true//"数据详情"
+								this.bzy[3].tf = true //"数据详情"
 								break;
 							case 70:
-								this.bzy[3].tf = true//"SIM卡"
+								this.bzy[2].tf = true //"SIM卡"
 								break;
 						}
 					}
@@ -558,8 +569,8 @@
 						device_id: this.equipInfo.imei || this.equipInfo.device_id,
 						page: 1,
 						page_size: 1,
-						start_time: Math.floor((+new Date()-24*60*60*1000)/1000),
-						end_time: Math.floor((+new Date())/1000)
+						start_time: Math.floor((+new Date() - 24 * 60 * 60 * 1000) / 1000),
+						end_time: Math.floor((+new Date()) / 1000)
 					}
 				})
 				this.dataloadingtf = false
@@ -575,7 +586,7 @@
 				var device_id = this.equipInfo.device_id || this.equipInfo.imei
 				uni.navigateTo({
 					url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + device_id + "&device_type=" + this
-						.type
+						.type + "&disable=" + this.equipInfo.disable
 				});
 			},
 			partClicks() {
@@ -802,6 +813,7 @@
 			text-align: center;
 			padding-top: 40rpx;
 			font-size: 32rpx;
+
 			.dataloading:after {
 				overflow: hidden;
 				display: inline-block;
@@ -809,12 +821,12 @@
 				animation: ellipsis 2s infinite;
 				content: "\2026";
 			}
-			
+
 			@keyframes ellipsis {
 				from {
 					width: 2px;
 				}
-			
+
 				to {
 					width: 15px;
 				}

+ 3 - 1
pages/cb/sim/sim.vue

@@ -121,7 +121,9 @@
 			}
 			this.d_id = option.d_id
 			this.lookSIMCode('sim')
-			this.lookSIMCode('hksim')
+			if(option.device_type!=4){
+				this.lookSIMCode('hksim')
+			}
 			this.loding = true
 			this.loding2 = true
 		},

+ 3 - 3
pages/cb/xy/equip-set/xyhistoryile.vue

@@ -36,7 +36,7 @@
 						<image
 							:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/xy/c44ae038324e1040a1eaa702e6d71a5.png'"
 							mode=""></image>
-						<p>风:{{wind_drec}}</p>
+						<p>风:{{wind_drec}}</p>
 					</view>
 				</view>
 			</view>
@@ -60,7 +60,7 @@
 							<td class="td">{{items.d_h_t.cv}}</td>
 							<td class="td">{{items.d_h_t.bv}}</td>
 							<td class="td">{{items.d_h_t.bs}}</td>
-							<td class="td">{{items.d_h_t.cs?"正常":"充电"}}</td>
+							<td class="td">{{items.d_h_t.cs?"非充电":"充电"}}</td>
 							<td class="td">{{items.d_h_t.infr_ct}}</td>
 							<td class="td">{{items.d_h_t.csq}}</td>
 							<td class="td">{{items.d_h_t.dver}}</td>
@@ -209,7 +209,7 @@
 					} else if (res.data[i].d_h_t.bs == 1) {
 						this.historylistdata[i].d_h_t.bs = "欠压"
 					} else if (res.data[i].d_h_t.bs == 2) {
-						this.historylistdata[i].d_h_t.bs = "压"
+						this.historylistdata[i].d_h_t.bs = "压"
 					}
 				}
 				console.log(this.historylistdata)

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

@@ -95,7 +95,7 @@
 					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_line_chart',
 					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),
 						status: "pest"
 					}

+ 23 - 5
pages/cb/xy2.0/particulars.vue

@@ -6,7 +6,7 @@
 				<p>设备名称:{{newState.device_name==""?"无":newState.device_name}}</p>
 				<p>最新上报时间:{{newState.uptime | timeFormat}}</p>
 				<p>最新地址:{{newState.addr}}</p>
-				<p class="fillin" @click="addxy">测报害虫:<input type="text" v-model="newState.decoy" disabled v-if="newState.decoy"/><u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon></p>
+				<p class="fillin" @click="addxy">添加诱芯:<input type="text" v-model="newState.decoy" disabled v-if="newState.decoy"/><u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon></p>
 				<p @click="glass_show=true">诱芯更换时间:<span style="margin:0 20rpx;">{{yxchangetime}}</span><u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon></p>
 				<p @click="glass_showtwo=true">诱芯到期时间:<span style="margin:0 20rpx;">{{yxendtime}}</span><u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon></p>
 				<u-calendar v-model="glass_show" mode="date" :max-date="date" @change="timeChange"></u-calendar>
@@ -62,13 +62,13 @@
 							<p>{{newState.wind}}</p>
 						</view>
 					</view>
-					<!-- <view class="realtime_item">
+					<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>{{newState.warn==""?"暂无":newState.warn}}</p>
+							<p>诱虫次数</p>
+							<p>{{trapnum}}</p>
 						</view>
-					</view> -->
+					</view>
 				</view>
 			</view>
 			<view class="sim" v-if="simTF">
@@ -137,6 +137,7 @@
 					"padding-left":"20rpx",
 					"background-color":"#f6f6f6"
 				},
+				trapnum:0
 			}
 		},
 		methods: {
@@ -256,6 +257,22 @@
 				uni.navigateTo({
 					url: "../../afterSale/addafter?device_id="+ this.newState.device_id +"&device_type="+ 10
 				})
+			},
+			async Chistory(device_id) { //历史数据列表折线图
+				this.dataloadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_line_chart',
+					data: {
+						device_id: device_id,
+						start_time: Math.floor(+new Date/1000 - 24*60*60),
+						end_time: Math.floor(+new Date/1000),
+						status: "pest"
+					}
+				})
+				console.log(res)
+				if(res.data[0]){
+					this.trapnum = res.data[0].pest_num
+				}
 			}
 		},
 		onLoad(option) {
@@ -266,6 +283,7 @@
 			var times = new Date()
 			this.date = times.getFullYear()+1 + "-" + Number(times.getMonth()+1) + "-" + times.getDate()
 			console.log(this.date)
+			this.Chistory(this.equipInfo.device_id)
 			// uni.getStorage({ 待开发
 			// 	key:"jurisdiction",
 			// 	success:(res)=>{

+ 21 - 1
pages/environment/equipment.vue

@@ -294,12 +294,29 @@
 				uni.navigateTo({
 					url: "./sim?simid="+sim
 				})
+			},
+			async getbaseinfo(id){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=weather.weather.qxz_page',
+					data: {
+						page: 1,
+						page_size: 10,
+						device_id: id,
+					}
+				})
+				// console.log(res.ids.id)
+				this.eqinfo.item = res.ids[0]
 			}
 		},
 		onLoad(option) {
 			this.$forceUpdate()
 			this.eqinfo.item = JSON.parse(option.shebei)
 			console.log(JSON.parse(option.shebei))
+				
+			if(!this.eqinfo.item.iccid){
+				this.getbaseinfo(this.eqinfo.item.equip_id)
+			}
+			
 			this.history()
 			this.onehistory()
 			if (this.eqinfo.item.lat == '' || this.eqinfo.item.lng == "") {
@@ -317,7 +334,10 @@
 					let items2 = items[0].children.filter((item) => {
 						return item.purview_name == "环境监测"
 					})
-					var arr = items2[0].children
+					var arr = []
+					if(items2[0]){
+						arr = items2[0].children
+					}
 					console.log(arr)
 					for (var i = 0; i < arr.length; i++) {
 						switch (arr[i].purview_name) {

+ 2 - 2
pages/environment/gsequipment.vue

@@ -34,7 +34,7 @@
 					<span>实时数据</span>
 					<p @click="tohistory">历史数据>>></p>
 				</view>
-				<view class="newdatas_air">
+				<!-- <view class="newdatas_air">
 					<view class="newdatas_air_box">
 						<view class="imgbox">
 							<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/daqi.png"
@@ -65,7 +65,7 @@
 							<p>{{newdataobj.at}}℃</p>
 						</view>
 					</view>
-				</view>
+				</view> -->
 				<view class="newdatas_land" v-for="item,index in newdataobj.temp" :key="index">
 					<p class="newdatas_land_title">{{newdataobj.topic * (index+1)}}cm</p>
 					<view class="newdatas_land_info">

+ 7 - 7
pages/environment/gshistory.vue

@@ -76,8 +76,8 @@
               v-if="!forbidden"
             >
               <td class="td">{{ items.uptime | timeFormat() }}</td>
-              <td class="td">{{ items.ats }}</td>
-              <td class="td">{{ items.at }}</td>
+             <!-- <td class="td">{{ items.ats }}</td>
+              <td class="td">{{ items.at }}</td> -->
               <td
                 class="td"
                 v-for="(item, index) in items.temp"
@@ -92,7 +92,7 @@
               >
                 {{ item }}
               </td>
-              <td class="td">{{ items.atm }}</td>
+              <!-- <td class="td">{{ items.atm }}</td> -->
             </tr>
             <tr class="tr" v-if="forbidden">
               <td class="td" v-for="item in 13">暂无数据</td>
@@ -124,15 +124,15 @@ export default {
       device_id: "", //设备ID
       thdata: [
         "上传时间",
-        "空气湿度(%RH)",
-        "空气温度(℃)",
+        // "空气湿度(%RH)",
+        // "空气温度(℃)",
         "10cm土壤温度(%RH)",
         "20cm土壤温度(%RH)",
         "30cm土壤温度(%RH)",
         "10cm土壤湿度(%RH)",
         "20cm土壤湿度(%RH)",
         "30cm土壤湿度(%RH)",
-        "大气压强(Pa)",
+        // "大气压强(Pa)",
       ], //表格抬头
       forbidden: false,
       historylistdata: [], //历史数据
@@ -242,7 +242,7 @@ export default {
         for (var i = 0; i < listArr.length; i++) {
           // 对比相同的字段key,相同放入对应的数组中
           if (listArr[i].name == el.name && el.data !== undefined) {
-            listArr[i].data.push(el.data[0]);
+            listArr[i].data.unshift(el.data[0]);
             return;
           }
         }

+ 2 - 1
pages/environment/history.vue

@@ -151,6 +151,7 @@
 				this.dataloadingtf = false
 				console.log(res)
 				this.chartdata = res
+				this.titletext = []
 				if (res.data.length == 0) {
 					this.canvastishiTF = false
 				} else {
@@ -176,7 +177,7 @@
 				var arr = []
 				for (var i = 0; i < res.data.length; i++) {
 					if (parseFloat(res.data[i].dat[eindex]) != -99.99) {
-						arr.push(parseFloat(res.data[0].dat[eindex]))
+						arr.unshift(parseFloat(res.data[i].dat[eindex]))
 					}
 				}
 				obj.data = arr

File diff suppressed because it is too large
+ 577 - 629
pages/environment/index.vue


+ 4 - 4
pages/equipList/index.vue

@@ -438,7 +438,7 @@ export default {
     },
     scroll() {},
   },
-  onShow() {
+  onLoad() {
     this.list = [];
     this.camera();
     this.current = 0;
@@ -451,15 +451,15 @@ export default {
       success: (res) => {
         console.log(JSON.parse(res.data));
         let items = JSON.parse(res.data).filter((item) => {
-          return item.purview_name == "设备管理";
+          return item.pur_id == 22//"设备管理";
         });
         let items2 = items[0].children.filter((item) => {
-          return item.purview_name == "设备列表";
+          return item.pur_id == 23//"设备列表";
         });
         console.log(items2[0].children);
         this.infoalter = items2[0].children.some((item) => {
           return (
-            item.purview_name == "修改名称" || item.purview_name == "添加位置"
+            item.pur_id == 108 || item.pur_id == 109
           );
         });
         console.log(this.infoalter);

+ 4 - 4
pages/equipMange/index/index.vue

@@ -141,16 +141,16 @@
 				success:(res)=>{
 					console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item)=>{
-						return item.purview_name == "系统管理"
+						return item.pur_id == 28//"系统管理"
 					})
 					let items2 = items[0].children.filter((item)=>{
-						return item.purview_name == "用户管理"
+						return item.pur_id == 29//"用户管理"
 					})
 					var arr = items2[0].children
 					console.log(arr)
 					for(var i =0;i<arr.length;i++){
-						switch (arr[i].purview_name){
-							case "添加用户":
+						switch (arr[i].pur_id){
+							case 116://"添加用户"
 								this.addtf = true
 								break
 						}

+ 2 - 2
pages/expertDiagnosis/index.vue

@@ -116,11 +116,11 @@
 				success:(res)=>{
 					console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item)=>{
-						return item.purview_name == "专家诊断"
+						return item.pur_id == 124//"专家诊断"
 					})
 					console.log(items)
 					this.jurisdiction = items[0].children.some((item)=>{
-						return item.purview_name == "发帖列表"
+						return item.pur_id == 143//"发帖列表"
 					})
 				},
 			})

+ 13 - 4
pages/fourBase/addbase.vue

@@ -106,10 +106,19 @@
 		},
 		methods: {
 			//base.bases.base_list新增基地
-			async addbase() { //获取分布位置
+			async addbase() { 
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=base.bases.base_list',
-					data: this.baseinfo
+					data: this.baseinfo,
+					ret:"add"
+				})
+				uni.showToast({
+				    title: '填写基地成功', 
+				    duration: 2000,
+					icon:"none"
+				});
+				uni.navigateBack({
+					delta:1
 				})
 			},
 			clickLeft(){
@@ -151,7 +160,7 @@
 				
 				}else if(this.baseinfo.base_name==''){
 					uni.showToast({
-					    title: '请填写基地名称', 
+					    title: '请填写基地名称', 
 					    duration: 2000,
 						icon:"none"
 					});
@@ -202,7 +211,7 @@
 							this.baseinfo.base_equip = arr.join("#")
 						}
 						console.log(this.baseinfo)
-						// this.addbase()
+						this.addbase()
 						localStorage.removeItem("typeid")
 						localStorage.removeItem("location")
 					}

+ 22 - 4
pages/fourBase/index.vue

@@ -22,13 +22,15 @@
 						<view class="bgcolor"></view><!-- 黑色蒙版 -->
 					</view>
 					<view class="bases_list_text">
-						<p >{{items.base_charge}}</p>
+						<p >{{items.base_name}}</p>
 						<p style="font-size: 24rpx;">面积:{{items.base_area}}</p>
 						<p style="font-size: 24rpx;">联系人:{{items.base_charge}}</p>
 						<p style="font-size: 24rpx;">联系电话:{{items.base_phone}}</p>
-						<p style="font-size: 24rpx;">地址:{{items.base_name}}</p>
+						<p style="font-size: 24rpx;">描述:{{items.base_describe}}</p>
+					</view>
+					<view class="bases_list_xiangqing">
+						<u-icon name="more-dot-fill" class="" @click.native.stop="XQclick(items)"></u-icon>
 					</view>
-					<u-icon name="more-dot-fill" class="bases_list_xiangqing" @click.native.stop="XQclick(items)"></u-icon>
 					<view class="photoshow">
 						<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/fourMoodBase/2.png'" mode=""></image>
 						<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/fourMoodBase/3.png'" mode=""></image>
@@ -164,6 +166,9 @@
 						success: (res) => {
 							if (res.confirm) {
 								this.delbase()
+								this.baselist = []
+								this.data.page = 1
+								this.getFourbase()
 							} else if (res.cancel) {
 								console.log('用户点击取消');
 							}
@@ -201,7 +206,7 @@
 						return item.pur_id == 25//"四情基地"
 					})
 					let items2 = items[0].children.filter((item)=>{
-						return item.pur_id == 36//"基地管理"
+						return item.pur_id == 26//"基地管理"
 					})
 					console.log(items2)
 					this.jurisdiction.addbase =items2[0].children.some((item)=>{
@@ -313,9 +318,19 @@
 				box-sizing: border-box;
 				p:first-child{
 					font-size: 36rpx;
+					width: 90%;
+				}
+				p:nth-child(3){
+					width: 70%;
+				}
+				p:last-child{
+					width: 70%;
 				}
 				p {
 					margin-bottom: 10rpx;
+					overflow: hidden;//溢出隐藏
+					white-space: nowrap;//禁止换行
+					text-overflow: ellipsis;//...
 				}
 			}
 
@@ -326,6 +341,9 @@
 				transform: rotate(90deg);
 				font-size: 26rpx;
 				color: #FFFFFF;
+				width: 40rpx;
+				height: 40rpx;
+				z-index: 99999;
 			}
 
 			.photoshow {

+ 3 - 1
pages/index/index.vue

@@ -9,7 +9,7 @@
 					{{hello}}
 				</view>
 				<view class="">
-					{{$isneutral?"欢迎登陆云飞智控":"欢迎登陆智控"}}
+					{{$isneutral?"欢迎登录云飞智控":"欢迎登录智控"}}
 				</view>
 			</view>
 		</view>
@@ -439,6 +439,7 @@
 						},
 						success: (uploadFileRes) => {
 							console.log(JSON.parse(uploadFileRes.data))
+							this.loadTF = false
 							uni.navigateTo({
 								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev
 									.path
@@ -460,6 +461,7 @@
 						},
 						success: (uploadFileRes) => {
 							console.log(JSON.parse(uploadFileRes.data))
+							this.loadTF = false
 							uni.navigateTo({
 								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev
 									.path

+ 8 - 8
pages/prevention/equipmentdetails.vue

@@ -243,28 +243,28 @@
 				success: (res) => {
 					console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item) => {
-						return item.purview_name == "防治系统"
+						return item.pur_id == 44
 					})
 					let items2 = items[0].children.filter((item) => {
-						return item.purview_name == "杀虫灯"
+						return item.pur_id == 45
 					})
 					var arr = items2[0].children
 					console.log(arr)
 					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].purview_name) {
-							case "设备操作":
+						switch (arr[i].pur_id) {
+							case 75://"设备操作"
 								this.kongtf = true
 								break
-							case "设备控制":
+							case 78:
 								this.kongtf = true
 								break
-							case "SIM卡状态":
+							case 76://"SIM卡状态"
 								this.simtf = true
 								break
-							case "SIM卡":
+							case 76://"SIM卡"
 								this.simtf = true
 								break
-							case "数据详情":
+							case 77://"数据详情"
 								this.shujutf = true
 								break
 						}

+ 6 - 5
pages/waterandfer/datails.vue

@@ -67,7 +67,8 @@
 	export default {
 		data() {
 			return {
-				eqinfo: {},
+				eqinfo: {
+				},
 				olddata: {},
 				olddatas: [],
 				newdatesTF: false, //暂无数据显示隐藏
@@ -176,20 +177,20 @@
 				success: (res) => {
 					// console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item) => {
-						return item.pur_id == 208 //灌溉控制系统
+						return item.pur_id == 202 //灌溉控制系统
 					})
 					let items2 = items[0].children.filter((item) => {
-						return item.pur_id == 184//"水肥一体化(X)"
+						return item.pur_id == 195//"水肥一体化(X)"
 					})
 					console.log(items2)
 					var arr = items2[0].children
 					console.log(arr)
 					for (var i = 0; i < arr.length; i++) {
 						switch (arr[i].pur_id) {
-							case 172:
+							case 196:
 								this.zttf = true//"设备状态"
 								break
-							case 173:
+							case 197:
 								this.ystf = true//"要素数据"
 								break
 						}

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


+ 3 - 3
util/api.js

@@ -49,13 +49,13 @@ export const myRequest = (options) => {
 			data: data,
 			success: (res) => {
 				if (res.data.message != "") {
-					if (res.data.message !== "识别无结果") {
+					if (res.data.message == "识别无结果" ||res.data.message == "该设备未绑定SIM") {
+						resolve(res.data.data)
+					} else {
 						return uni.showToast({
 							title: res.data.message,
 							icon: "none"
 						})
-					} else {
-						resolve(res.data.data)
 					}
 				}
 				resolve(res.data.data)