Explorar o código

feat(控制页面): 优化灌溉控制界面显示和功能

- 添加电磁阀不同状态的图标显示
- 调整控制面板布局和样式
- 增加灌溉计时功能显示
- 修复导航路径错误
- 更新API基础URL配置
- 优化灌溉区域状态判断逻辑
allen hai 1 semana
pai
achega
d0637d796e

BIN=BIN
pages/cb/shuifeizsFirst/assets/solenoidValveGray.png


BIN=BIN
pages/cb/shuifeizsFirst/assets/solenoidValveStop.png


+ 20 - 5
pages/cb/shuifeizsFirst/control.vue

@@ -52,10 +52,10 @@
               ></u-switch>
             </view>
           </view>
-          <view v-else>
+          <view v-else style="width:100%">
             <view class="control-list-right-item-icon">
               <image
-                :src="item.sfType == '3' ? stir : solenoidValve"
+                :src="getSrc(item)"
                 class="solenoid-valve"
               />
               <text style="margin-left:6rpx">
@@ -65,7 +65,7 @@
               </text>
             </view>
             <view class="control-list-right-item-actions">
-             状态 
+             <text style="color:#999999">状态 </text>
               <view class="control-list-right-item-actions-status">
                 <view
                   class="status-item"
@@ -95,6 +95,8 @@
 <script>
 import solenoidValve from './assets/solenoidValve.png';
 import stir from './assets/stir.png';
