#
whycq
2022-11-26 35e5bc787aec8d7d52d3d86e137556f672d5dcd2
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>
      <!-- 全板/拣料信息 -->
      <uni-transition :duration="duration" :mode-class="infoMode" :show="infoViewShow">
         <view class="home-view">
            <view class="head">
               <text>全板 / 拣料</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>
      <!-- 全板/拣料信息 -->
      <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) {