From 35e5bc787aec8d7d52d3d86e137556f672d5dcd2 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期六, 26 十一月 2022 08:46:50 +0800
Subject: [PATCH] #

---
 Monitor-APP/pages/home/home.vue |  193 +++++++++++++++++++++++++++++------------------
 1 files changed, 119 insertions(+), 74 deletions(-)

diff --git a/Monitor-APP/pages/home/home.vue b/Monitor-APP/pages/home/home.vue
index 4677034..e8041d0 100644
--- a/Monitor-APP/pages/home/home.vue
+++ b/Monitor-APP/pages/home/home.vue
@@ -11,7 +11,7 @@
 				<view class="button-left" @click="ejected()"></view>
 				<view class="button-right" @click="ejected()"></view>
 				<!-- 涓昏鍥� -->
-				<view class="main" v-if="aaaaa">
+				<view class="main">
 					<view class="mian-item">
 						<view class="mian-item-box">
 							<y-box>
@@ -195,23 +195,26 @@
 						</view>
 					</view>
 				</view>
-				<!-- 涓讳綋 -->
-				<view class="info-main" v-if="bbbbb">
-					<view class="info-box">
-						<y-box>{{text}}</y-box>
-					</view>
+				
+			</view>
+		</uni-transition>
+		<!-- 鍏ㄦ澘/鎷f枡淇℃伅 -->
+		<uni-transition :duration="duration" :mode-class="infoMode" :show="infoViewShow">
+			<view class="home-view">
+				<view class="head">
+					<text>鍏ㄦ澘 / 鎷f枡</text>
 				</view>
+				<!-- 鏃ュ巻 -->
+				<view class="time-tools">{{calendar}}</view>
+				<view class="button-left" @click="ejected()"></view>
+				<view class="button-right" @click="ejected()"></view>
 				<!-- 涓讳綋 -->
-				<view class="info-main"  v-if="ccccc">
+				<view class="info-main">
 					<view class="info-box">
 						<y-box>{{text}}</y-box>
 					</view>
 				</view>
 			</view>
-		</uni-transition>
-		<!-- 鍏ㄦ澘/鎷f枡淇℃伅 -->
-		<uni-transition :duration="duration" :mode-class="infoMode" :show="infoViewShow">
-			
 		</uni-transition>
 		<!-- 寮傚父淇℃伅 -->
 		<uni-transition :duration="duration" :mode-class="errorInfoMode" :show="errorInfoViewShow">
@@ -226,7 +229,7 @@
 				<!-- 涓讳綋 -->
 				<view class="info-main" >
 					<view class="info-box">
-						<y-box>{{text}}</y-box>
+						<y-box>{{text1}}</y-box>
 					</view>
 				</view>
 			</view>
@@ -323,9 +326,8 @@
 				error: null,
 				infoType: 0,
 				text: '',
-				aaaaa: true,
-				bbbbb: false,
-				ccccc: false,
+				text1: '',
+				
 				
 				
 				