+import solenoidValveGray from './assets/solenoidValveGray.png';
+import solenoidValveStop from './assets/solenoidValveStop.png';
 import borderRadius from './assets/borderRadius.png';
 
 export default {
@@ -104,6 +106,8 @@ export default {
       activeIndex: 0,
       value: false,
       solenoidValve,
+      solenoidValveGray,
+      solenoidValveStop,
       stir,
       borderRadius,
       title: '控制面板',
@@ -121,6 +125,15 @@ export default {
     };
   },
   methods: {
+    getSrc(item){
+      if(item.value == '1'){
+        return this.solenoidValve;
+      }else if(item.value == '0'){
+        return this.solenoidValveStop;
+      }else if(item.value == '2'){
+        return this.solenoidValveGray;
+      }
+    },
     initWebSocket() {
       const url = 'wss://things.ysiot.net:18080/api/ws';
       this.ws = uni.connectSocket({
@@ -447,6 +460,7 @@ uni-page-body {
           display: flex;
           align-items: center;
           margin-top: 22rpx;
+          justify-content: space-between;
           .control-list-right-item-actions-status {
             display: flex;
             align-items: center;
@@ -454,10 +468,11 @@ uni-page-body {
             background: #FFF;
             padding: 6rpx;
             margin-left: 12rpx;
+            height: 50rpx;
             .status-item{
               width: 92rpx;
-              height: 58rrpx;
-              line-height: 58rrpx;
+              height: 50rpx;
+              line-height: 50rpx;
               text-align: center;
               border-radius: 8rpx;
               background: #FFF;

+ 61 - 16
pages/cb/shuifeizsFirst/shuifeizs.vue

@@ -30,10 +30,13 @@
       </view>
       <view class="irrMode__content">
         <view class="irrMode__content-header">
-          <view class="irrMode__content-header-list" v-if="runTitle">
+          <view class="irrMode__content-header-list">
             <view class="irrMode__content-header-title">
-              <image class="header-item-icon" :src="rain" />
-              {{ runTitle }}
+              <view class="irrMode__content-header-container">
+                <image class="header-item-icon" :src="rain" />
+                <text style="color:#333;font-size: 24rpx;margin-left: 10rpx">当前灌溉区域:</text>{{ runTitle }}
+                </view>
+              <view class="timer-text">{{ timer }}分</view>
             </view>
           </view>
           <view class="irrMode__content-item">
@@ -50,13 +53,13 @@
               <view class="item-text">停止</view>
             </view>
           </view>
-        </view>
         <view class="irr-run-list">
           <text v-for="(item, index) in selectAreaList" :key="index">
             {{ item.group_name }}
             <text v-if="index != selectAreaList.length - 1">、</text>
           </text>
         </view>
+        </view>
       </view>
       <Base :dataList="dataList" />
       <facilitystate
@@ -149,7 +152,8 @@ export default {
       workStatus: -1,
       clearIrr: {},
       selectAreaList: [],
-      runTitle: '',
+      runTitle: '--',
+      timer:'--'
     };
   },
   components: {
@@ -186,10 +190,36 @@ export default {
     this.ws.close();
   },
   methods: {
+    isHaveTime(childrenList) {
+      let time = 0;
+      let currentKey = '';
+      let currentItem = {};
+      for (let i = 0; i < this.selectAreaList.length; i++) {
+        for (let key in this.selectAreaList[i]) {
+          if (key.includes(':Status')) {
+            currentKey = key;
+            currentItem = this.selectAreaList[i];
+            break;
+          }
+        }
+        for (let i = 0; i < childrenList.length; i++) {
+          const item = childrenList[i];
+          if (item.sfCode === currentKey) {
+            for (let key in currentItem) {
+              if (key.includes(':PartTim')) {
+                time = currentItem[key];
+              }
+            }
+            break;
+          }
+        }
+      }
+      return time;
+    },
     isAutoRun(childrenList) {
       for (let i = 0; i < childrenList.length; i++) {
         const item = childrenList[i];
-        if (item.value === 1) {
+        if (item.value == 1) {
           return true
         }
       }
@@ -438,15 +468,18 @@ export default {
           }
         }
       });
-      this.runTitle = '';
+      this.runTitle = '--';
+      this.timer = '--';
       if(this.runStatus == '1'){
-      this.irrigatedAreaList.forEach((item) => {
-        if (this.isAutoRun(item.childrenList)) {
-          this.runTitle += item.sfDisplayname;
-        }
-      });
+        this.irrigatedAreaList.forEach((item) => {
+          if (this.isAutoRun(item.childrenList)) {
+            this.runTitle = item.sfDisplayname  || item.sfName;
+            this.timer = this.isHaveTime(item.childrenList);
+          }
+        });
       }else{
-        this.runTitle = '';
+        this.runTitle = '--';
+        this.timer = '--';
       }
     },
     async getdeviceSfStatus() {
@@ -485,10 +518,10 @@ uni-page-body {
 .irrMode{
   margin-top: 30rpx;
   border-radius: 32rpx 32rpx 0 0;
-  background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
   margin-bottom: 30rpx;
   padding: 32rpx;
   border: 3rpx solid #FFF;
+  background: linear-gradient(180deg, #D3F3F2 0%, #FFF 41.06%);
   .irrMode__header{
     display: flex;
     width:320rpx;
@@ -522,7 +555,7 @@ uni-page-body {
   .irrMode__content{
     margin-top: 24rpx;
     border-radius: 16rpx;
-    padding: 16rpx;
+    padding: 2rpx;
     background: linear-gradient(180deg, #FFF 0%, #F5F6FA 100%);
     .irrMode__content-header{
       width: calc(100% - 32rpx);
@@ -543,11 +576,23 @@ uni-page-body {
         font-weight: 500;
         display: flex;
         align-items: center;
-        justify-content: center;
+        justify-content: space-between;
+        width: 100%;
+        .irrMode__content-header-container{
+          display: flex;
+          align-items: center;
+        }
         .header-item-icon{
           width: 48rpx;
           height: 48rpx;
         }
+        .timer-text{
+          color: #0bbc58;
+          text-align: right;
+          font-family: "Source Han Sans CN VF";
+          font-size: 28rpx;
+          font-weight: 400;
+        }
       }
       .irrMode__content-header-desc{
         color: #999999;

+ 2 - 2
pages/equipList/seabox/modification.vue

@@ -109,7 +109,7 @@
 					}
 				})
 				this.moddata = res.data[0] || {};
-				console.log(res)
+				console.log(res,'moddatamoddata')
 				this.selectaddress(this.moddata.lng, this.moddata.lat)
 			},
 			async xyeqlistuser(imei) { //获取设备信息
@@ -136,7 +136,7 @@
 				if(this.quanxian.cityalter){
 					this.selectcityTF = true
 					uni.navigateTo({
-						url: "../fourBase/city"
+						url: "../../fourBase/city"
 					})
 				}else{
 					uni.showToast({

+ 2 - 2
util/api.js

@@ -1,7 +1,7 @@
 // let BASE_URL = 'http://114.55.0.7:8002';
 // const BASE_URL='http://8.136.98.49:8002'
-// let BASE_URL = 'http://218.28.198.186:10505'
-let BASE_URL = 'https://wx.hnyfwlw.com'
+let BASE_URL = 'http://218.28.198.186:10505'
+// let BASE_URL = 'https://wx.hnyfwlw.com'
 // let BASE_URL = 'http://192.168.1.107:8000';
 // let BASE_URL = 'http://218.28.198.186:10508';
 // let BASE_URL = 'https://uat.hnyfwlw.com'