Parcourir la source

Merge branch 'master' of http://39.104.94.153:3000/yf_lj/bigDataApp

lj il y a 4 ans
Parent
commit
76097ef199

+ 3 - 0
components/highcharts/highcharts.vue

@@ -9,6 +9,9 @@
 	import {
 		Chart
 	} from 'highcharts-vue'
+	import Highcharts from 'highcharts'
+	import HighchartsNoData from 'highcharts/modules/no-data-to-display'
+	HighchartsNoData(Highcharts)
 	// import Highcharts from 'highcharts/highstock';
 	// import HighchartsMore from 'highcharts/highcharts-more';
 	// import HighchartsDrilldown from 'highcharts/modules/drilldown';

+ 4 - 0
pages/afterSale/addafter.vue

@@ -226,12 +226,14 @@
 		width: 100%;
 		padding: 110rpx 0;
 		background-color: #71CD9A;
+		box-sizing: border-box;
 		.addafter_con_top{
 			width: 90%;
 			margin: 0 auto;
 			background-color: #FFFFFF;
 			padding: 16rpx 30rpx 36rpx;
 			border-radius: 20rpx;
+			box-sizing: border-box;
 			p{
 				text-align: center;
 				font-size: 30rpx;
@@ -252,6 +254,7 @@
 			display: flex;
 			justify-content: space-between;
 			padding: 0 16rpx;
+			box-sizing: border-box;
 			image{
 				width: 20rpx;
 				height: 60rpx;
@@ -263,6 +266,7 @@
 			background-color: #FFFFFF;
 			padding: 30rpx;
 			border-radius: 20rpx;
+			box-sizing: border-box;
 			.addafter_con_bot_title{
 				text-align: center;
 				font-size: 30rpx;

+ 1 - 1
pages/afterSale/index.vue

@@ -180,7 +180,7 @@
 			box-shadow: 0 0 10rpx #bcb9ca;
 			padding: 30rpx 20rpx 20rpx;
 			position: relative;
-
+			box-sizing: border-box;
 			.aftersale_item_title {
 				width: 100%;
 

+ 4 - 1
pages/cb/bzy/equip-set/bzyhistoryile.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view style="position: fixed;z-index: 100;">
-			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片"></uni-nav-bar>
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="历史数据"></uni-nav-bar>
 		</view>
 		<view class="shuju_one">
 			<view class="shuju_one_title">
@@ -62,6 +62,9 @@
 					height: "400rpx"
 				},
 				options: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',

+ 3 - 0
pages/cb/cbd/equip-set/historyfile.vue

@@ -61,6 +61,9 @@
 					height: "400rpx"
 				},
 				options: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',

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

@@ -77,6 +77,9 @@
 					height: "400rpx"
 				},
 				options: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',

+ 230 - 33
pages/disandpests/index.vue

@@ -3,73 +3,223 @@
 		<view style="position: fixed;z-index: 100;">
 			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="病虫害识别"></uni-nav-bar>
 		</view>
-		<image :src="path" mode="" class="image"></image>
+		<view class="image_box">
+			<image :src="path" mode="widthFix" class="image"></image>
+		</view>
 		<view class="recognition" v-if="datasTF">
 			<p class="recognition_title">{{name}}</p>
-			<view class="recognition_img">
-				<image :src="path2" mode=""></image>
+			<view :class="tishi?'recognition_img':'recognition_img_two'">
+				<image :src="path2" mode="" @error="error"></image>
 			</view>
-			<button class="recognition_details" v-if="tishi" @click="">查看详情</button>
+			<button class="recognition_details" v-if="tishi" @click="examine">查看详情</button>
+			<button class="recognition_details" v-if="!tishi" @click="show=!show">再拍一张</button>
 		</view>
 		<view class="datas" v-else>
-			<p>{{prevention}}</p>
+			<p class="datas_title">{{name}}</p>
+			<view v-for="(item,index) in preventionArr" :key="index" class="prevention">
+				<view class="prevention_title">
+					<u-icon name="play-right-fill" size="24" color="#55A92D"></u-icon>
+					<p>{{regexptitle[index]}}:</p>
+				</view>
+				<p class="prevention_con">{{item}}</p>
+			</view>
+			<button class="recognition_details" v-if="tishi" @click="examine">查看图片</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>
 </template>
 
 <script>
+	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
 	export default {
+		components: {
+			kpsImageCutter
+		},
 		data() {
 			return {
 				path: "",
-				path2:"",
+				path2: "",
 				tishi: true,
-				name:"",
-				prevention:"",
-				datasTF:true
+				name: "",
+				prevention: "",
+				datasTF: true,
+				show: false,
+				url: "",
+				preventionArr: [],
+				regexptitle: []
 			}
 		},
 		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(){
-				this.datasTF = false
+			examine() {
+				this.datasTF = !this.datasTF
+			},
+			confirm() {
+				this.flag = 1
+				uni.chooseImage({
+					count: 1, //默认9
+					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera', 'album'], //从相册选择
+					success: (res) => {
+						this.url = res.tempFilePaths[0]
+					}
+				});
+			},
+			cancel() {
+				this.flag = 2
+				uni.chooseImage({
+					count: 1, //默认9
+					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera', 'album'], //从相册选择
+					success: (res) => {
+						console.log(1)
+						this.url = res.tempFilePaths[0]
+					}
+				});
+			},
+			onok(ev) {
+				if (this.flag == 2) {
+					// pest.pests.insect_discern 虫害
+					uni.uploadFile({
+						// url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+						url: 'http://182.92.193.64:8002/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
+						filePath: ev.path,
+						name: 'img_file',
+						formData: {
+							'user': 'test'
+						},
+						success: (uploadFileRes) => {
+							console.log(JSON.parse(uploadFileRes.data))
+							this.optionverify(JSON.parse(uploadFileRes.data).data)
+						}
+					});
+				} else if (this.flag == 1) {
+					//pest.pests.insect_discern病害识别
+					uni.uploadFile({
+						// url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+						url: 'http://182.92.193.64:8002/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
+						filePath: ev.path,
+						name: 'img_file',
+						formData: {
+							'user': 'test'
+						},
+						success: (uploadFileRes) => {
+							console.log(JSON.parse(uploadFileRes.data))
+							this.optionverify(JSON.parse(uploadFileRes.data).data)
+						}
+					});
+				}
+				this.url = "";
+			},
+			oncancle() {
+				// url设置为空,隐藏控件
+				this.url = ''
+			},
+			error() {
+				this.path2 = "../../static/image/e1cd85dc59139760f43ddbac15136f2.png"
+			},
+			optionverify(data){
+				if (data == null) {
+					this.name = "识别失败,请换张图片"
+					this.tishi = false
+					this.path2 = "../../static/image/10ca93e17420371a82826073c8425c0.png"
+				} else {
+					this.path2 = data.img_urls
+					this.name = data.name
+					this.tishi = true
+					this.prevention = data.prevention
+					var regex2 = /\[(.+?)\]/g; // [] 中括号
+					var str = this.prevention
+					var arr = str.match(regex2)
+					var arrindex = []
+					for (var i = 0; i < arr.length; i++) {
+						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]))
+					}
+					for (var i = 0; i < arr.length; i++) {
+						arr[i] = arr[i].slice(1, arr[i].length - 1)
+					}
+					this.regexptitle = arr
+				}
 			}
 		},
 		onLoad(option) {
+			console.log(option)
 			this.path = option.path
-			console.log(JSON.parse(option.datas).img_urls, option.path)
-			if (JSON.parse(option.datas).img_urls== undefined ) {
-				this.name = "识别失败,请换张图片"
-				this.tishi = false
-			} else {
-				this.path2 = JSON.parse(option.datas).img_urls
-				this.name = JSON.parse(option.datas).name
-				this.tishi = true
-				this.prevention =  JSON.parse(option.datas).prevention
-			}
-
+			this.optionverify(JSON.parse(option.datas).data)
 		}
 	}
 </script>
 
 <style lang="scss">