@@ -340,16 +342,15 @@
 		onLoad() {
 			this.getServerData()
 			this.getDate()
-			this.change()
 			setInterval(()=>{
 				this.getDate()
 				this.getInfo()
 				this.getError()
 				this.controller()
 			},1000)
-			// setInterval(()=>{
-			// 	this.controller()
-			// },5000)
+			setInterval(()=>{
+				// this.controller()
+			},2000)
 		},
 		methods: {
 			getUrl() {
@@ -359,87 +360,131 @@
 				this.chartsDataLine1=JSON.parse(JSON.stringify(demodata.Line))
 				this.chartsDataPie2=JSON.parse(JSON.stringify(demodata.PieA))
 			},
-			
 			getInfo() {
 				let that = this
-				var result = ycqdata.dataYYY
-				var	res = result.data
-				if (res.data && res.data !== "") {
-					if (this.infoType == 2 || this.infoType == 3) {
-						return;
+				uni.request({
+					url: "http://192.168.1.111:8088/sxjzwms/system/error",
+					method:"GET",
+					success(result) {
+						var	res = result.data
+						if (res.data && res.data !== "") {
+							if (that.infoType == 2 || that.infoType == 3) {
+								return;
+							}
+							that.infoType = 1
+							that.text = res
+						} else {
+							if (that.infoType == 2 || that.infoType == 3) {
+								return;
+							}
+							that.infoType = 0
+						}
 					}
-					this.infoType = 1
-					this.text = res
-				} else {
-					if (this.infoType == 2 || this.infoType == 3) {
-						return;
-					}
-					this.infoType = 0
-				}
+				})
+				
 			},
 			getError() {
 				let that = this
-				var result = ycqdata.dataEEE
-				var	res = result.data
-				if (res.data && res.data !== "") {
-					if (this.infoType == 1) {
-						this.infoType = 3
-						this.text = res
-						return
+				uni.request({
+					url:"http://192.168.1.111:8088/sxjzwms/mat/info",
+					method:"GET",
+					success(result) {
+						var	res = result.data
+						if (res.data && res.data !== "") {
+							if (that.infoType == 1) {
+								that.infoType = 3
+								that.text1 = res
+								return
+							}
+							that.infoType = 2
+							that.text1 = res
+						} else {
+							if (that.infoType == 1) {
+								return
+							}
+							that.infoType = 0
+						}
 					}
-					this.infoType = 2
-					this.text = res
-				} else {
-					if (this.infoType == 1) {
-						return
-					}
-					this.infoType = 0
-				}
+				})
+				
 			},
 			// 鎺у埗鍣�
 			controller() {
 				switch(this.infoType) {
+					// 鏈変俊鎭� 浣� 娌℃湁閿欒淇℃伅
 					case 1: 
-						this.homeViewShow = false
-						this.homeMode = ['fade', 'slide-bottom']
-						setTimeout(()=>{
-							this.homeViewShow = true
-							this.aaaaa = false
-							this.bbbbb = true
+						if (this.homeViewShow) {
+							this.homeViewShow = false
 							this.homeMode = ['fade', 'slide-bottom']
-						},1000)
+							setTimeout(()=>{
+								this.infoViewShow = true
+								this.infoMode = ['fade', 'slide-bottom']
+							},1000)
+						} else if (this.errorInfoViewShow) {
+							this.errorInfoViewShow = false
+							this.errorInfoMode = ['fade', 'slide-bottom']
+							setTimeout(()=>{
+								this.infoViewShow = true
+								this.infoMode = ['fade', 'slide-bottom']
+							},1000)
+						}
+						
 						return;
+						// 鏈変俊鎭� 涓� 鏈夐敊璇俊鎭�
 					case 2:
-						this.homeViewShow = false
-						this.homeMode = ['fade', 'slide-bottom']
-						setTimeout(()=>{
-							this.aaaaa = false
-							this.ccccc = true
+						if (this.homeViewShow) {
 							this.homeViewShow = false
 							this.homeMode = ['fade', 'slide-bottom']
-						},1000)
+							setTimeout(()=>{
+								this.errorInfoViewShow = true
+								this.errorInfoMode = ['fade', 'slide-bottom']
+							},1000)
+						} else if (this.infoViewShow) {
+							this.infoViewShow = false
+							this.infoMode = ['fade', 'slide-bottom']
+							setTimeout(()=>{
+								this.errorInfoViewShow = true
+								this.errorInfoMode = ['fade', 'slide-bottom']
+							},1000)
+						}
 						return;
+					// 鏈変俊鎭� 涓� 鏈夐敊璇俊鎭�
 					case 3:
-						this.homeViewShow = false
-						this.homeMode = ['fade', 'slide-bottom']
-						setTimeout(()=>{
+						if (this.homeViewShow) {
 							this.homeViewShow = false
 							this.homeMode = ['fade', 'slide-bottom']
-						},1000)
+							setTimeout(()=>{
+								this.errorInfoViewShow = true
+								this.errorInfoMode = ['fade', 'slide-bottom']
+							},1000)
+						} else if (this.infoViewShow) {
+							this.infoViewShow = false
+							this.infoMode = ['fade', 'slide-bottom']
+							setTimeout(()=>{
+								this.errorInfoViewShow = true
+								this.errorInfoMode = ['fade', 'slide-bottom']
+							},1000)
+						}
 						return;
 					default :
-						this.homeViewShow = false
-						this.homeMode = ['fade', 'slide-bottom']
-						setTimeout(()=>{
-							this.homeViewShow = false
-							this.homeMode = ['fade', 'slide-bottom']
-						},1000)
+						if (this.errorInfoViewShow) {
+							this.errorInfoViewShow = false
+							this.errorInfoMode = ['fade', 'slide-bottom']
+							setTimeout(()=>{
+								this.homeViewShow = true
+								this.homeMode = ['fade', 'slide-bottom']
+							},1000)
+						} else if (this.infoViewShow) {
+							this.infoViewShow = false
+							this.infoMode = ['fade', 'slide-bottom']
+							setTimeout(()=>{
+								this.homeViewShow = true
+								this.homeMode = ['fade', 'slide-bottom']
+							},1000)
+						}
 						return;
 				}
 				
-			},
-			change() {
-
 			},
 			// 涓诲睆骞�
 			handle(type) {

--
Gitblit v1.9.1