-	.image {
+	
+	.image_box{
 		position: absolute;
 		top: 44px;
 		width: 100%;
 		height: 400rpx;
+		display: flex;
+		justify-content: center;
+		.image {
+			margin: 0 auto;
+		}
 	}
-
 	.recognition {
 		position: absolute;
-		top: 244px;
+		top: 254px;
 		width: 100%;
 		height: 800rpx;
-
+		
 		.recognition_title {
 			width: 100%;
 			text-align: center;
@@ -88,9 +238,24 @@
 			line-height: 450rpx;
 
 			image {
+				margin-top: 50rpx;
+				width: 340rpx;
+				height: 340rpx;
+			}
+		}
+
+		.recognition_img_two {
+			width: 450rpx;
+			height: 450rpx;
+			border-radius: 50%;
+			margin: 0 auto;
+			text-align: center;
+			line-height: 450rpx;
+
+			image {
 				margin-top: 10rpx;
-				width: 430rpx;
-				height: 430rpx;
+				width: 340rpx;
+				height: 340rpx;
 			}
 		}
 
@@ -104,11 +269,43 @@
 			color: #FFFFFF;
 		}
 	}
-	.datas{
+
+	.datas {
 		position: absolute;
-		top: 244px;
-		width: 90%;
-		left: 5%;
-		padding: 20rpx;
+		top: 264px;
+		width: 95%;
+		left: 2.5%;
+		.datas_title{
+			font-size: 32rpx;
+			font-weight: 700;
+			margin-left: 30rpx;
+		}
+		.recognition_details {
+			width: 400rpx;
+			height: 80rpx;
+			border-radius: 40rpx;
+			margin: 30rpx auto;
+			font-size: 30rpx;
+			background-color: #67B25F;
+			color: #FFFFFF;
+		}
+	}
+	.prevention{
+		font-size: 28rpx;
+		color: #919191;
+		width: 95%;
+		margin:  20rpx auto;
+		.prevention_title{
+			display: flex;
+			p{
+				margin-left: 20rpx;
+				color: #000000;
+				font-size: 28rpx;
+				font-weight: 700;
+			}
+		}
+		.prevention_con{
+			padding-left: 6%;
+		}
 	}
 </style>

+ 1 - 1
pages/distribution/index.vue

@@ -9,7 +9,7 @@
 			</view>
 			<view class="page-section page-section-gap">
 				<map style="width: 100%; height: 85vh;" scale="3" :latitude="latitude" :longitude="longitude" :markers="covers"
-				 :enable-zoom="true" @markertap="markertap">
+				 :enable-zoom="true" @markertap="markertap" :include-points="covers">
 				</map>
 			</view>
 		</view>

+ 3 - 3
pages/environment/equipment.vue

@@ -10,7 +10,7 @@
 				<p style="font-size: 32rpx;">设备 ID:{{eqinfo.item.equip_id}}</p>
 				<p>设备名称:{{eqinfo.item.equip_name?eqinfo.item.equip_name:"无"}}</p>
 				<p>最近上报时间:{{eqinfo.item.uptime|timeFormat()}}</p>
-				<p>地址:{{city}}</p>
+				<p>地址:{{city?city:"---"}}</p>
 			</view>
 		</view>
 		<view class="control">
@@ -99,10 +99,10 @@
 			this.eqinfo.item = JSON.parse(option.shebei)
 			console.log(this.eqinfo)
 			uni.request({
-				url: '/dpc/geocoder/v1?location='+this.eqinfo.item.lat+","+this.eqinfo.item.lng+'&key=B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ',
+				url: '/dpc/geocoder/v1/?location='+this.eqinfo.item.lat+","+this.eqinfo.item.lng+'&key=B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ',
 				success: (res) => {
+					console.log(res)
 					this.city = res.data.result.address
-					console.log(res.data.result.address)
 				}
 			})
 			this.history()

+ 38 - 31
pages/environment/history.vue

@@ -75,6 +75,9 @@
 					height: "400rpx"
 				},
 				options: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',
@@ -141,8 +144,8 @@
 				},
 				tishiTF: false, //提示
 				historydatas: [],
-				page:1,
-				forbidden:false
+				page: 1,
+				forbidden: false
 			}
 		},
 		methods: { //weather.weather.qxz_detail
@@ -153,14 +156,14 @@
 						device_id: datas,
 						begin: parseInt(this.begintime),
 						end: parseInt(this.end),
-						page:this.page
+						page: this.page
 					}
 				})
 				this.historydatas = res
 				console.log(this.historydatas)
-				if(res.data.length==0){
+				if (res.data.length == 0) {
 					this.forbidden = true
-				}else{
+				} else {
 					this.forbidden = false
 				}
 			},
@@ -204,7 +207,7 @@
 				}
 				this.$forceUpdate()
 			},
-			pickone(e) {//开始时间
+			pickone(e) { //开始时间
 				this.begintime = +new Date(e.year, e.month - 1, e.day, e.hour, e.minute) / 1000
 				if (this.newtime < this.oldtime) {
 					this.tishiTF = true
@@ -212,7 +215,7 @@
 					this.tishiTF = false
 				}
 			},
-			picktwo(e) {//结束时间
+			picktwo(e) { //结束时间
 				this.end = +new Date(e.year, e.month - 1, e.day, e.hour, e.minute) / 1000
 				if (this.newtime < this.oldtime) {
 					this.tishiTF = true
@@ -226,19 +229,19 @@
 					this.listhistorydata(this.id)
 				}
 			},
-			prev(){//上一页
-				if(this.page>1){
+			prev() { //上一页
+				if (this.page > 1) {
 					this.page--
 					this.listhistorydata(this.id)
 				}
 			},
-			next(){//下一页
+			next() { //下一页
 				this.page++
 				this.listhistorydata(this.id)
 			},
-			clickLeft(){
+			clickLeft() {
 				uni.navigateBack({
-					delta:1
+					delta: 1
 				})
 			}
 		},
@@ -263,7 +266,7 @@
 			font-size: 32rpx;
 			font-weight: 700;
 			position: absolute;
-			top: 70%;
+			top: 0;
 			left: 50%;
 			margin-left: -64rpx;
 		}
@@ -299,6 +302,7 @@
 		width: 100%;
 		box-shadow: 0 0 10rpx #bcb9ca;
 		margin-top: 20rpx;
+
 		.tishi {
 			width: 90%;
 			margin: 0 auto;
@@ -322,6 +326,7 @@
 		.newtimes {
 			width: 100%;
 			padding: 20rpx 20rpx;
+			box-sizing: border-box;
 
 			.newtimes_state,
 			.newtimes_end {
@@ -346,20 +351,22 @@
 			}
 		}
 	}
+
 	.condition {
 		display: flex;
 		flex-wrap: wrap;
 		width: 100%;
 		box-shadow: 0 0 10rpx #bcb9ca;
-		margin:30rpx 0;
-		
+		margin: 30rpx 0;
+
 		.scroll-X {
 			width: 95%;
 			margin: 20rpx auto;
+
 			.tr {
 				display: flex;
 				overflow: hidden;
-	
+
 				.th,
 				.td {
 					display: inline-block;
@@ -370,25 +377,25 @@
 					line-height: 52rpx;
 					border: 2rpx solid #F1F1F1;
 				}
-	
-	// 			.th:last-child,
-	// 			.td:last-child {
-	// 				width: 300rpx;
-	// 			}
-	
-	// 			.th:nth-last-child(2),
-	// 			.th:nth-last-child(3),
-	// 			.td:nth-last-child(2),
-	// 			.td:nth-last-child(3) {
-	// 				width: 200rpx;
-	// 			}
+
+				// 			.th:last-child,
+				// 			.td:last-child {
+				// 				width: 300rpx;
+				// 			}
+
+				// 			.th:nth-last-child(2),
+				// 			.th:nth-last-child(3),
+				// 			.td:nth-last-child(2),
+				// 			.td:nth-last-child(3) {
+				// 				width: 200rpx;
+				// 			}
 			}
 		}
-	
+
 		.pagenumber {
 			display: flex;
 			margin: 20rpx auto;
-	
+
 			button {
 				width: 150rpx;
 				height: 50rpx;
@@ -398,7 +405,7 @@
 				background-color: #17BB89;
 				color: #FFFFFF;
 			}
-	
+
 			.pagenumber_page {
 				width: 150rpx;
 				height: 50rpx;

+ 13 - 6
pages/equipList/index.vue

@@ -3,9 +3,11 @@
 		<view style="position: fixed;z-index: 100;width: 100%;">
 			<uni-nav-bar right-icon="search" title="设备列表" @clickRight="clickRight"></uni-nav-bar>
 		</view>
-		<view class="utabs">
-			<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" item-width="140" font-size="24" gutter="20"
-			 bar-width="60" active-color="#42b983"></u-tabs>
+		<view class="utabs_box">
+			<view class="utabs">
+				<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" item-width="140" font-size="24" gutter="20"
+				 bar-width="60" active-color="#42b983"></u-tabs>
+			</view>
 		</view>
 		<view class="list">
 			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index">
@@ -117,11 +119,16 @@
 	/deep/.uni-icons{
 			font-size: 40rpx !important;
 		}
-	.utabs {
-		width: 95%;
+	.utabs_box{
+		width: 100%;
 		position: fixed;
 		top: 44px;
+		background-color: #FFFFFF;
 		z-index: 100;
+		.utabs {
+			width: 95%;
+			margin: 0 auto;
+		}
 	}
 	.list{
 		width: 100%;
@@ -130,7 +137,7 @@
 		top: 180rpx;
 		margin-bottom: 100rpx;
 		.list_item{
-			width: 95%;
+			width: 90%;
 			margin: 20rpx auto;
 			padding: 10rpx 20rpx;
 			box-sizing: border-box;

+ 3 - 3
pages/expertDiagnosis/particulars.vue

@@ -88,10 +88,10 @@
 				obj.content=this.issuedata
 				if(this.issuedata!=''){
 					this.getDiscuss(obj)
+					uni.navigateTo({
+						url:"particulars?items="+JSON.stringify(this.quizdata)
+					})
 				}
-				uni.navigateTo({
-					url:"particulars?items="+JSON.stringify(this.quizdata)
-				})
 			}
 		},
 		onLoad(option) {

+ 12 - 1
pages/fourBase/allocation.vue

@@ -81,6 +81,7 @@
 					for(let j = 0;j<this.addtype.length;j++){
 						if(this.assignments.children[i].type_name == this.addtype[j]){
 							this.assignments.children[i].check = true
+							console.log(this.assignments.children[i].check)
 						}
 					}
 				}
@@ -89,6 +90,15 @@
 				for (let i = 0; i < this.assignments.children.length; i++) {
 					this.assignments.children[i].check = false
 				}
+				for (let i = 0; i < this.assignments.children.length; i++) {
+					// this.assignments.children[i].check = false
+					for(let j = 0;j<this.addtype.length;j++){
+						if(this.assignments.children[i].type_name == this.addtype[j]){
+							this.assignments.children[i].check = true
+							console.log(this.assignments.children[i].check)
+						}
+					}
+				}
 				for (let key in obj) {
 					for (let i = 0; i < key.length; i++) {
 						for (let j = 0; j < this.assignments.children.length; j++) {
@@ -128,7 +138,8 @@
 			},
 		},
 		onLoad(option) {
-			if(option.type!=''){
+			console.log(option)
+			if(option.type){
 				this.addtype = option.type.split("#")
 				console.log(this.addtype)
 			}

+ 1 - 1
pages/fourBase/modification.vue

@@ -122,7 +122,7 @@
 			},
 			map(){
 				uni.getLocation({
-					type: 'wgs84',
+					type: 'gcj02',
 					success: (res) => {
 						console.log('当前位置的经度:' + res.longitude);
 						console.log('当前位置的纬度:' + res.latitude);

+ 82 - 77
pages/index/index.vue

@@ -15,7 +15,9 @@
 				</view>
 			</view>
 		</view>
-		<kps-image-cutter @ok="onok" @cancel="oncancle" :url="url" :fixed="false" :blob="false" :maxWidth="500" :maxHeight="500"></kps-image-cutter>
+		<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="true" :maxWidth="500" :maxHeight="380" :height="380"></kps-image-cutter>
 	</view>
 </template>
 
@@ -68,35 +70,15 @@
 					}
 				],
 				url: '',
-				res:{},
-				path:'',
-				flag:1
+				path: '',
+				flag: 1,
+				show: false
 			}
 		},
 		onLoad() {
 
 		},
 		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
-			},
-			//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
-					}
-				})
-				this.res = res.data
-			},
 			tabfunction(index) {
 				if (index == 0) {
 					uni.navigateTo({
@@ -104,35 +86,7 @@
 					})
 				} else if (index == 1) {
 					var that = this
-					uni.showModal({
-						content: '拍照识别病虫害',
-						confirmText: "拍病害",
-						cancelText: "拍虫害",
-						success: function(res) {
-							if (res.confirm) {
-								that.flag = 1
-								uni.chooseImage({
-									count: 1, //默认9
-									// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-									sourceType: ['camera'], //从相册选择
-									success: (res) => {
-										that.url = res.tempFilePaths[0]
-									}
-								});
-							} else if (res.cancel) {
-								that.flag = 2
-								uni.chooseImage({
-									count: 1, //默认9
-									// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-									sourceType: ['camera'], //从相册选择
-									success: (res) => {
-										console.log(1)
-										that.url = res.tempFilePaths[0]
-									}
-								});
-							}
-						}
-					});
+					this.show = true
 				} else if (index == 2) {
 					uni.navigateTo({
 						url: "../expertDiagnosis/index"
@@ -152,11 +106,11 @@
 					uni.navigateTo({
 						url: "../prevention/index"
 					})
-				}else if(index==2){
+				} else if (index == 2) {
 					uni.navigateTo({
-						url:"/pages/monitor/index"
+						url: "/pages/monitor/index"
 					})
-				}else if(index==3){
+				} else if (index == 3) {
 					uni.navigateTo({
 						url: "../environment/index"
 					})
@@ -165,35 +119,86 @@
 						url: "../equipMange/index/index"
 					})
 				} else if (index == 5) {
-					console.log(5)
+					uni.showToast({
+					    title: '此功能暂未开放',
+					    duration: 2000,
+						icon:"none"
+					});
 				}
 			},
 			onok(ev) {
-				uni.uploadFile({
-					url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
-					filePath: ev.path,
-					name: 'img_file',
-					formData: {
-						'user': 'test'
-					},
-					success: (uploadFileRes) => {
-						console.log(this.flag)
-						if(this.flag == 1){
-						}else if(this.flag == 2){
-							this.worm(JSON.parse(uploadFileRes.data).data.src)
-						}
-						uni.navigateTo({
-							url:"../disandpests/index?datas="+JSON.stringify(this.res)+"&path="+JSON.parse(uploadFileRes.data).data.src
-						}) 
-						
-					}
+				this.path = this.url
+				console.log(ev)
+				uni.showLoading({
+				    title: '加载中'
 				});
+				if(this.flag == 2){
+					// pest.pests.insect_discern 虫害
+					uni.uploadFile({
+						// url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+						url: 'http://182.92.193.64:8002/api/api_gateway?method=pest.pests.insect_discern', //仅为示例,非真实的接口地址
+						filePath: ev.path,
+						name: 'img_file',
+						formData: {
+							'user': 'test'
+						},
+						success: (uploadFileRes) => {
+							console.log(JSON.parse(uploadFileRes.data))
+							uni.navigateTo({
+								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev.path
+							})
+						}
+					});
+				}else if(this.flag == 1){
+					//pest.pests.insect_discern病害识别
+					uni.showLoading({
+					    title: '加载中'
+					});
+					uni.uploadFile({
+						// url: 'http://182.92.193.64:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
+						url: 'http://182.92.193.64:8002/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
+						filePath: ev.path,
+						name: 'img_file',
+						formData: {
+							'user': 'test'
+						},
+						success: (uploadFileRes) => {
+							console.log(JSON.parse(uploadFileRes.data))
+							uni.navigateTo({
+								url: "../disandpests/index?datas="+uploadFileRes.data + "&path=" + ev.path
+							})
+						}
+					});
+				}
 				this.url = "";
-				
 			},
 			oncancle() {
 				// url设置为空,隐藏控件
 				this.url = ''
+			},
+			confirm() {
+				this.flag = 1
+				uni.chooseImage({
+					count: 1, //默认9
+					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera','album'], //从相册选择
+					success: (res) => {
+						this.url = res.tempFilePaths[0]
+					}
+				});
+				console.log(1)
+			},
+			cancel() {
+				this.flag = 2
+				uni.chooseImage({
+					count: 1, //默认9
+					// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['camera','album'], //从相册选择
+					success: (res) => {
+						console.log(1)
+						this.url = res.tempFilePaths[0]
+					}
+				});
 			}
 		}
 	}
@@ -254,4 +259,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 33 - 20
pages/login/login.vue

@@ -6,19 +6,20 @@
 		<form @submit="formSubmit">
 			<view class="uni-form-item uni-column">
 				<view class="username">
-					<u-icon name="account"  size="36" style="margin-right:30rpx;color: #72CD9C;"></u-icon>
+					<u-icon name="account" size="36" style="margin-right:30rpx;color: #72CD9C;"></u-icon>
 					<!-- <input class="uni-input" name="username" placeholder-class="icon iconfont icon-bianji1" placeholder="请输入用户名" /> -->
-					<u-input class="uni-input" name="username" v-model="formdata.username" placeholder-class="icon iconfont icon-bianji1" placeholder="请输入用户名"/>
+					<u-input class="uni-input" name="username" v-model="formdata.username" placeholder-class="icon iconfont icon-bianji1"
+					 placeholder="请输入用户名" />
 				</view>
 				<view class="passwold">
 					<u-icon name="lock" size="36" style="margin-right:30rpx;color: #72CD9C;"></u-icon>
-					<!-- <input class="uni-input" name="pass" password  placeholder-class="icon iconfont icon-bianji1" placeholder="请输入密码" /> -->
-					<u-input class="uni-input" name="pass" v-model="formdata.passwold" type="password"   placeholder-class="icon iconfont icon-bianji1" placeholder="请输入密码"/>
+					<u-input v-model="formdata.passwold" type="password" :password-icon="true" :clearable="false" placeholder="请输入密码"
+					 @confirm="formSubmit" @input="passwoldddata"/>
 				</view>
 				<view class="aboutpass">
 					<p>忘记密码?</p>
 					<u-checkbox-group>
-						<u-checkbox v-model="checked"  :label-disabled="false" size="22">记住密码</u-checkbox>
+						<u-checkbox v-model="checked" :label-disabled="false" size="22">记住密码</u-checkbox>
 					</u-checkbox-group>
 				</view>
 				<view class="uni-btn-v">
@@ -36,10 +37,10 @@
 	export default {
 		data() {
 			return {
-				checked:false,
-				formdata:{
-					username:'',
-					passwold:''
+				checked: false,
+				formdata: {
+					username: '',
+					passwold: ''
 				}
 			}
 		},
@@ -59,12 +60,15 @@
 				uni.setStorage({
 					key: 'session_key',
 					data: session_key,
-					success: ()=> {
+					success: () => {
 						uni.switchTab({
-							url:"../index/index"
+							url: "../index/index"
 						})
 					}
 				})
+			},
+			passwoldddata(){
+				this.formdata.passwold = this.formdata.passwold.replace(/[\u4E00-\u9FA5]/g,'')
 			}
 		}
 	}
@@ -86,17 +90,19 @@
 
 	.bg {
 		width: 100%;
-		position: absolute;
+		position: fixed;
 		bottom: 0;
 		z-index: -1;
+
 		image {
-			width: 100%; 
+			width: 100%;
 		}
 	}
+	/deep/.u-input__right-icon{
+		line-height: 35px !important;
+	}
 	.uni-form-item {
-		// margin-top: 50rpx;
 		width: 100%;
-
 		.username {
 			width: 80%;
 			margin: 0 auto;
@@ -111,28 +117,35 @@
 			margin: 0 auto;
 			display: flex;
 			margin-bottom: 40rpx;
+			padding-bottom: 10rpx;
+			border-bottom: 2rpx solid #C3C3C3;
 		}
-		.aboutpass{
+
+		.aboutpass {
 			width: 80%;
 			margin: 0 auto;
 			display: flex;
 			justify-content: space-between;
-			p{
+
+			p {
 				color: #C0C0C0;
 				font-size: 28rpx;
 			}
-			/deep/.u-checkbox__label{
+
+			/deep/.u-checkbox__label {
 				font-size: 28rpx;
 				color: #C0C0C0;
 				margin-right: 0;
 			}
 		}
-		.uni-btn-v{
+
+		.uni-btn-v {
 			width: 80%;
 			margin: 112rpx auto 0;
 			position: relative;
 			z-index: 100;
-			button{
+
+			button {
 				width: 100%;
 				height: 72rpx;
 				line-height: 75rpx;

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

@@ -2,7 +2,7 @@
 	<view>
 		<view class="line"></view>
 		<view class="logo-box">
-			<image src="../../../static/logo.png" mode="widthFix"></image>
+			<image src="../../../static/image/c9b4eb88c03b2f7460e8479e80f40fc.png" mode="widthFix"></image>
 			<view class="version">
 				<view>
 					云飞物联网
@@ -90,9 +90,9 @@ page {
 .logo-box{
 	background:#fff;
 	text-align: center;
-	padding:100rpx 0;
+	padding:80rpx 0;
 	image{
-		width:100rpx;
+		width:150rpx;
 	}
 	.version{
 		font-size:24rpx;

+ 6 - 2
pages/prevention/equipmentdetails.vue

@@ -147,6 +147,11 @@
 				// uni.navigateTo({
 				// 	url:"./sim?id="+this.eqinfo.item.d_id
 				// })
+				uni.showToast({
+				    title: '此功能暂未开放',
+				    duration: 2000,
+					icon:"none"
+				});
 			},
 			control(){//设备控制
 				uni.navigateTo({
@@ -157,7 +162,7 @@
 				uni.navigateTo({
 					url:"./ucharts?d_id="+this.eqinfo.item.d_id+"&device_id="+this.eqinfo.item.device_id
 				})
-			}
+			} 
 		},
 		onLoad(option) {
 			this.$forceUpdate()
@@ -211,7 +216,6 @@
 		.control_item {
 			width: 120rpx;
 			height: 120rpx;
-
 			image {
 				width: 70rpx;
 				height: 70rpx;

+ 6 - 0
pages/prevention/ucharts.vue

@@ -129,6 +129,9 @@
 					height: "400rpx"
 				},
 				options: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',
@@ -199,6 +202,9 @@
 					],
 				},
 				optionstwo: {
+					lang:{
+						noData:"暂无数据"
+					},
 					chart: {
 						type: 'spline', //指定图表的类型,默认是折线图(line)
 						zoomType: 'x',

BIN
static/image/10ca93e17420371a82826073c8425c0.png


BIN
static/image/c9b4eb88c03b2f7460e8479e80f40fc.png


BIN
static/image/e1cd85dc59139760f43ddbac15136f2.png