Переглянути джерело

feat: 水肥和温室大棚的页面

allen 2 місяців тому
батько
коміт
3703d7cb0b
55 змінених файлів з 5604 додано та 1477 видалено
  1. 66 0
      components/customCard/customCard.vue
  2. 56 49
      main.js
  3. 1265 1176
      pages.json
  4. BIN
      pages/cb/shuifeizs/assets/autoBtn.png
  5. BIN
      pages/cb/shuifeizs/assets/backwashControl.png
  6. BIN
      pages/cb/shuifeizs/assets/basicSetting.png
  7. BIN
      pages/cb/shuifeizs/assets/beijing.png
  8. BIN
      pages/cb/shuifeizs/assets/borderBottomGray.png
  9. BIN
      pages/cb/shuifeizs/assets/borderRadius.png
  10. BIN
      pages/cb/shuifeizs/assets/bucket.png
  11. BIN
      pages/cb/shuifeizs/assets/bucketClose.png
  12. BIN
      pages/cb/shuifeizs/assets/bucketClose1.png
  13. BIN
      pages/cb/shuifeizs/assets/bucketCloseTop.png
  14. BIN
      pages/cb/shuifeizs/assets/bucketOpen.png
  15. BIN
      pages/cb/shuifeizs/assets/bucketOpen1.png
  16. BIN
      pages/cb/shuifeizs/assets/bucketOpenTop.png
  17. BIN
      pages/cb/shuifeizs/assets/controlbg.png
  18. BIN
      pages/cb/shuifeizs/assets/fan.png
  19. BIN
      pages/cb/shuifeizs/assets/fanRun.png
  20. BIN
      pages/cb/shuifeizs/assets/fertTopBottom.png
  21. BIN
      pages/cb/shuifeizs/assets/fertTopBottomRadius.png
  22. BIN
      pages/cb/shuifeizs/assets/fertilizationFormula.png
  23. BIN
      pages/cb/shuifeizs/assets/fertilizationValve.png
  24. BIN
      pages/cb/shuifeizs/assets/lastBorder.png
  25. BIN
      pages/cb/shuifeizs/assets/line.png
  26. BIN
      pages/cb/shuifeizs/assets/lineTopAndBottom.png
  27. BIN
      pages/cb/shuifeizs/assets/lineTopBottom.png
  28. BIN
      pages/cb/shuifeizs/assets/manualControl.png
  29. BIN
      pages/cb/shuifeizs/assets/masterStop.png
  30. BIN
      pages/cb/shuifeizs/assets/operatingRecord.png
  31. BIN
      pages/cb/shuifeizs/assets/rotate.png
  32. BIN
      pages/cb/shuifeizs/assets/solenoidValve.png
  33. BIN
      pages/cb/shuifeizs/assets/stir.png
  34. BIN
      pages/cb/shuifeizs/assets/timing.png
  35. BIN
      pages/cb/shuifeizs/assets/water.png
  36. BIN
      pages/cb/shuifeizs/assets/wheelIrrigation.png
  37. 433 0
      pages/cb/shuifeizs/automation.vue
  38. 72 0
      pages/cb/shuifeizs/components/base.vue
  39. 397 0
      pages/cb/shuifeizs/components/facilitystate.vue
  40. 127 0
      pages/cb/shuifeizs/components/irrigatedArea.vue
  41. 169 0
      pages/cb/shuifeizs/components/rotationBottom.vue
  42. 113 0
      pages/cb/shuifeizs/components/rotationCard.vue
  43. 203 0
      pages/cb/shuifeizs/components/rotationItems.vue
  44. 261 0
      pages/cb/shuifeizs/control.vue
  45. 314 0
      pages/cb/shuifeizs/history.vue
  46. 562 0
      pages/cb/shuifeizs/rotationflow.vue
  47. 258 0
      pages/cb/shuifeizs/shuifeizs.vue
  48. 103 0
      pages/cb/shuifeizs/test.js
  49. 169 0
      pages/cb/wenshizs/components/DeviceCard.vue
  50. 243 0
      pages/cb/wenshizs/components/OperationCard.vue
  51. 127 0
      pages/cb/wenshizs/components/element.vue
  52. 266 0
      pages/cb/wenshizs/wenshizs.vue
  53. 308 180
      pages/equipList/index.vue
  54. BIN
      static/images/cb/controlbg.png
  55. 92 72
      util/api.js

+ 66 - 0
components/customCard/customCard.vue

@@ -0,0 +1,66 @@
+<template>
+  <view class="custom-card">
+    <view class="custom-card-header">
+      <view class="custom-card-action">
+        <u-icon name="arrow-left" color="#333333" size="32rpx" @tap="BackPage"/>
+        <view class="custom-card-action-text">
+          <slot name="backText"></slot>
+        </view>
+      </view>
+      <view class="cu-bar-right">
+        <slot name="right"></slot>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+export default {
+  name: 'custom-card',
+  props: {},
+  data() {
+    return {};
+  },
+  methods: {
+    BackPage() {
+      uni.navigateBack({
+        delta: 1,
+      });
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.custom-card {
+  border-radius: 16upx;
+  opacity: 1;
+  padding-top: 80rpx;
+}
+
+.custom-card-header {
+  padding: 0 20rpx;
+  height: 90rpx;
+  color: #333333;
+  font-size: 28rpx;
+  font-weight: 600;
+  font-family: 'PingFang SC';
+  line-height: 44rpx;
+  position: relative;
+  .custom-card-action {
+    display: flex;
+    align-items: center;
+    height: 90rpx;
+    line-height: 90rpx;
+    .custom-card-action-text {
+      width: 90%;
+      text-align: center;
+      color: #042118;
+      font-size: 34rpx;
+    }
+  }
+  .cu-bar-right {
+    position: absolute;
+    right: 20rpx;
+    top: 20rpx;
+  }
+}
+</style>

+ 56 - 49
main.js

@@ -1,60 +1,67 @@
-import Vue from 'vue'
-import App from './App'
-import uView from "uview-ui"
-Vue.use(uView)
-import {myRequest} from './util/api.js'
-Vue.prototype.$myRequest=myRequest
+import Vue from 'vue';
+import App from './App';
+import uView from 'uview-ui';
+Vue.use(uView);
+import { myRequest } from './util/api.js';
+Vue.prototype.$myRequest = myRequest;
 
+Vue.config.productionTip = false;
 
-Vue.config.productionTip = false
+App.mpType = 'app';
 
-App.mpType = 'app'
-
-Vue.prototype.$imghost = 'http://www.hnyfwlw.com:8006/projectimg' // 线上图片服务器路径常量
+Vue.prototype.$imghost = 'http://www.hnyfwlw.com:8006/projectimg'; // 线上图片服务器路径常量
 // http://www.hnyfwlw.com:8006/bigdata_app/image/10ca93e17420371a82826073c8425c0.png
-Vue.prototype.$appimghost = 'http://www.hnyfwlw.com:8006/bigdata_app'
+Vue.prototype.$appimghost = 'http://www.hnyfwlw.com:8006/bigdata_app';
 
-import {QueryPermission} from './util/QueryPermission.js'
+import { QueryPermission } from './util/QueryPermission.js';
 // Vue.use(QueryPermission)
 Vue.prototype.$QueryPermission = QueryPermission;
 
-Vue.filter('timeFormat',function(time){
-	function fun(a){
-		return	String(a).length==1?'0'+a: a
-	}
-	let date= new Date(time*1000)
-	let y=date.getFullYear()
-	let m=date.getMonth()+1
-	let d=date.getDate()
-	let h=date.getHours()
-	let min=date.getMinutes()
-	let sec=date.getSeconds()
-	return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
-})
+import customCard from './components/customCard/customCard.vue';
+Vue.component('customCard', customCard);
+Vue.filter('timeFormat', function (time) {
+  function fun(a) {
+    return String(a).length == 1 ? '0' + a : a;
+  }
+  let date = new Date(time * 1000);
+  let y = date.getFullYear();
+  let m = date.getMonth() + 1;
+  let d = date.getDate();
+  let h = date.getHours();
+  let min = date.getMinutes();
+  let sec = date.getSeconds();
+  return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`;
+});
 
- Vue.prototype.formatTime = function (thistime,fmt = 'yyyy-MM-dd hh:mm:ss') {
-        let $this = new Date(thistime)
-        let o = {
-          'M+': $this.getMonth() + 1,
-          'd+': $this.getDate(),
-          'h+': $this.getHours(),
-          'm+': $this.getMinutes(),
-          's+': $this.getSeconds(),
-          'q+': Math.floor(($this.getMonth() + 3) / 3),
-          'S': $this.getMilliseconds()
-        }
-        if (/(y+)/.test(fmt)) {
-          fmt = fmt.replace(RegExp.$1, ($this.getFullYear() + '').substr(4 - RegExp.$1.length))
-        }
-        for (var k in o) {
-          if (new RegExp('(' + k + ')').test(fmt)) {
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-          }
-        }
-        return fmt
-      }
+Vue.prototype.formatTime = function (thistime, fmt = 'yyyy-MM-dd hh:mm:ss') {
+  let $this = new Date(thistime);
+  let o = {
+    'M+': $this.getMonth() + 1,
+    'd+': $this.getDate(),
+    'h+': $this.getHours(),
+    'm+': $this.getMinutes(),
+    's+': $this.getSeconds(),
+    'q+': Math.floor(($this.getMonth() + 3) / 3),
+    S: $this.getMilliseconds(),
+  };
+  if (/(y+)/.test(fmt)) {
+    fmt = fmt.replace(
+      RegExp.$1,
+      ($this.getFullYear() + '').substr(4 - RegExp.$1.length)
+    );
+  }
+  for (var k in o) {
+    if (new RegExp('(' + k + ')').test(fmt)) {
+      fmt = fmt.replace(
+        RegExp.$1,
+        RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+      );
+    }
+  }
+  return fmt;
+};
 
 const app = new Vue({
-    ...App
-})
-app.$mount()
+  ...App,
+});
+app.$mount();

Різницю між файлами не показано, бо вона завелика
+ 1265 - 1176
pages.json


BIN
pages/cb/shuifeizs/assets/autoBtn.png


BIN
pages/cb/shuifeizs/assets/backwashControl.png


BIN
pages/cb/shuifeizs/assets/basicSetting.png


BIN
pages/cb/shuifeizs/assets/beijing.png


BIN
pages/cb/shuifeizs/assets/borderBottomGray.png


BIN
pages/cb/shuifeizs/assets/borderRadius.png


BIN
pages/cb/shuifeizs/assets/bucket.png


BIN
pages/cb/shuifeizs/assets/bucketClose.png


BIN
pages/cb/shuifeizs/assets/bucketClose1.png


BIN
pages/cb/shuifeizs/assets/bucketCloseTop.png


BIN
pages/cb/shuifeizs/assets/bucketOpen.png


BIN
pages/cb/shuifeizs/assets/bucketOpen1.png


BIN
pages/cb/shuifeizs/assets/bucketOpenTop.png


BIN
pages/cb/shuifeizs/assets/controlbg.png


BIN
pages/cb/shuifeizs/assets/fan.png


BIN
pages/cb/shuifeizs/assets/fanRun.png


BIN
pages/cb/shuifeizs/assets/fertTopBottom.png


BIN
pages/cb/shuifeizs/assets/fertTopBottomRadius.png


BIN
pages/cb/shuifeizs/assets/fertilizationFormula.png


BIN
pages/cb/shuifeizs/assets/fertilizationValve.png


BIN
pages/cb/shuifeizs/assets/lastBorder.png


BIN
pages/cb/shuifeizs/assets/line.png


BIN
pages/cb/shuifeizs/assets/lineTopAndBottom.png


BIN
pages/cb/shuifeizs/assets/lineTopBottom.png


BIN
pages/cb/shuifeizs/assets/manualControl.png


BIN
pages/cb/shuifeizs/assets/masterStop.png


BIN
pages/cb/shuifeizs/assets/operatingRecord.png


BIN
pages/cb/shuifeizs/assets/rotate.png


BIN
pages/cb/shuifeizs/assets/solenoidValve.png


BIN
pages/cb/shuifeizs/assets/stir.png


BIN
pages/cb/shuifeizs/assets/timing.png


BIN
pages/cb/shuifeizs/assets/water.png


BIN
pages/cb/shuifeizs/assets/wheelIrrigation.png


+ 433 - 0
pages/cb/shuifeizs/automation.vue

@@ -0,0 +1,433 @@
+<template>
+  <view class="automation">
+    <custom-card>
+      <block slot="backText">自动控制</block>
+    </custom-card>
+    <view
+      class="automation-content"
+      :class="{ 'automation-content-rever': activeIndex === 1 }"
+    >
+      <view class="automation-header">
+        <view
+          class="automation-header-item"
+          :class="{ 'automation-header-item-active': activeIndex === 0 }"
+          @click="clickHeaderItem(0)"
+          >灌溉
+          <view
+            :class="
+              activeIndex == '0'
+                ? 'automation-header-item-icon'
+                : 'automation-header-item-icon-bottom'
+            "
+          ></view>
+        </view>
+        <view
+          class="automation-header-item"
+          @click="clickHeaderItem(1)"
+          :class="{ 'automation-header-item-active': activeIndex === 1 }"
+          >水肥
+          <view
+            :class="
+              activeIndex == '1'
+                ? 'automation-header-item-icon'
+                : 'automation-header-item-icon-bottom'
+            "
+          ></view>
+        </view>
+      </view>
+      <view class="automation-body">
+        <rotation-items
+          :formData="formData"
+          :tktype="tktype"
+          @formDataHandler="updateFormData"
+        />
+        <view class="automation-body-title">灌区选择</view>
+        <rotation-bottom
+          :activeIndex="activeIndex"
+          :irrigatedAreaList="irrigatedAreaList"
+          :alreadyList="alreadyList"
+          @updateList="updateListHandler"
+          :tktype="tktype"
+        />
+      </view>
+    </view>
+    <view class="automation-footer">
+      <view class="automation-footer-left">
+        已选<text class="automation-footer-left-num">{{ selectNum }}</text
+        >个灌区
+      </view>
+      <view class="automation-footer-right" @click="immediateExecution"
+        >立即执行</view
+      >
+    </view>
+  </view>
+</template>
+<script>
+import rotationItems from './components/rotationItems.vue';
+import rotationBottom from './components/rotationBottom.vue';
+export default {
+  name: 'automation',
+  data() {
+    return {
+      activeIndex: 0,
+      devBid: '',
+      devName: '',
+      devStatus: '',
+      irrigatedAreaList: [],
+      alreadyList: [],
+      formData: {
+        lgjg: '',
+        fqcx: '',
+        fhcx: '',
+        lgcs: 1,
+      },
+      tktype: 1,
+      selectNum: 0,
+    };
+  },
+  components: {
+    rotationBottom,
+    rotationItems,
+  },
+  watch: {
+    alreadyList: {
+      handler(val) {
+        this.selectNum = 0;
+        val.forEach((item) => {
+          if (item.isChecked) {
+            this.selectNum++;
+          }
+        });
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  onLoad(options) {
+    this.devBid = options.devBid;
+    this.devName = options.devName;
+    this.devStatus = options.devStatus;
+
+    // 检测是否有运行中的任务
+    this.getRunStatus().then((hasRunningTask) => {
+      if (hasRunningTask) {
+        setTimeout(() => {
+          uni.redirectTo({
+            url: `/pages/cb/shuifeizs/rotationflow?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
+          });
+        }, 1000);
+      } else {
+        this.getdeviceSfStatus();
+        this.getAlreadyList();
+      }
+    });
+  },
+  methods: {
+    updateListHandler(list) {
+      this.alreadyList = list;
+    },
+    updateFormData(options) {
+      this.formData[options.key] = options.value;
+    },
+    async getAlreadyList() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/group/already/list/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+
+      console.log(res, '-------------------- get already list');
+      res?.forEach((item) => {
+        item.isChecked = false;
+      });
+      this.alreadyList = res;
+    },
+    async getdeviceSfStatus() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/status/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      this.dataList = [];
+      this.irrigatedAreaList = [];
+      this.alreadyfertilizerBucketList = [];
+
+      console.log('get device sf status', res);
+      res.forEach((item) => {
+        if (item.sfType === '7') {
+          this.irrigatedAreaList.push(item);
+        }
+      });
+    },
+    clickHeaderItem(index) {
+      this.activeIndex = index;
+      this.tktype = index == 0 ? 1 : 2;
+    },
+    // 获取运行状态
+    async getRunStatus() {
+      try {
+        const res = await this.$myRequest({
+          url: '/api/v2/iot/mobile/device/sf/zsrf/task/run/status/',
+          method: 'post',
+          data: {
+            devBid: this.devBid,
+          },
+        });
+        console.log(res, 'resresresres');
+
+        return Promise.resolve(res.status && res.status / 1 === 1);
+      } catch (error) {
+        return Promise.resolve(false);
+      }
+    },
+    // iot/mobile/device/sf/zsrf/task/ctl/
+    async postTaskCtl(payload) {
+      // loading
+      uni.showLoading({
+        title: '正在执行',
+      });
+      console.log(payload, 'payloadpayload');
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/zsrf/task/ctl/',
+        method: 'post',
+        data: payload,
+        header: {
+          'Content-Type': 'application/json',
+        },
+      });
+      uni.hideLoading();
+      console.log(res, 'resresres');
+      if (res?.code === '000000') {
+        uni.showToast({
+          title: '操作成功',
+        });
+        setTimeout(() => {
+          uni.redirectTo({
+            url: `/pages/cb/shuifeizs/rotationflow?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
+          });
+        }, 1000);
+      } else {
+        uni.showToast({
+          icon: 'none',
+          title: res.msg,
+        });
+      }
+    },
+    immediateExecution() {
+      console.log(this.formData, 'formDataformDataformData');
+      if (!this.formData['lgjg']) {
+        uni.showToast({
+          title: '请输入轮灌间隔时间',
+          icon: 'none',
+        });
+        return;
+      }
+      if (this.tktype == 2 && !this.formData['fqcx']) {
+        uni.showToast({
+          title: '请输入肥前水时间',
+          icon: 'none',
+        });
+        return;
+      }
+      if (this.tktype == 2 && !this.formData['fhcx']) {
+        uni.showToast({
+          title: '请输入肥后水时间',
+          icon: 'none',
+        });
+        return;
+      }
+      if (this.tktype == 2 && !this.formData['sfmode']) {
+        uni.showToast({
+          title: '请选择模式',
+          icon: 'none',
+        });
+        return;
+      }
+      if (this.selectNum === 0) {
+        uni.showToast({
+          title: '请选择灌区',
+          icon: 'none',
+        });
+        return;
+      }
+      const fqList = [];
+      for (let i = 0; i < this.alreadyList.length; i++) {
+        const item = this.alreadyList[i];
+        if (item.isChecked && !item.ti) {
+          uni.showToast({
+            title: `请输入${item.sfDisplayname || item.sfName}的时长`,
+            icon: 'none',
+          });
+          return;
+        } else if (item.isChecked && this.tktype == 2 && !item.pfCode) {
+          uni.showToast({
+            title: `请输入${item.sfDisplayname || item.sfName}的配方`,
+            icon: 'none',
+          });
+          return;
+        }
+        if (item.isChecked) {
+          fqList.push({
+            fqCode: item.sfCode,
+            ti: item.ti || '',
+            pfCode: item.pfCode || '',
+          });
+        }
+      }
+      const payload = {
+        devBid: this.devBid,
+        tktype: this.tktype,
+        tkid: 0,
+        status: 1,
+        ...this.formData,
+        fqList,
+        sfmode: this.tktype !== 1 ? this.formData.sfmode || 1 : '',
+      };
+      this.postTaskCtl(payload);
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body,
+uni-page-wrapper {
+  position: relative;
+  height: 100%;
+}
+.automation {
+  background: linear-gradient(180deg, #ffffff00 0%, #fff 23.64%, #fff 100%),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  width: 100%;
+  height: calc(100% - 100rpx);
+  overflow: hidden;
+  .automation-content {
+    border-bottom: none;
+    border-radius: 16rpx 16rpx 0 0;
+    position: relative;
+    overflow: hidden;
+    &::before {
+      position: absolute;
+      content: '';
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/controlbg.png')
+        no-repeat;
+      background-size: cover;
+    }
+  }
+  .automation-content-rever {
+    border-bottom: none;
+    border-radius: 16rpx 16rpx 0 0;
+    position: relative;
+    &::before {
+      position: absolute;
+      content: '';
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/controlbg.png')
+        no-repeat;
+      background-size: cover;
+      transform: rotateY(180deg);
+      transform-origin: center center;
+    }
+  }
+  .automation-header {
+    width: 100%;
+    display: flex;
+    .automation-header-item {
+      width: 50%;
+      height: 80rpx;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      font-size: 36rpx;
+      color: #687a74;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 32rpx;
+      font-weight: 400;
+      position: relative;
+    }
+    .automation-header-item-active {
+      color: #042118;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 32rpx;
+      font-weight: 500;
+      position: relative;
+    }
+    .automation-header-item-icon {
+      width: 28rpx;
+      height: 4rpx;
+      border-radius: 4rpx;
+      background-color: #14a478;
+      position: absolute;
+      bottom: 0;
+    }
+    .automation-header-item-icon-bottom {
+      background-color: transparent;
+    }
+  }
+  .automation-body {
+    height: calc(100vh - 250rpx);
+    overflow: hidden;
+    .automation-body-title {
+      position: relative;
+      color: #042118;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 500;
+      margin: 48rpx 32rpx 16rpx 32rpx;
+    }
+  }
+  .automation-footer {
+    position: fixed;
+    width: 100%;
+    padding: 16rpx 0;
+    background: #fff;
+    box-shadow: 0 -4rpx 8rpx 0 #0000001a;
+    bottom: 0;
+    height: 80rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .automation-footer-left {
+      width: 50%;
+      margin-left: 32rpx;
+      color: #9ba6a3;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+      .automation-footer-left-num {
+        color: #14a478;
+        text-align: center;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 700;
+        margin: 0 8rpx;
+      }
+    }
+    .automation-footer-right {
+      width: 224rpx;
+      border-radius: 16rpx;
+      background-color: #14a478;
+      color: #ffffff;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 32rpx;
+      font-weight: 400;
+      padding: 16rpx 0;
+      margin-right: 32rpx;
+    }
+  }
+}
+</style>

+ 72 - 0
pages/cb/shuifeizs/components/base.vue

@@ -0,0 +1,72 @@
+<template>
+  <view class="base-container" v-if="dataList.length">
+    <view class="base-list">
+      <view class="base-item" v-for="(item, index) in dataList" :key="index">
+        <view class="base-item-value">{{ item.value }}</view>
+        <view class="base-item-label">{{
+          item.sfDisplayname || item.sfName
+        }}</view>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+export default {
+  props: {
+    dataList: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {};
+  },
+};
+</script>
+<style scoped lang="scss">
+.base-container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  width: calc(100% - 64rpx);
+  padding: 16rpx 0;
+  margin: 0 32rpx;
+  justify-content: space-between;
+  border-radius: 16rpx;
+  background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
+  margin-bottom: 30rpx;
+  .base-list {
+    width: calc(100% - 32rpx);
+    padding: 0 16px;
+    display: grid;
+    grid-template-columns: repeat(4, 1fr);
+    .base-item {
+      text-align: center;
+      .base-item-value {
+        width: 150rpx;
+        color: #042118;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 32rpx;
+        font-weight: 500;
+        text-align: center;
+        // 超出隐藏
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+      .base-item-label {
+        width: 150rpx;
+        color: #687a74;
+        font-family: 'Source Han Sans CN VF';
+        text-align: center;
+        font-size: 28rpx;
+        font-weight: 400;
+        // 超出隐藏
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    }
+  }
+}
+</style>

+ 397 - 0
pages/cb/shuifeizs/components/facilitystate.vue

@@ -0,0 +1,397 @@
+<template>
+  <view class="facilitystate-container">
+    <view class="facilitystate-title-warp">
+      <view class="facilitystate-title">
+        <view class="radius-user"></view>使用中
+      </view>
+      <view class="facilitystate-subtitle">
+        <view class="radius-close"></view>
+      已关闭</view>
+    </view>
+    <view class="facilitystate-list">
+      <image :src="ggbCurrent.value == 1?bucketOpenTop:bucketCloseTop" class="bucketOpenTop" />
+      <image :src="sfbCurrent.value == 1?bucketOpenTop:bucketCloseTop" class="bucketOpenTop2"/>
+      <view class="facilitystate-list__left-label">
+        <view class="facilitystate-item__left-label-text" style="margin-bottom: 2rpx;">瞬时 L/min :</view>
+        <view class="facilitystate-item__left-label-text">累计L:</view>
+      </view>
+      <view class="facilitystate-list__left">
+        <view
+          class="facilitystate-item"
+          :style="{width:100/(alreadyfertilizerBucketList.length)+'%'}"
+          :class="index == alreadyfertilizerBucketList.length - 1?'facilitystate-item--last':''"
+          v-for="(item, index) in alreadyfertilizerBucketList"
+          :key="index"
+        >
+          <view class="facilitystate-item__label">
+            <view class="facilitystate-item__label-text">{{getTopDeviceName(item.childrenList)}}</view>
+            <view class="facilitystate-item__label-value">{{getBottomDeviceName(item.childrenList)}}</view>
+          </view>
+          <view class="facilitystate-item__image">
+            <image :src="getJSCurrentValue(item.childrenList)?bucketOpen:bucketClose" class="bucketClose"/>
+            <view  v-if="index == alreadyfertilizerBucketList.length - 1? false:true">
+              <image :src="lineTopBottom" class="facilitystate-item__bg"/>
+              <image :src="lineTopAndBottom" class="facilitystate-item__line"/>
+            </view>
+            <view  v-else>
+              <image :src="lineTopBottom" class="facilitystate-item__bg2"/>
+              <image :src="lastBorder" class="facilitystate-item__line2"/>
+            </view>
+            <view class="facilitystate-item-fan">
+              <view class="fertTopBottom">
+              <text class="fertTopBottom-text">{{item.sfDisplayname || item.sfName}}</text>
+              <image :src="getJBCurrentValue(item.childrenList)? fanRun : fan" class="fan" :class="{'fan-run': getJBCurrentValue(item.childrenList)}" />
+              </view>
+            </view>
+            <image :src="getXSCurrentValue(item.childrenList)?bucketOpen:bucketClose" class="bucketClose1" />
+          </view>
+        </view>
+      </view>
+      </view>
+      <irrigatedArea :irrigatedAreaList="irrigatedAreaList"/>
+    </view>
+  </view>
+</template>
+<script>
+import fertTopBottom from '../assets/fertTopBottom.png';
+import lineTopAndBottom from '../assets/lineTopAndBottom.png';
+import lineTopBottom from '../assets/lineTopBottom.png';
+import fertTopBottomRadius from '../assets/fertTopBottomRadius.png';
+import lastBorder from '../assets/lastBorder.png';
+import irrigatedArea from './irrigatedArea.vue';
+import fan from '../assets/fan.png';
+import fanRun from '../assets/fanRun.png';
+import bucketOpenTop from '../assets/bucketOpenTop.png';
+import bucketCloseTop from '../assets/bucketCloseTop.png';
+import bucketClose from '../assets/bucketClose.png';
+import bucketOpen from '../assets/bucketOpen.png';
+
+export default {
+  props:{
+    irrigatedAreaList:{
+      type:Array,
+      default:()=>[]
+    },
+    alreadyfertilizerBucketList:{
+      type:Array,
+      default:()=>[]
+    },
+    ggbCurrent:{
+      type:Object,
+      default:()=>{}
+    },
+    sfbCurrent:{
+      type:Object,
+      default:()=>{}
+    }
+  },
+  components:{
+    irrigatedArea
+  },
+  data() {
+    return {
+      fan,
+      fanRun,
+      lastBorder,
+      lineTopBottom,
+      fertTopBottom,
+      lineTopAndBottom,
+      bucketOpenTop,
+      bucketOpenTopStatus:false,
+      bucketOpenTopStatus2:false,
+      bucketCloseTop,
+      bucketClose,
+      bucketOpen,
+      fertTopBottomRadius,
+    };
+  },
+  methods:{
+    getTopDeviceName(list){
+      let current = {}
+      list?.forEach(item =>{
+        if(item.sfType === '6'){
+          const name = item.sfDisplayname || item.sfName;
+          if(name.indexOf('瞬时') != -1){
+            current = item
+          }
+        }
+      })
+      return current?.value || '0'
+    },
+    getBottomDeviceName(list){
+      let current = {}
+      list?.forEach(item =>{
+        if(item.sfType === '6'){
+          const name = item.sfDisplayname || item.sfName;
+         if(name.indexOf('累计') != -1){
+            current = item
+          }
+        }
+      })
+      return current?.value || '0'
+    },
+    getJSCurrentValue(list){
+      // 进水阀
+      let current = {};
+      list?.forEach(item =>{
+        if(item.sfType === '8'){
+          const name = item.sfCode;
+          current = item;
+        }
+      })
+      return current?.value == 1
+    },
+    getJBCurrentValue(list){
+      // 搅拌机
+      let current = {};
+      list?.forEach(item =>{
+        if(item.sfType === '3'){
+          const name = item.sfCode;
+            current = item
+        }
+      })
+      return current?.value == 1
+    },
+    getXSCurrentValue(list){
+      // 吸水泵
+      let current = {};
+      list?.forEach(item =>{
+        if(item.sfType === '2'){
+          const name = item.sfCode;
+            current = item
+        }
+      })
+      return current?.value == 1
+    },
+    handleClick(item){
+      item.fan = !item.fan;
+    },
+    handleOpenClick(){
+      this.bucketOpenTopStatus = !this.bucketOpenTopStatus;
+    },
+    handleOpenClick1(){
+      this.bucketOpenTopStatus2 = !this.bucketOpenTopStatus2;
+    },
+    handleBucketCloseClick(item){
+      item.isTopStatus = !item.isTopStatus;
+    },
+    handleBucketCloseClick1(item){
+      item.isBottomStatus = !item.isBottomStatus;
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+.facilitystate-container {
+  padding: 16rpx 32rpx;
+  justify-content: space-between;
+  border-radius: 16rpx;
+  position: relative;
+  .facilitystate-title-warp{
+    position: absolute;
+    right: 32rpx;
+    top: 10rpx;
+    display: flex;
+    align-items: center;
+    color: #374d59;
+    font-family: "Source Han Sans CN VF";
+    font-size: 24rpx;
+    font-weight: 400;
+    .facilitystate-title{
+      display: flex;
+      align-items: center;
+      margin-right: 32rpx;
+      .radius-user{
+        width: 16rpx;
+        height: 16rpx;
+        border-radius: 50%;
+        background: #14A478;
+        margin-right:8rpx;
+      }
+    }
+    .facilitystate-subtitle{
+      display: flex;
+      align-items: center;
+      .radius-close{
+        width: 16rpx;
+        height: 16rpx;
+        border-radius: 50%;
+        background: #7A8291;
+        margin-right:8rpx;
+      }
+    }
+  }
+  .facilitystate-list {
+    background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/beijing.png') no-repeat;
+    background-size: 100%;
+    height: 376rpx;
+    width: 690rpx;
+    display: flex;
+    margin-bottom: 16rpx;
+    position: relative;
+    &__left-label{
+      align-self: stretch;
+      color: #687a74;
+      text-align: right;
+      font-family: "Source Han Sans CN VF";
+      font-size: 24rpx;
+      font-weight: 400;
+      position: absolute;
+      left: 30rpx;
+      top: 120rpx;
+    }
+    .bucketOpenTop{
+      width: 20rpx;
+      height: 20rpx;
+      position: absolute;
+      left: 120rpx;
+      top: 328rpx;
+    }
+    .bucketOpenTop2{
+      width: 20rpx;
+      height: 20rpx;
+      position: absolute;
+      left: 200rpx;
+      top: 72rpx;
+    }
+    &__left{
+      height: 100%;
+      display: flex;
+      margin-left: 160rpx;
+      justify-content: space-between;
+      width: 100%;
+    }
+    .facilitystate-item {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+      height: 228rpx;
+      margin-top: 112rpx;
+      &__label{
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        width: 100%;
+        text-align: center;
+        margin-bottom: 5rpx;
+      }
+      &__label-text,&__label-value {
+        color: #042118;
+        font-family: "Source Han Sans CN VF";
+        font-size: 24rpx;
+        font-weight: 400;
+        height: 36rpx;
+        width:90%;
+        margin: 0 auto;
+        // 超出隐藏
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+      &__image {
+        width: 100%;
+        height: 140rpx;
+
+        position: relative;
+        .facilitystate-item-fan{
+          position: absolute;
+          top: 20rpx;
+          left:0;
+          bottom:0;
+          right:0;
+          margin: auto;
+          z-index:100;
+        }
+        .bucketClose{
+          position: absolute;
+          width: 20rpx;
+          height: 20rpx;
+          left: 50%;
+          transform: translateX(-25%);
+          top: 6rpx;
+          z-index:100;
+        }
+        .bucketClose1{
+          position: absolute;
+          width: 20rpx;
+          height: 20rpx;
+          left: 50%;
+          transform: translateX(-25%);
+          bottom: -6rpx;
+          z-index:100;
+        }
+      }
+      &__bg{
+        width: 100%;
+        height: 153rpx;
+        top: 0rpx;
+      }
+      &__line{
+        position: absolute;
+        width: 8rpx;
+        height: 152rpx;
+        left: 50%;
+        top: 0;
+        transform: translateX(-50%);
+      }
+      &__bg2{
+        width: 50%;
+        height: 153rpx;
+        left: -4rpx;
+      }
+      &__line2{
+        position: absolute;
+        width: 16rpx;
+        height: 153rpx;
+        top: -1rpx;
+        margin-left: -6rpx;
+        transform: translateX(-50%);
+      }
+      .fertTopBottom{
+        width: 70rpx;
+        height: 94rpx;
+        margin: 0 auto;
+        margin-top: 12rpx;
+        background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/bucket.png')  no-repeat center center;
+        background-size: 100% 100%;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        .fertTopBottom-text{
+          width: 70rpx;
+          font-size: 24rpx;
+          color: #FFB800;
+          text-align: center;
+          // 超出隐藏
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+        .fan{
+          width: 40rpx;
+          height:40rpx;
+          margin-left: 10rpx;
+        }
+        .fan-run{
+          animation: rotate .5s linear infinite;
+          @keyframes rotate {
+            from {
+              transform: rotate(0deg);
+            }
+            to {
+              transform: rotate(360deg);
+            }
+          }
+        }
+      }
+    }
+    .facilitystate-item--last{
+      width: 100rpx;
+      display: flex;
+    }
+  }
+}
+</style>

+ 127 - 0
pages/cb/shuifeizs/components/irrigatedArea.vue

@@ -0,0 +1,127 @@
+<template>
+  <view class="irrigated-area">
+    <view class="irrigated-area-list">
+      <view
+        class="irrigated-area-item"
+        v-for="(item, index) in irrigatedAreaList"
+        :key="index"
+      >
+        <view class="irrigated-area-item-title">
+          <view class="irrigated-area-item-title-text">{{
+            item.sfDisplayname || item.sfName
+          }}</view>
+          <view class="irrigated-area-item-title-time"></view>
+        </view>
+        <view class="irrigated-area-item-content">
+          <view
+            class="irrigated-area-item-content-item"
+            v-for="(i, n) in item.childrenList"
+            :key="n"
+          >
+            <view class="irrigated-area-item-content-item-title">{{
+              i.sfDisplayname || i.sfName || '暂无数据'
+            }}</view>
+            <view class="irrigated-area-item-content-item-icon">
+              <image
+                :src="i.value !== '0' ? bucketOpen1 : bucketClose1"
+                class="bucket-icon"
+              />
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+import bucketOpen1 from '../assets/bucketOpen1.png';
+import bucketClose1 from '../assets/bucketClose1.png';
+export default {
+  props: {
+    irrigatedAreaList: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      bucketOpen1,
+      bucketClose1,
+    };
+  },
+  methods: {
+    formartDate(date) {
+      return date.slice(0, 10);
+    },
+  },
+  components: {},
+  mounted() {},
+};
+</script>
+<style scoped lang="scss">
+.irrigated-area {
+  .irrigated-area-list {
+    .irrigated-area-item {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 10px;
+      background: #f5f7fa;
+      margin-bottom: 8rpx;
+      .irrigated-area-item-title {
+        width: 120rpx;
+        .irrigated-area-item-title-text {
+          color: #042118;
+          text-align: left;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 24rpx;
+          font-weight: 500;
+          // 超出隐藏
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+        .irrigated-area-item-title-time {
+          color: #14a478;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 24rpx;
+          font-weight: 500;
+          text-align: left;
+          margin-top: 8rpx;
+          height: 30rpx;
+        }
+      }
+      .irrigated-area-item-content {
+        display: flex;
+        width: calc(100% - 120rpx);
+        justify-content: start;
+        .irrigated-area-item-content-item {
+          width: 20%;
+          .irrigated-area-item-content-item-title {
+            width: 100%;
+            color: #333333;
+            font-family: 'Source Han Sans CN VF';
+            font-size: 24rpx;
+            font-weight: 400;
+            margin-bottom: 20rpx;
+            // 超出隐藏
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            text-align: center;
+          }
+          .irrigated-area-item-content-item-icon {
+            display: flex;
+            justify-content: center;
+            .bucket-icon {
+              width: 24rpx;
+              height: 24rpx;
+              margin-right: 10rpx;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 169 - 0
pages/cb/shuifeizs/components/rotationBottom.vue

@@ -0,0 +1,169 @@
+<template>
+  <view
+    class="rotation-wraper"
+    :style="{
+      height:
+        tktype == 1
+          ? `calc(100% - 256rpx - 168rpx)`
+          : `calc(100% - 256rpx - 440rpx)`,
+    }"
+  >
+    <view class="rotation-wraper-left">
+      <view
+        class="rotation-wraper-left__item"
+        v-for="(item, index) in listData"
+        :key="item.sfBid"
+        @click="clickHandler(item, index)"
+        :class="{ active: index === currentIndex }"
+        >{{ item.sfDisplayname || item.sfName }}
+        <image
+          :src="borderBottomGray"
+          class="border-bottom-gray"
+          v-if="index === currentIndex"
+        />
+      </view>
+    </view>
+    <view class="rotation-wraper-right">
+      <scroll-view
+        scroll-y="true"
+        enable-flex="true"
+        scroll-with-animation
+        class="server-page__list-scroll"
+        :scroll-into-view="activeMenuId"
+      >
+        <rotationCard
+          v-for="item in listData"
+          :item="item"
+          :tktype="tktype"
+          :key="item.sfBid"
+          @actionChecked="actionCheckedHandler"
+          @changeTi="changeTiHandler"
+          :id="'tab' + item.sfBid"
+        />
+      </scroll-view>
+    </view>
+  </view>
+</template>
+<script>
+import rotationCard from './rotationCard.vue';
+import borderBottomGray from '../assets/borderBottomGray.png';
+export default {
+  name: 'rotationBottom',
+  props: {
+    alreadyList: {
+      type: Array,
+      default: () => [],
+    },
+    tktype: {
+      type: Number,
+      default: 1,
+    },
+    activeIndex: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      listData: [],
+      borderBottomGray,
+      currentIndex: 0,
+      currentItem: {},
+      activeMenuId: '',
+    };
+  },
+  watch: {
+    activeIndex() {
+      this.currentIndex = 0;
+      const firstItem = this.alreadyList[0];
+      this.activeMenuId = `tab${firstItem?.sfBid}`;
+    },
+    alreadyList(value) {
+      this.listData = value;
+    },
+  },
+  components: {
+    rotationCard,
+  },
+  methods: {
+    changeTiHandler(item) {
+      const index = this.getItemBySfBid(item.sfBid);
+      this.$set(this.listData, index, {
+        ...item,
+        ti: item.ti,
+      });
+      this.$emit('updateList', this.listData);
+    },
+    // 通过sfBid查到某个item的index
+    getItemBySfBid(sfBid) {
+      return this.listData.findIndex((item) => item.sfBid === sfBid);
+    },
+    actionCheckedHandler(item) {
+      const index = this.getItemBySfBid(item.sfBid);
+      this.$set(this.listData, index, {
+        ...item,
+        isChecked: !item.isChecked,
+      });
+      this.$emit('updateList', this.listData);
+    },
+
+    clickHandler(item, index) {
+      this.currentItem = item;
+      this.currentIndex = index;
+      this.activeMenuId = `tab${item.sfBid}`;
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.server-page__list-scroll {
+  height: 100%;
+  overflow: hidden;
+}
+.rotation-wraper {
+  display: flex;
+  justify-content: space-between;
+  position: relative;
+  height: calc(100% - 256rpx - 168rpx);
+  padding-bottom: 128rpx;
+  overflow-y: hidden;
+  .rotation-wraper-left {
+    width: 240rpx;
+    border-radius: 16rpx;
+    background-color: #ffffff;
+    height: 100%;
+    background: #ffffff;
+    overflow-y: auto;
+    padding-top: 12rpx;
+    &__item {
+      height: 96rpx;
+      line-height: 96rpx;
+      padding: 0 32rpx;
+      color: #364d46;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+      position: relative;
+      .border-bottom-gray {
+        position: absolute;
+        width: 40rpx;
+        height: 40rpx;
+        bottom: -30rpx;
+        right: 0;
+      }
+    }
+  }
+  .active {
+    background: #f5f6fa;
+    color: #14a478;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    font-weight: 700;
+  }
+  .rotation-wraper-right {
+    width: calc(100% - 240rpx - 64rpx);
+    margin-right: 32rpx;
+    overflow-y: scroll;
+  }
+}
+</style>

+ 113 - 0
pages/cb/shuifeizs/components/rotationCard.vue

@@ -0,0 +1,113 @@
+<template>
+  <view class="rotation-card" @click="actionChecked">
+    <view class="rotation-card__header">
+      {{ item.sfDisplayname || item.sfName }}
+      <u-icon
+        name="checkmark-circle-fill"
+        :color="item.isChecked ? '#14A478' : '#C9CDD4'"
+        size="30rpx"
+      ></u-icon>
+    </view>
+    <view class="rotation-card__content" v-if="tktype === 2">
+      <view class="rotation-card__content-left">配方</view>
+      <view class="rotation-card__content-right">
+        <u-input
+          maxlength="36"
+          v-model="item.pfCode"
+          placeholder="请输入配方"
+          :border="false"
+          input-align="right"
+        />
+      </view>
+    </view>
+    <view class="rotation-card__footer">
+      <view class="rotation-card__footer-left">时长(分钟)</view>
+      <view class="rotation-card__footer-right">
+        <u-input
+          type="number"
+          maxlength="6"
+          :max="999999"
+          :value="item.ti"
+          @input="changeTi"
+          v-model="item.ti"
+          placeholder="请输入时长"
+          :border="false"
+          input-align="right"
+        /> </view
+    ></view>
+  </view>
+</template>
+<script>
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => {},
+    },
+    tktype: {
+      type: Number,
+      default: 1,
+    },
+  },
+  data() {
+    return {
+      value: '',
+      action: true,
+    };
+  },
+  methods: {
+    actionChecked() {
+      this.$emit('actionChecked', this.item);
+    },
+    changeTi(value) {
+      this.$emit('changeTi', this.item);
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.rotation-card {
+  border-radius: 16rpx;
+  background-color: #fff;
+  margin-bottom: 22rpx;
+  &__header {
+    height: 64rpx;
+    line-height: 64rpx;
+    border-bottom: 2rpx solid #e4e7ed;
+    color: #333333;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    font-weight: 500;
+    padding-left: 32rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 32rpx;
+  }
+  &__content {
+    display: flex;
+    justify-content: space-between;
+    padding: 20rpx 30rpx;
+    height: 40rpx;
+  }
+  &__content-left {
+    width: 250rpx;
+    font-size: 28rpx;
+  }
+  &__content-right {
+  }
+  &__footer {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 20rpx 30rpx;
+    height: 40rpx;
+  }
+  &__footer-left {
+    width: 250rpx;
+    font-size: 28rpx;
+  }
+  &__footer-right {
+  }
+}
+</style>

+ 203 - 0
pages/cb/shuifeizs/components/rotationItems.vue

@@ -0,0 +1,203 @@
+<template>
+  <view
+    class="rotation-wrapper"
+    :style="{ height: tktype === 1 ? '176rpx' : '450rpx' }"
+  >
+    <view class="rotation-item" v-for="(item, index) in list" :key="index">
+      <view class="rotation-item__label">{{ item.label }}</view>
+      <view class="rotation-item__value">
+        <u-number-box
+          v-model="item.value"
+          :min="1"
+          :max="9999"
+          maxlength="4"
+          @change="() => valChange(item)"
+          v-if="item.isNumber"
+        ></u-number-box>
+        <view class="rotation-item__value__input">
+          <u-input
+            v-model="item.value"
+            type="number"
+            maxlength="6"
+            :max="999999"
+            input-align="right"
+            @blur="valChange(item)"
+            v-if="!item.isNumber && !item.isSelect"
+          />
+          <text
+            style="margin-left: 16rpx; width: 80rpx"
+            v-if="!item.isNumber && !item.isSelect"
+            >分钟</text
+          >
+        </view>
+        <view
+          v-if="!item.isNumber && item.isSelect"
+          class="rotation-item__value__select"
+          @click="show = true"
+        >
+          <text
+            style="color: #9ba6a3; margin-right: 16rpx"
+            :style="{ color: formData.sfmode ? '#666' : '#9ba6a3' }"
+            >{{ selectText }}</text
+          >
+          <u-icon name="arrow-right" color="#4E5969" size="24rpx"></u-icon>
+        </view>
+      </view>
+    </view>
+    <u-action-sheet
+      :list="actionSheetList"
+      v-model="show"
+      @click="actionSheetCallback"
+    ></u-action-sheet>
+  </view>
+</template>
+<script>
+export default {
+  name: 'rotationItem',
+  props: {
+    formData: {
+      type: Object,
+      default: () => {},
+    },
+    tktype: {
+      type: Number,
+      default: 1,
+    },
+  },
+  watch: {
+    tktype: {
+      handler(val) {
+        if (val !== 1) {
+          this.list = [
+            {
+              label: '轮灌次数',
+              isNumber: true,
+              value: this.formData['lgcs'] || 1,
+              key: 'lgcs',
+            },
+            {
+              label: '轮灌间隔',
+              isNumber: false,
+              value: this.formData['lgjg'] || '',
+              key: 'lgjg',
+            },
+            {
+              label: '肥前水',
+              isNumber: false,
+              value: this.formData['fqcx'] || '',
+              key: 'fqcx',
+            },
+            {
+              label: '肥后水',
+              isNumber: false,
+              value: this.formData['fhcx'] || '',
+              key: 'fhcx',
+            },
+            {
+              label: '模式选择',
+              isNumber: false,
+              value: this.formData['sfmode'] || '',
+              key: 'sfmode',
+              isSelect: true,
+            },
+          ];
+        } else {
+          this.list = [
+            {
+              label: '轮灌次数',
+              isNumber: true,
+              value: this.formData['lgcs'] || 1,
+              key: 'lgcs',
+            },
+            {
+              label: '轮灌间隔',
+              isNumber: false,
+              value: this.formData['lgjg'] || '',
+              key: 'lgjg',
+            },
+          ];
+        }
+      },
+      deep: true,
+      immediate: true,
+    },
+    formData: {
+      handler(val) {},
+      deep: true,
+      immediate: true,
+    },
+  },
+  data() {
+    return {
+      list: [],
+      selectText: '请选择',
+      show: false,
+      actionSheetList: [
+        {
+          text: '定时',
+          id: 1,
+        },
+        {
+          text: '定量',
+          id: 2,
+        },
+        {
+          text: 'EC调配',
+          id: 3,
+        },
+        {
+          text: '混肥比例',
+          id: 4,
+        },
+      ],
+    };
+  },
+  methods: {
+    valChange(item) {
+      this.formData[item.key] = item.value;
+      this.$emit('formDataHandler', { key: [item.key], value: item.value });
+    },
+    actionSheetCallback(index) {
+      this.formData['sfmode'] = this.actionSheetList[index].id;
+      this.selectText = this.actionSheetList[index].text;
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.rotation-wrapper {
+  height: 450rpx;
+  border-radius: 16rpx;
+  background-color: #ffffff;
+  position: relative;
+  width: calc(100% - 64rpx);
+  margin: 0 32rpx;
+  margin-top: 32rpx;
+  .rotation-item {
+    height: 88rpx;
+    width: calc(100% - 32rpx);
+    margin: 0 32rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-bottom: 4rpx solid #f0f0f0;
+    .rotation-item__label {
+      width: 50%;
+      text-align: left;
+      color: #042118;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    .rotation-item__value {
+      width: 50%;
+      text-align: right;
+      padding-right: 16rpx;
+      .rotation-item__value__input {
+        display: flex;
+        align-items: center;
+      }
+    }
+  }
+}
+</style>

+ 261 - 0
pages/cb/shuifeizs/control.vue

@@ -0,0 +1,261 @@
+<template>
+  <view class="control-container">
+    <custom-card>
+      <block slot="backText">{{ title }}</block>
+    </custom-card>
+    <view class="control-content" v-if="leftList.length > 0">
+      <view class="control-list-left">
+        <view
+          class="control-list-left-item"
+          v-for="(item, index) in leftList"
+          :key="index"
+          @click="controlClick(index)"
+          :class="{ 'control-list-left-item-active': index === activeIndex }"
+        >
+          <image
+            :src="borderRadius"
+            class="borderTopRadius"
+            v-if="index === activeIndex"
+          />
+          {{ item.sfDisplayname }}
+          <image
+            :src="borderRadius"
+            class="borderBottomRadius"
+            v-if="index === activeIndex"
+          />
+        </view>
+      </view>
+      <view class="control-list-right">
+        <view
+          class="control-list-right-item"
+          v-for="(item, index) in deviceList"
+          :key="index"
+        >
+          <view class="control-list-right-item-icon">
+            <image
+              :src="item.sfType == '3' ? stir : solenoidValve"
+              class="solenoid-valve"
+            />
+          </view>
+          <view class="control-list-right-item-title">{{
+            item.sfDisplayname || item.sfName
+          }}</view>
+          <view class="control-list-right-item-action">
+            <u-switch
+              :value="item.value == 1 ? true : false"
+              @change="changeSwitch(item)"
+              activeColor="#14A478"
+              size="40"
+              inactiveColor="rgb(230, 230, 230)"
+            ></u-switch>
+          </view>
+        </view>
+        <u-empty v-if="deviceList.length === 0" text="暂无数据"></u-empty>
+      </view>
+    </view>
+    <u-empty v-else text="暂无数据"></u-empty>
+  </view>
+</template>
+<script>
+import solenoidValve from './assets/solenoidValve.png';
+import stir from './assets/stir.png';
+import borderRadius from './assets/borderRadius.png';
+
+export default {
+  name: 'control',
+  data() {
+    return {
+      activeIndex: 0,
+      value: false,
+      solenoidValve,
+      stir,
+      borderRadius,
+      title: '控制面板',
+      leftList: [],
+      deviceList: [],
+      devBid: '',
+    };
+  },
+  methods: {
+    getChecked(item) {
+      return item.value == 1 ? true : false;
+    },
+    async changeSwitch(item) {
+      item.value = item.value == 1 ? 0 : 1;
+      const sfCode = item.sfCode;
+      const params = {};
+      params[sfCode] = item.value;
+      const payload = {
+        data: params,
+      };
+      const data = {
+        devBid: this.devBid,
+        data: params,
+      };
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/devctl/',
+        method: 'post',
+        data,
+        header: {
+          'Content-Type': 'application/json',
+        },
+      });
+      if (res.code !== '000000') {
+        item.value = item.value == 1 ? 0 : 1;
+      }
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      });
+    },
+    controlClick(index) {
+      this.activeIndex = index;
+      this.deviceList = this.leftList[this.activeIndex]?.childrenList || [];
+    },
+    /*
+      0	水源	泵类	负责水源进入管道的总泵或者阀
+      1	肥料	泵类	负责肥料进入管道的总阀或者泵
+      2	吸肥	泵类	控制肥料桶出肥的阀或者泵,每个肥料桶一个
+      3	搅拌	泵类	肥料桶的搅拌电机或者泵 每个肥料桶一个
+      4	肥料桶	泵类	肥料桶,每个施肥机有多个或者没有,不一定真实存在,只是逻辑上的概念
+      5	电磁阀	无	管道最末端每个田地里控制出水的阀门
+      6	传感器	无	水肥机上的 温度,压力,流速,PH EC等监测类要素
+      7	灌区    无	逻辑区域,电磁阀的分组
+      */
+    async getdeviceSfStatus() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/status/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      this.deviceList = [];
+      const sfCurrent = [
+        {
+          sfDisplayname: '水肥机',
+          childrenList: [],
+        },
+      ];
+      const irrigatedAreaList = [];
+      res?.forEach((item) => {
+        if (item.sfType === '0' || item.sfType === '1' || item.sfType === '2') {
+          sfCurrent[0].childrenList.push(item);
+        } else if (item.sfType === '4') {
+          const childrenList = item?.childrenList || [];
+          childrenList.forEach((child) => {
+            if (
+              child.sfType === '3' ||
+              child.sfType === '2' ||
+              child.sfType === '8'
+            ) {
+              sfCurrent[0].childrenList.push(child);
+            }
+          });
+        } else if (item.sfType === '7') {
+          irrigatedAreaList.push(item);
+        }
+      });
+      this.leftList = [...sfCurrent, ...irrigatedAreaList];
+      this.deviceList = this.leftList[this.activeIndex]?.childrenList || [];
+    },
+  },
+  onLoad(options) {
+    const { devBid } = options;
+    this.devBid = devBid;
+    this.getdeviceSfStatus();
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body {
+  position: relative;
+  height: 100%;
+}
+.control-container {
+  background: linear-gradient(180deg, #ffffff00 0%, #fff 23.64%, #fff 100%),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  height: 100%;
+  width: 100%;
+  overflow-x: hidden;
+  overflow-y: hidden;
+  .control-content {
+    display: flex;
+    width: 100%;
+    height: calc(100% - 102rpx);
+    overflow-x: hidden;
+    overflow-y: auto;
+    padding: 8px 0;
+    border-radius: 8px 8px 0 0;
+    background: #fff;
+    .control-list-left {
+      width: 250rpx;
+      position: fixed;
+      height: calc(100% - 90rpx);
+      overflow-x: hidden;
+      overflow-y: auto;
+      .control-list-left-item {
+        width: 240rpx;
+        height: 96rpx;
+        line-height: 96rpx;
+        background: #f5f7fa;
+        padding-left: 24rpx;
+        color: #364d46;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 32rpx;
+        font-weight: 400;
+        position: relative;
+      }
+      .control-list-left-item-active {
+        background: #ffffff;
+        border-radius: 0 -16rpx -16rpx 0;
+      }
+      .borderTopRadius {
+        position: absolute;
+        width: 40rpx;
+        height: 40rpx;
+        right: 10rpx;
+        top: -32rpx;
+        transform: rotate(90deg);
+        z-index: 100;
+      }
+      .borderBottomRadius {
+        position: absolute;
+        z-index: 100;
+        width: 40rpx;
+        height: 40rpx;
+        bottom: -32rpx;
+        right: 10rpx;
+      }
+    }
+    .control-list-right {
+      width: calc(100% - 250rpx);
+      margin: 0 32rpx;
+      margin-left: 280rpx;
+      .control-list-right-item {
+        height: 96rpx;
+        display: flex;
+        padding: 0rpx 16rpx;
+        align-items: center;
+        border-radius: 8rpx;
+        background: #f5f7fa;
+        margin-bottom: 22rpx;
+        position: relative;
+        .control-list-right-item-icon {
+          .solenoid-valve {
+            width: 40rpx;
+            height: 40rpx;
+          }
+        }
+        .control-list-right-item-title {
+          margin-left: 8rpx;
+        }
+        .control-list-right-item-action {
+          position: absolute;
+          right: 16rpx;
+        }
+      }
+    }
+  }
+}
+</style>

+ 314 - 0
pages/cb/shuifeizs/history.vue

@@ -0,0 +1,314 @@
+<template>
+  <view class="history-container">
+    <custom-card>
+      <block slot="backText">{{ title }}</block>
+    </custom-card>
+    <view class="calendar" @click="handleCalendarClick">
+      <view class="calendar__label">选择日期</view>
+      <view class="calendar__content">
+        <text>{{ startTime }}</text>
+        <text class="separate">-</text>
+        <text>{{ endTime }} </text>
+      </view>
+      <view class="calendar__link">
+        <u-icon name="arrow-right" color="#4e5969"></u-icon>
+      </view>
+    </view>
+    <view class="history-form-container">
+      <view class="form-header">
+        <view class="form-header__title">设备名称</view>
+        <view class="form-header__title">操作内容</view>
+        <view class="form-header__title">操作人</view>
+        <view class="form-header__title">操作时间</view>
+      </view>
+      <view class="scroll-container">
+        <scroll-view
+          class="main__right"
+          v-if="historyList.length !== 0"
+          scroll-y="true"
+          style="height: 100%"
+          @scrolltolower="scrolltolower"
+          :show-scrollbar="true"
+        >
+          <view
+            class="form-content"
+            v-for="(item, index) in historyList"
+            :key="index"
+          >
+            <view class="form-content__item form-content__item--text">{{
+              item.oprecdName
+            }}</view>
+            <view class="form-content__item">
+              <view class="item-open" v-if="item.oprecdContent == '打开'"
+                >打开</view
+              >
+              <view class="item-close" v-else>{{ item.oprecdContent }}</view>
+            </view>
+            <view class="form-content__item">{{ item.oprcdCreatorName }}</view>
+            <view class="form-content__item">
+              <view class="item-time">{{
+                getTopTime(item.oprcdCreateddate)
+              }}</view>
+              <view class="item-date">{{
+                getYearTime(item.oprcdCreateddate)
+              }}</view>
+            </view>
+          </view>
+        </scroll-view>
+        <u-empty v-else style="height: 80%"
+      /></view>
+    </view>
+    <u-calendar
+      v-model="show"
+      mode="range"
+      @change="handleConfirm"
+    ></u-calendar>
+    <!-- <wu-calendar
+      ref="calendar"
+      mode="range"
+      :insert="false"
+      :maskClick="true"
+      :rangeSameDay="true"
+      :itemHeight="55"
+      @confirm="handleConfirm"
+    ></wu-calendar> -->
+  </view>
+</template>
+<script>
+import solenoidValve from './assets/solenoidValve.png';
+export default {
+  name: 'actionHistory',
+  data() {
+    return {
+      title: '操作记录',
+      devBid: '',
+      pageSize: 20,
+      pageNum: 1,
+      show: false,
+      // 获取当前日期向前3个月
+      startTime: this.formartDate(3),
+      endTime: this.formartDate(),
+      historyList: [],
+      total: 0,
+    };
+  },
+  computed: {
+    hasMore() {
+      return this.total > 0 && this.total > this.pageNum * this.pageSize;
+    },
+  },
+  methods: {
+    getTopTime(date) {
+      return date.split(' ')[1];
+    },
+    getYearTime(date) {
+      return date.split(' ')[0];
+    },
+    async getHistory() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/op/record/list/',
+        method: 'post',
+        header: {
+          'Content-Type': 'application/x-www-form-urlencoded',
+        },
+        data: {
+          pageSize: this.pageSize,
+          pageNum: this.pageNum,
+          startTime: this.startTime + ' 00:00:00',
+          endTime: this.endTime + ' 23:59:59',
+          devBid: this.devBid,
+        },
+        sfType: true,
+      });
+      this.historyList = this.historyList.concat(res.data);
+      this.total = res.total;
+    },
+    formartDate(month = 0) {
+      const time = month * 30 * 24 * 60 * 60 * 1000;
+      const timeStamp = new Date(new Date().getTime() - time);
+      const year = timeStamp.getFullYear();
+      const monthDate = timeStamp.getMonth() + 1;
+      const monthStr = monthDate < 10 ? `0${monthDate}` : monthDate;
+      const day = new Date().getDate();
+      const dayStr = day < 10 ? `0${day}` : day;
+      return `${year}-${monthStr}-${dayStr}`;
+    },
+    handleCalendarClick() {
+      this.show = true;
+      // this.$refs.calendar.open();
+    },
+    handleClose() {
+      this.show = false;
+    },
+    scrolltolower() {
+      if (this.hasMore) {
+        this.pageNum++;
+        this.getHistory();
+      }
+    },
+    handleConfirm(e) {
+      const startDate = e.startDate;
+      const endDate = e.endDate;
+      this.pageNum = 1;
+      this.historyList = [];
+      this.startTime = startDate;
+      this.endTime = endDate;
+      this.getHistory();
+    },
+  },
+  onLoad(options) {
+    const { devBid } = options;
+    this.devBid = devBid;
+    this.getHistory();
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body {
+  position: relative;
+  height: 100%;
+}
+::v-deep .u-calendar__action {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+::v-deep .u-hover-class {
+  opacity: 0.6;
+}
+.scroll-container {
+  height: calc(100vh - 420rpx);
+}
+.history-container {
+  background: linear-gradient(180deg, #ffffff00 0%, #fff 23.64%, #fff 100%),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  height: 100%;
+  width: 100%;
+  overflow-x: hidden;
+  overflow-y: hidden;
+  .calendar {
+    position: relative;
+    display: flex;
+    align-items: center;
+    padding: 0 32rpx;
+    line-height: 64rpx;
+    border-radius: 16rpx;
+    background-color: #fff;
+    margin: 0 32rpx;
+    &__icon {
+      margin-right: 12rpx;
+    }
+
+    &__label {
+      font-size: 28rpx;
+      color: #666;
+      margin-right: 10rpx;
+    }
+
+    &__content {
+      font-size: 28rpx;
+      color: #666;
+      margin-left: 64rpx;
+      .separate {
+        margin: 0 6rpx;
+      }
+    }
+
+    &__link {
+      position: absolute;
+      right: 20rpx;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+  }
+  .history-form-container {
+    width: calc(100% - 64rpx);
+    height: calc(100vh - 300rpx);
+    margin: 32rpx;
+    border-radius: 16rpx;
+    background: #fff;
+    overflow: hidden;
+    .form-header {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      height: 80rpx;
+      width: 100%;
+      border-bottom: 2rpx solid #e4e7ed;
+      &__title {
+        width: 25%;
+        text-align: center;
+        font-size: 28rpx;
+        color: #042118;
+        font-family: 'Source Han Sans CN VF';
+        font-style: normal;
+        font-weight: 400;
+        line-height: normal;
+      }
+    }
+    .form-content {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      height: 96rpx;
+      width: 100%;
+      border-bottom: 2rpx solid #e4e7ed;
+      &__item {
+        width: 25%;
+        text-align: center;
+        font-size: 28rpx;
+        font-family: 'Source Han Sans CN VF';
+        font-style: normal;
+        color: #042118;
+        .item-open {
+          display: inline-flex;
+          height: 40rpx;
+          padding: 4rpx 16rpx;
+          justify-content: center;
+          align-items: center;
+          border-radius: 20rpx;
+          background: #14a47824;
+          color: #14a478;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+        .item-close {
+          display: inline-flex;
+          height: 40rpx;
+          padding: 4rpx 16rpx;
+          justify-content: center;
+          align-items: center;
+          border-radius: 20rpx;
+          background: #7a82911a;
+          color: #7a8291;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+        .item-time {
+          color: #042118;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 28rpx;
+          font-weight: 400;
+        }
+        .item-date {
+          color: #042118;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 24rpx;
+          font-weight: 400;
+        }
+      }
+      &__item--text {
+        width: 20%;
+        margin-left: 5%;
+        // 超出隐藏
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        text-align: left;
+      }
+    }
+  }
+}
+</style>

+ 562 - 0
pages/cb/shuifeizs/rotationflow.vue

@@ -0,0 +1,562 @@
+<template>
+  <view class="rotationflow">
+    <custom-card>
+      <block slot="backText">自动控制</block>
+    </custom-card>
+    <view class="rotationflow-top">
+      <view class="rotationflow-top-list">
+        <image :src="autoBtn" class="rotate-autoBtn" />
+        <image :src="rotate" class="rotate-rotate" />
+        <image :src="water" class="rotate-water" />
+        <view class="rotationflow-time">
+          <view class="rotationflow-time-title" style="font-size: 28px">{{
+            currentFq.name || '--'
+          }}</view>
+          <!-- <view class="rotationflow-time-content"> {{ time }}</view> -->
+          <view class="rotationflow-time-label">{{ label }}</view>
+        </view>
+      </view>
+    </view>
+    <view class="rotationflow-middle">
+      <view
+        class="rotationflow-middle-item"
+        v-for="item in list"
+        :key="item.label"
+      >
+        <view class="rotationflow-middle-item-value">{{ item.value }}</view>
+        <view class="rotationflow-middle-item-title">{{
+          item.sfDisplayname || item.sfName
+        }}</view>
+      </view>
+    </view>
+    <view class="rotationflow-content">
+      <view class="rotationflow-content-top">
+        <view
+          :class="
+            tktype == '1'
+              ? 'rotationflow-content-top-title'
+              : 'rotationflow-content-top-title-rever'
+          "
+        >
+          {{ tktype == '1' ? '灌溉' : '水肥' }}
+        </view>
+        <view class="rotationflow-content-top-desc">已选灌区</view>
+      </view>
+      <view class="rotationflow-content-list">
+        <view class="rotationflow-content-list-wrapper" v-if="tktype == 1">
+          <view class="rotationflow-content-num">
+            <view class="rotationflow-content-num-title"
+              >轮灌次数:{{ currentFq.lgcs || 0 }}</view
+            >
+            <view class="rotationflow-content-num-title"
+              >轮灌间隔:{{ currentFq.lgjg || 0 }} 分钟</view
+            >
+          </view>
+        </view>
+        <view class="rotationflow-content-list-wrapper" v-else>
+          <view class="rotationflow-content-num">
+            <view class="rotationflow-content-num-title"
+              >轮灌次数:{{ currentFq.lgcs || 0 }}</view
+            >
+            <view class="rotationflow-content-num-title"
+              >肥前水:{{ currentFq.fqcx || 0 }} 分钟</view
+            > </view
+          ><view class="rotationflow-content-num">
+            <view class="rotationflow-content-num-title"
+              >轮灌间隔:{{ currentFq.lgjg || 0 }} 分钟</view
+            >
+            <view class="rotationflow-content-num-title"
+              >肥后水:{{ currentFq.fhcx || 0 }} 分钟</view
+            > </view
+          ><view class="rotationflow-content-num">
+            <view class="rotationflow-content-num-title"
+              >模式选择:{{ getsfmode(currentFq.sfmode) }}</view
+            >
+            <view class="rotationflow-content-num-title"></view>
+          </view>
+        </view>
+        <view
+          class="rotationflow-content-list-item"
+          v-for="(item, index) in fqList"
+          :class="item.value === '2' ? 'haveYet' : ''"
+          :key="index"
+        >
+          <view
+            class="rotationflow-content-list-item-title"
+            :class="
+              item.value === '1' ? 'rotationflow-content-list-item-current' : ''
+            "
+            >{{ item.name }}</view
+          >
+          <view
+            class="rotationflow-content-list-item-desc"
+            :class="
+              item.value === '1' ? 'rotationflow-content-list-item-current' : ''
+            "
+            >{{ item.value == '2' ? '已灌溉' : item.ggsj + '分钟' }}</view
+          >
+        </view>
+      </view>
+    </view>
+    <view class="rotationflow-footer">
+      <view class="rotationflow-footer-item" @click="rotationflowEnd"
+        >结束灌溉</view
+      >
+    </view>
+  </view>
+</template>
+<script>
+import rotate from './assets/rotate.png';
+import water from './assets/water.png';
+import autoBtn from './assets/autoBtn.png';
+import json from './test.js';
+
+export default {
+  name: 'rotationflow',
+  data() {
+    return {
+      rotate,
+      water,
+      autoBtn,
+      time: '-',
+      list: [],
+      timer: null,
+      devBid: '',
+      tktype: 1,
+      lgcs: 0,
+      lgjg: 0,
+      fqList: [],
+      currentFq: {},
+      label: '灌溉中.',
+      devName: '',
+      devStatus: '',
+    };
+  },
+  components: {},
+  methods: {
+    formartTime(time) {
+      if (!time) {
+        return '-';
+      }
+      let hours = time * 60 * 1000;
+      let h = Math.floor(hours / (60 * 60 * 1000));
+      let m = Math.floor((hours % (60 * 60 * 1000)) / (60 * 1000));
+      let s = Math.floor(((hours % (60 * 60 * 1000)) % (60 * 1000)) / 1000);
+      this.time = `${h < 10 ? '0' + h : h}:${m < 10 ? '0' + m : m}:${
+        s < 10 ? '0' + s : s
+      }`;
+    },
+    setTime(time) {
+      if (!time) {
+        return '-';
+      }
+      let hours = time * 60 * 1000;
+      this.timer = setInterval(() => {
+        if (hours <= 0) {
+          clearInterval(this.timer);
+          return;
+        }
+        hours -= 1000;
+        let h = Math.floor(hours / (60 * 60 * 1000));
+        let m = Math.floor((hours % (60 * 60 * 1000)) / (60 * 1000));
+        let s = Math.floor(((hours % (60 * 60 * 1000)) % (60 * 1000)) / 1000);
+        this.time = `${h < 10 ? '0' + h : h}:${m < 10 ? '0' + m : m}:${
+          s < 10 ? '0' + s : s
+        }`;
+      }, 1000);
+    },
+    getsfmode(m) {
+      const mode = String(m);
+      switch (mode) {
+        case '1':
+          return '定时';
+        case '2':
+          return '定量';
+        case '3':
+          return 'EC调配';
+        case '4':
+          return '混肥比例';
+        default:
+          return '-';
+      }
+    },
+    async getRunStatus() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/zsrf/task/run/status/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+
+      const data = res || {};
+      if (data.status === undefined || data.status / 1 !== 1) {
+        clearInterval(this.timer);
+        clearInterval(this.labelTimer);
+        clearInterval(this.taskTimer);
+        uni.showLoading({
+          title: '灌溉任务已结束',
+        });
+
+        setTimeout(() => {
+          uni.hideLoading();
+          uni.redirectTo({
+            url: `/pages/cb/shuifeizs/shuifeizs?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
+          });
+        }, 1000);
+        return;
+      }
+
+      this.list = data?.sensorList || [];
+
+      this.tktype = data?.tktype;
+      this.lgjg = data?.lgjg || 0;
+      this.lgcs = data?.lgcs || 0;
+      this.fqList = data?.fqList || [];
+      // value 0 未灌溉 1 灌溉中 2 灌溉完成
+      this.fqList.forEach((item) => {
+        if (item.value === '1') {
+          this.currentFq = item;
+        }
+      });
+      this.formartTime(this.currentFq.lgjg);
+      // this.setTime(this.currentFq.lgjg);
+    },
+    rotationflowEnd() {
+      const payload = {
+        devBid: this.devBid,
+        tkid: 0,
+        status: 0,
+        tktype: this.tktype,
+      };
+      this.postTaskCtl(payload);
+    },
+    async postTaskCtl(payload) {
+      uni.showLoading({
+        title: '正在执行',
+      });
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/zsrf/task/ctl/',
+        method: 'post',
+        data: payload,
+        header: {
+          'Content-Type': 'application/json',
+        },
+      });
+      uni.hideLoading();
+      if (res.code === '000000') {
+        uni.showToast({
+          title: '操作成功',
+        });
+        setTimeout(() => {
+          uni.navigateTo({
+            url: `/pages/cb/shuifeizs/shuifeizs?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`,
+          });
+        }, 1000);
+      } else {
+        uni.showToast({
+          icon: 'none',
+          title: res.msg,
+        });
+      }
+    },
+  },
+  onLoad(options) {
+    const { devBid, devName, devStatus } = options;
+    this.devBid = devBid;
+    this.devName = devName;
+    this.devStatus = devStatus;
+    this.getRunStatus();
+    this.labelTimer = setInterval(() => {
+      if (this.label === '灌溉中.') {
+        this.label = '灌溉中..';
+      } else if (this.label === '灌溉中..') {
+        this.label = '灌溉中...';
+      } else {
+        this.label = '灌溉中.';
+      }
+    }, 500);
+
+    this.taskTimer = setInterval(() => {
+      this.getRunStatus();
+    }, 30000);
+  },
+  onUnload() {
+    clearInterval(this.timer);
+    clearInterval(this.labelTimer);
+    clearInterval(this.taskTimer);
+  },
+  beforeDestroy() {
+    if (this.timer) {
+      clearInterval(this.timer);
+    }
+
+    if (this.taskTimer) {
+      clearInterval(this.taskTimer);
+    }
+
+    if (this.labelTimer) {
+      clearInterval(this.labelTimer);
+    }
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body,
+uni-page-wrapper {
+  position: relative;
+  height: 100%;
+}
+@keyframes rotate {
+  0% {
+    transform: rotate(0deg);
+  }
+  100% {
+    transform: rotate(360deg);
+  }
+}
+.rotationflow {
+  background: linear-gradient(
+      180deg,
+      #f5f6fa00 0%,
+      #f5f6fa 23.64%,
+      #f5f6fa 100%
+    ),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  width: 100%;
+  height: calc(100vh - 100rpx);
+  overflow: hidden;
+  overflow-y: scroll;
+  margin-bottom: 140rpx;
+  position: relative;
+  .rotationflow-top {
+    height: 500rpx;
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .rotationflow-top-list {
+      display: flex;
+      position: relative;
+      align-items: center;
+      justify-content: center;
+      width: 100%;
+      height: 100%;
+      .rotate-autoBtn {
+        position: absolute;
+        width: 360rpx;
+        height: 360rpx;
+        z-index: 1;
+      }
+      .rotate-rotate {
+        position: absolute;
+        width: 320rpx;
+        height: 320rpx;
+        left: 215rpx;
+        top: 92rpx;
+        z-index: 2;
+        // 循环滚动
+        animation: rotate 20s linear infinite;
+      }
+      .rotate-water {
+        position: absolute;
+        width: 550rpx;
+        height: 600rpx;
+        margin-left: 220rpx;
+        margin-top: 100rpx;
+      }
+      .rotationflow-time {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        position: relative;
+        z-index: 3;
+        top: -5rpx;
+        .rotationflow-time-title {
+          width: 200rpx;
+          color: #042118;
+          text-align: center;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 32rpx;
+          font-weight: 500;
+        }
+        .rotationflow-time-content {
+          width: 200rpx;
+          color: #042118;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 40rpx;
+          font-weight: 700;
+          margin: 8rpx 0;
+          text-align: center;
+        }
+        .rotationflow-time-label {
+          width: 140rpx;
+          color: #687a74;
+          text-align: left;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 32rpx;
+          font-weight: 400;
+        }
+      }
+    }
+  }
+  .rotationflow-middle {
+    display: flex;
+    padding: 0 48rpx;
+    margin: 32rpx 0;
+    .rotationflow-middle-item {
+      width: 25%;
+      text-align: center;
+      .rotationflow-middle-item-value {
+        color: #042118;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 32rpx;
+        font-weight: 500;
+      }
+      .rotationflow-middle-item-title {
+        color: #687a74;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 400;
+        line-height: normal;
+        // 超出隐藏
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+      }
+    }
+  }
+  .rotationflow-content {
+    border-bottom: none;
+    position: relative;
+    overflow: hidden;
+    background-color: #fff;
+    border-radius: 16rpx;
+    padding: 32rpx;
+    width: calc(100% - 128rpx);
+    margin-left: 32rpx;
+    margin-bottom: 140rpx;
+    &::before {
+      position: absolute;
+      content: '';
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      background-size: cover;
+    }
+    .rotationflow-content-top {
+      display: flex;
+      .rotationflow-content-top-title {
+        border-radius: 8rpx;
+        background: #1890ff1a;
+        color: #1890ff;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 400;
+        line-height: normal;
+        padding: 4rpx 16rpx;
+      }
+      .rotationflow-content-top-title-rever {
+        border-radius: 8rpx;
+        background: #f3a72f1a;
+        color: #f3a72f;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-style: normal;
+        font-weight: 400;
+        line-height: normal;
+        padding: 4rpx 16rpx;
+      }
+      .rotationflow-content-top-desc {
+        color: #333333;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-weight: 700;
+        margin-left: 16rpx;
+      }
+    }
+    .rotationflow-content-list {
+      width: 100%;
+      .rotationflow-content-list-wrapper {
+        width: 100%;
+        border-radius: 8rpx;
+        background: #f5f6fa;
+        padding: 8rpx 0;
+        margin-top: 16rpx;
+      }
+      .rotationflow-content-num {
+        display: flex;
+        padding: 8rpx 16rpx;
+        .rotationflow-content-num-title {
+          width: 50%;
+          color: #687a74;
+          font-family: 'Source Han Sans CN VF';
+          font-size: 28rpx;
+          font-style: normal;
+          font-weight: 400;
+          margin: 0 8rpx;
+        }
+      }
+      .rotationflow-content-list-item {
+        display: flex;
+        justify-content: space-between;
+        margin: 16rpx 0;
+        color: #042118;
+        text-align: right;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-weight: 400;
+        .rotationflow-content-list-item-desc {
+        }
+        .rotationflow-content-list-item-current {
+          color: #14a478;
+        }
+      }
+      .haveYet {
+        color: #9ba6a3;
+        text-align: right;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+      .currentYet {
+        color: #14a478;
+        text-align: right;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 28rpx;
+        font-weight: 400;
+      }
+    }
+  }
+  .rotationflow-footer {
+    position: fixed;
+    width: 100%;
+    bottom: 0;
+    left: 0;
+    display: flex;
+    height: 128rpx;
+    align-items: center;
+    background: #fff;
+    box-shadow: 0 -4rpx 8rpx 0 #00000026;
+    z-index: 9999;
+    .rotationflow-footer-item {
+      width: calc(100% - 64rpx);
+      margin: 0 32rpx;
+      text-align: center;
+      font-size: 32rpx;
+      height: 80rpx;
+      line-height: 80rpx;
+      color: #ffffff;
+      font-family: 'PingFang SC';
+      font-size: 32rpx;
+      font-weight: 500;
+      border-radius: 16rpx;
+      background: #ff3546;
+    }
+  }
+}
+</style>

+ 258 - 0
pages/cb/shuifeizs/shuifeizs.vue

@@ -0,0 +1,258 @@
+<template>
+  <view class="facilitystate-page">
+    <custom-card>
+      <block slot="backText">
+        <view class="facilitystate-top__title">
+          <text :class="devStatus == '1' ? 'online' : 'offline'">{{
+            devStatus == '1' ? '在线' : '离线'
+          }}</text>
+          {{ devName }}
+        </view>
+      </block>
+    </custom-card>
+    <view class="facilitystate-top">
+      <view
+        class="facilitystate-top__item"
+        v-for="(item, index) in deviceList"
+        :key="index"
+        @click="nativeTo(item)"
+      >
+        <image class="item-icon" :src="item.icon" />
+        <view class="facilitystate-top__item-text">{{ item.title }}</view>
+      </view>
+    </view>
+    <Base :dataList="dataList" />
+    <facilitystate
+      :ggbCurrent="ggbCurrent"
+      :sfbCurrent="sfbCurrent"
+      :irrigatedAreaList="irrigatedAreaList"
+      :alreadyfertilizerBucketList="alreadyfertilizerBucketList"
+    />
+  </view>
+</template>
+
+<script>
+import manualControl from './assets/manualControl.png';
+import wheelIrrigation from './assets/wheelIrrigation.png';
+import timing from './assets/timing.png';
+import masterStop from './assets/masterStop.png';
+import fertilizationFormula from './assets/fertilizationFormula.png';
+import backwashControl from './assets/backwashControl.png';
+import basicSetting from './assets/basicSetting.png';
+import operatingRecord from './assets/operatingRecord.png';
+import Base from './components/base.vue';
+import facilitystate from './components/facilitystate.vue';
+export default {
+  data() {
+    return {
+      title: '水肥一体机',
+      manualControl,
+      devBid: '',
+      devName: '',
+      devStatus: '1',
+      dataList: [],
+      irrigatedAreaList: [],
+      alreadyfertilizerBucketList: [],
+      deviceList: [
+        {
+          icon: manualControl,
+          title: '手动控制',
+          url: '/pages/cb/shuifeizs/control',
+        },
+        {
+          icon: wheelIrrigation,
+          title: '自动控制',
+          url: '',
+        },
+        {
+          icon: operatingRecord,
+          title: '操作记录',
+          url: '/pages/cb/shuifeizs/history',
+        },
+        // {
+        //   icon: timing,
+        //   title: '定时计划',
+        //   url: '',
+        // },
+        // {
+        //   icon: masterStop,
+        //   title: '总停',
+        //   url: '',
+        // },
+        // {
+        //   icon: fertilizationFormula,
+        //   title: '施肥配方',
+        //   url: '',
+        // },
+        // {
+        //   icon: backwashControl,
+        //   title: '反冲洗控制',
+        //   url: '',
+        // },
+        // {
+        //   icon: basicSetting,
+        //   title: '基础设置',
+        //   url: '',
+        // },
+      ],
+      ggbCurrent: {},
+      sfbCurrent: {},
+    };
+  },
+  components: {
+    Base,
+    facilitystate,
+  },
+  onLoad(options) {
+    console.log(options, 'optionsoptions');
+    /*
+      0	水源	泵类	负责水源进入管道的总泵或者阀
+      1	肥料	泵类	负责肥料进入管道的总阀或者泵
+      2	吸肥	泵类	控制肥料桶出肥的阀或者泵,每个肥料桶一个
+      3	搅拌	泵类	肥料桶的搅拌电机或者泵 每个肥料桶一个
+      4	肥料桶	泵类	肥料桶,每个施肥机有多个或者没有,不一定真实存在,只是逻辑上的概念
+      5	电磁阀	无	管道最末端每个田地里控制出水的阀门
+      6	传感器	无	水肥机上的 温度,压力,流速,PH EC等监测类要素
+      7	灌区    无	逻辑区域,电磁阀的分组
+      */
+    const { devBid, devName, devStatus } = options;
+    this.devBid = devBid;
+    this.devName = devName;
+    this.devStatus = devStatus;
+    this.deviceList[0].url = `/pages/cb/shuifeizs/control?devBid=${options.devBid}`;
+    this.deviceList[
+      this.deviceList.length - 1
+    ].url = `/pages/cb/shuifeizs/history?devBid=${options.devBid}`;
+    if (devBid) {
+      this.init();
+    }
+  },
+  methods: {
+    async init() {
+      this.getdeviceSfStatus();
+      await this.getpeifangRefresh();
+      await this.getRunStatus();
+    },
+    // iot/mobile/device/sf/peifang/refresh/
+    async getpeifangRefresh() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/peifang/refresh/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+    },
+    async getRunStatus() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/zsrf/task/run/status/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      const data = JSON.stringify(res || {});
+
+      if (data == '{}') {
+        this.isRun = true;
+        this.deviceList[1].url = `/pages/cb/shuifeizs/automation?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`;
+      } else {
+        this.isRun = false;
+        this.deviceList[1].url = `/pages/cb/shuifeizs/rotationflow?devBid=${this.devBid}&devName=${this.devName}&devStatus=${this.devStatus}`;
+      }
+    },
+    async getdeviceSfStatus() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/status/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      this.dataList = [];
+      this.irrigatedAreaList = [];
+      this.alreadyfertilizerBucketList = [];
+      res?.forEach((item) => {
+        if (item.sfType === '0') {
+          this.ggbCurrent = item;
+        } else if (item.sfType === '1') {
+          this.sfbCurrent = item;
+        } else if (item.sfType === '4') {
+          this.alreadyfertilizerBucketList.push(item);
+        } else if (item.sfType === '6') {
+          this.dataList.push(item);
+        } else if (item.sfType === '7') {
+          this.irrigatedAreaList.push(item);
+        }
+      });
+    },
+    nativeTo(item) {
+      uni.navigateTo({
+        url: item.url,
+      });
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body {
+  position: relative;
+  height: 100%;
+}
+.online {
+  height: 32rpx;
+  line-height: 32rpx;
+  padding: 0 8rpx;
+  border-radius: 4rpx;
+  background: #14a478;
+  color: #ffffff;
+  font-family: 'Source Han Sans CN';
+  font-size: 20rpx;
+  font-weight: 500;
+  margin-right: 8rpx;
+  top: -4rpx;
+  position: relative;
+}
+.offline {
+  height: 32rpx;
+  line-height: 32rpx;
+  padding: 0 8rpx;
+  border-radius: 4rpx;
+  background: #ff4d4f;
+  color: #ffffff;
+  font-family: 'Source Han Sans CN';
+  font-size: 20rpx;
+  font-weight: 500;
+  margin-right: 8rpx;
+  top: -4rpx;
+  position: relative;
+}
+.facilitystate-page {
+  background: linear-gradient(180deg, #ffffff00 0%, #fff 23.64%, #fff 100%),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  height: 100%;
+  width: 100%;
+  overflow-x: hidden;
+  overflow-y: scroll;
+  .facilitystate-top {
+    display: grid;
+    grid-template-columns: repeat(4, 1fr);
+    text-align: center;
+    margin-top: 18rpx;
+    &__item {
+      margin-bottom: 32rpx;
+      .item-icon {
+        width: 96rpx;
+        height: 96rpx;
+      }
+    }
+    &__item-text {
+      color: #042118;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+      margin-top: 16rpx;
+    }
+  }
+}
+</style>

+ 103 - 0
pages/cb/shuifeizs/test.js

@@ -0,0 +1,103 @@
+export default {
+  code: '000000',
+  msg: '\u64cd\u4f5c\u6210\u529f',
+  data: {
+    tkid: 0,
+    tktype: 1,
+    status: 0,
+    cufq: 1,
+    cufa: '2,4,6,9,12',
+    nextfq: 1,
+    sensorList: [
+      {
+        sfBid: null,
+        devBid: null,
+        sfType: '6',
+        sfName: '\u4e3b\u7ba1\u9053\u77ac\u65f6\u6d41\u91cf',
+        sfDisplayname: '\u4e3b\u7ba1\u9053\u77ac\u65f6\u6d41\u91cf',
+        sfCode: 'lszg',
+        sfParentBid: null,
+        sfSequence: 0,
+        sfCreatedDate: null,
+        sfCreator: null,
+        sfModifieddate: null,
+        sfModifier: null,
+        sfLat: null,
+        sfLng: null,
+        sfAddress: null,
+        childrenList: null,
+        value: 20.3,
+      },
+      {
+        sfBid: null,
+        devBid: null,
+        sfType: '6',
+        sfName: '\u4e3b\u7ba1\u9053\u7d2f\u8ba1\u6d41\u91cf',
+        sfDisplayname: '\u4e3b\u7ba1\u9053\u7d2f\u8ba1\u6d41\u91cf',
+        sfCode: 'llzg',
+        sfParentBid: null,
+        sfSequence: 0,
+        sfCreatedDate: null,
+        sfCreator: null,
+        sfModifieddate: null,
+        sfModifier: null,
+        sfLat: null,
+        sfLng: null,
+        sfAddress: null,
+        childrenList: null,
+        value: 210.3,
+      },
+      {
+        sfBid: null,
+        devBid: null,
+        sfType: '6',
+        sfName: 'EC',
+        sfDisplayname: 'EC',
+        sfCode: 'ec',
+        sfParentBid: null,
+        sfSequence: 0,
+        sfCreatedDate: null,
+        sfCreator: null,
+        sfModifieddate: null,
+        sfModifier: null,
+        sfLat: null,
+        sfLng: null,
+        sfAddress: null,
+        childrenList: null,
+        value: 23.809,
+      },
+      {
+        sfBid: null,
+        devBid: null,
+        sfType: '6',
+        sfName: 'PH',
+        sfDisplayname: 'PH',
+        sfCode: 'ph',
+        sfParentBid: null,
+        sfSequence: 0,
+        sfCreatedDate: null,
+        sfCreator: null,
+        sfModifieddate: null,
+        sfModifier: null,
+        sfLat: null,
+        sfLng: null,
+        sfAddress: null,
+        childrenList: null,
+        value: 7.5,
+      },
+    ],
+    fqList: [
+      {
+        fqid: '1',
+        name: '1\u533a',
+        lgcs: '',
+        lgjg: 10,
+        value: '1',
+        fqcx: '',
+        fhcx: '',
+        sfmode: '',
+        pfid: 0,
+      },
+    ],
+  },
+};

+ 169 - 0
pages/cb/wenshizs/components/DeviceCard.vue

@@ -0,0 +1,169 @@
+<template>
+  <view class="device-card" @click="handleClick">
+    <view class="device-card__status">
+      <image
+        class="img"
+        :src="dataSource.devStatus == '1' ? successImg : errorImg"
+      />
+      <view
+        class="status-text"
+        :class="{ offline: dataSource.devStatus != '1' }"
+        >{{ dataSource.devStatusName || '' }}</view
+      >
+    </view>
+    <view class="device-card__header">
+      <view class="device-card__title u-line-1">
+        <view class="name">{{ dataSource.devName || '' }}</view>
+        <view class="tips">{{ dataSource.devCode || '' }}</view>
+      </view>
+    </view>
+    <view class="device-card__body">
+      <view class="device-card__row">
+        <view class="device-card__label">上报时间</view>
+        <view class="device-card__value">{{ dataSource.devUpdateddate }}</view>
+      </view>
+      <view class="device-card__row">
+        <view class="device-card__label">设备位置</view>
+        <view class="device-card__value">{{
+          `${dataSource.devProvincealign || dataSource.devProvince || ''}  ${
+            dataSource.devCityalign || dataSource.devCity || ''
+          } ${dataSource.devDistrictalign || dataSource.devDistrict || ''}`
+        }}</view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  name: 'DeviceCard',
+  props: {
+    dataSource: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      successImg:
+        'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/success.png',
+      errorImg:
+        'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/error.png',
+    };
+  },
+  methods: {
+    handleClick() {},
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.device-card {
+  background: linear-gradient(180deg, #8ae4c93d 0%, #14a47800 25.54%), #fff;
+  position: relative;
+  padding: 28rpx;
+  border-radius: 16rpx;
+  background-color: #fff;
+  margin-bottom: 32rpx;
+  margin: 0 auto;
+  &__status {
+    position: absolute;
+    right: 0;
+    top: 0;
+    width: 150rpx;
+    height: 56rpx;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+
+    .img {
+      position: absolute;
+      width: 100%;
+      height: 100%;
+      right: 0;
+      top: 0;
+      overflow: hidden;
+    }
+
+    .status-text {
+      font-size: 28rpx;
+      color: #14a478;
+
+      &.online {
+        color: #14a478;
+      }
+
+      &.offline {
+        color: #ff3546;
+      }
+    }
+  }
+
+  &__header {
+    margin-bottom: 18rpx;
+  }
+
+  &__title {
+    align-items: center;
+    line-height: 48rpx;
+    display: flex !important;
+    .name {
+      width: 140rpx;
+      font-size: 32rpx;
+      color: #042118;
+      margin-right: 32rpx;
+      // 超出隐藏
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      text-align: left;
+      font-family: 'Source Han Sans CN VF';
+      font-weight: 700;
+    }
+
+    .tips {
+      width: 410rpx;
+      font-size: 32rpx;
+      color: #687a74;
+      // 超出隐藏
+      white-space: nowrap;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      text-align: left;
+    }
+  }
+
+  &__body {
+    padding: 16rpx 0;
+    background-color: #fff;
+    border-radius: 12rpx;
+  }
+
+  &__row {
+    display: flex;
+    align-items: center;
+    margin-bottom: 16rpx;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+  }
+
+  &__label {
+    width: 140rpx;
+    color: #9ba6a3;
+    text-align: left;
+    margin-right: 32rpx;
+  }
+
+  &__value {
+    width: 470rpx;
+    text-align: left;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+}
+</style>

+ 243 - 0
pages/cb/wenshizs/components/OperationCard.vue

@@ -0,0 +1,243 @@
+<template>
+  <view class="operation">
+    <view
+      class="operation__header"
+      :class="
+        dourceData.local_model == '1'
+          ? 'operation__header--info'
+          : 'operation__header--warn'
+      "
+      >{{ dourceData.name }}
+      <view
+        :class="
+          dourceData.local_model == '1'
+            ? 'operation__header--infoing'
+            : 'operation__header--warning'
+        "
+      >
+        {{ dourceData.local_model == '1' ? '远程' : '本地' }}
+      </view>
+    </view>
+    <view class="operation__model">
+      模式
+      <view class="operation__model--container">
+        <view
+          class="hand"
+          @click="changeClick('hand')"
+          :class="{ active: dourceData.run_model == '0' }"
+          >手动</view
+        >
+        <view
+          class="auto"
+          @click="changeClick('auto')"
+          :class="{ active: dourceData.run_model == '1' }"
+          >自动</view
+        >
+      </view>
+    </view>
+    <view class="operation__body">
+      <view class="operation__body-content">
+        <view class="operation__body-content--title">展开</view>
+        <view class="operation__body-content--desc">
+          <u-switch
+            :disabled="this.dourceData.local_model == '0'"
+            v-model="runStatus"
+            active-color="#14A478"
+            inactive-color="#C3CAD8"
+            size="36"
+          ></u-switch>
+        </view>
+      </view>
+      <view class="operation__body-content">
+        <view class="operation__body-content--title">收拢</view>
+        <view class="operation__body-content--desc">
+          <u-switch
+            :disabled="this.dourceData.local_model == '0'"
+            v-model="closeStatus"
+            active-color="#14A478"
+            inactive-color="#C3CAD8"
+            size="36"
+          ></u-switch>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+export default {
+  name: 'OperationCard',
+  props: {
+    dourceData: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+  computed: {
+    runStatus: {
+      get() {
+        // 展开
+        return this.dourceData.down_status == '1';
+      },
+      set(val) {
+        this.$emit('run-status', this.dourceData);
+      },
+    },
+    closeStatus: {
+      get() {
+        // 收拢
+        return this.dourceData.up_status == '1';
+      },
+      set(val) {
+        this.$emit('close-status', this.dourceData);
+      },
+    },
+  },
+  data() {
+    return {
+      info: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/info.png',
+      warning:
+        'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/warning.png',
+    };
+  },
+  methods: {
+    changeClick(type) {
+      if (this.dourceData.local_model == '0') {
+        return;
+      }
+      this.$emit('change-click', {
+        type,
+        dourceData: this.dourceData,
+      });
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.operation {
+  justify-content: center;
+  border-radius: 4px;
+  background: #eff2fa;
+  margin-bottom: 32rpx;
+  position: relative;
+  &__header {
+    height: 64rpx;
+    line-height: 64rpx;
+    color: #333333;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    font-weight: 500;
+    padding: 0 32rpx;
+    position: relative;
+    &--infoing {
+      width: 150rpx;
+      height: 56rpx;
+      line-height: 50rpx;
+      position: absolute;
+      right: 0rpx;
+      top: 0rpx;
+      background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/info.png')
+        no-repeat center center;
+      background-size: 100%;
+      color: #0085ff;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+    &--warning {
+      width: 150rpx;
+      height: 56rpx;
+      line-height: 50rpx;
+      position: absolute;
+      right: 0rpx;
+      top: 0rpx;
+      background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/warning.png')
+        no-repeat center center;
+      background-size: 100%;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+      color: #eeac19;
+    }
+  }
+  &__header--info {
+    background: linear-gradient(180deg, #eff4ff 20.24%, #eff2fa 100%);
+  }
+  &__header--warn {
+    background: linear-gradient(180deg, #fffaef 20.24%, #eff2fa 100%);
+  }
+  &__model {
+    display: flex;
+    height: 80rpx;
+    align-items: center;
+    justify-content: space-between;
+    border-radius: 16rpx;
+    color: #333333;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    font-weight: 500;
+    padding: 0 32rpx;
+    color: #333333;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    margin-top: 16rpx;
+    &--container {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      width: 164rpx;
+      height: 48rpx;
+      background: #ffffff;
+      border-radius: 8rpx;
+      padding: 0 6rpx;
+      .hand {
+        width: 50%;
+        border-radius: 8rpx;
+        text-align: center;
+        height: 40rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 24rpx;
+        font-weight: 400;
+        color: #687a74;
+      }
+      .auto {
+        width: 50%;
+        border-radius: 8rpx;
+        text-align: center;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        height: 40rpx;
+        font-family: 'Source Han Sans CN VF';
+        font-size: 24rpx;
+        font-weight: 400;
+        color: #687a74;
+      }
+      .active {
+        background: #14a478;
+        color: #ffffff;
+      }
+    }
+  }
+  &__body {
+    display: grid;
+    grid-template-columns: repeat(2, 1fr);
+    grid-gap: 24rpx;
+    padding: 30rpx;
+    padding-top: 24rpx;
+    &-content {
+      height: 72rpx;
+      background: #ffffff;
+      border-radius: 16rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 0 16rpx;
+    }
+  }
+}
+</style>

+ 127 - 0
pages/cb/wenshizs/components/element.vue

@@ -0,0 +1,127 @@
+<template>
+  <view class="element">
+    <view class="element-header">
+      <view class="element-title">1号环控</view>
+      <view class="element-status">
+        2024-01-25 16:05:05
+        <u-icon name="reload" color="#14A478" style="margin-left: 20rpx" />
+      </view>
+    </view>
+    <view class="element-body">
+      <view class="element-row" v-for="(item, index) in list" :key="index">
+        <image :src="item.url" class="element-col-icon" />
+        <view class="element-col">
+          <view class="element-col-title"
+            >{{ item.content }}
+            <text class="unit">{{ item.unit }}</text>
+          </view>
+          <view class="element-col-content">{{ item.title }}</view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+export default {
+  name: 'Element',
+  data() {
+    return {
+      list: [
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/air-humidity.png',
+          title: '空气温度',
+          unit: '℃',
+          content: '12',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/air-temperature.png',
+          title: '空气湿度',
+          unit: '%',
+          content: '80',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/soil-temperature.png',
+          title: '土壤温度',
+          unit: '℃',
+          content: '80',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/soil-humidity.png',
+          title: '土壤湿度',
+          unit: '%',
+          content: '80',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/co2.png',
+          title: '二氧化碳',
+          unit: 'ppm',
+          content: '80',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/illumination.png',
+          title: '光照',
+          unit: 'LUX',
+          content: '80',
+        },
+        {
+          url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/ph.png',
+          title: '土壤PH值',
+          unit: '',
+          content: '80',
+        },
+      ],
+    };
+  },
+};
+</script>
+<style lang="less" scoped>
+.element {
+  .element-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20rpx;
+    color: #042118;
+    font-family: 'Source Han Sans CN VF';
+    font-size: 28rpx;
+    font-weight: 700;
+    .element-status {
+      color: #687a74;
+      text-align: center;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+  }
+  .element-body {
+    display: grid;
+    grid-template-columns: repeat(2, 1fr);
+    grid-gap: 20rpx;
+    padding: 20rpx;
+    .element-row {
+      display: flex;
+      margin-bottom: 20rpx;
+      .element-col-icon {
+        width: 100rpx;
+        height: 100rpx;
+        margin-right: 10rpx;
+      }
+      .element-col {
+        .element-col-title {
+          font-size: 28rpx;
+          color: #042118;
+          font-weight: 700;
+          .unit {
+            font-size: 24rpx;
+            color: #999;
+          }
+        }
+        .element-col-content {
+          font-size: 24rpx;
+          color: #666;
+        }
+      }
+    }
+  }
+}
+</style>

+ 266 - 0
pages/cb/wenshizs/wenshizs.vue

@@ -0,0 +1,266 @@
+<template>
+  <view class="greenhouse-page">
+    <custom-card>
+      <block slot="backText">
+        <view class="greenhouse-top__title">
+          {{ dataSource.devName }}
+        </view> </block
+      ><view slot="right">
+        <view class="ntoNative" @tap="toNavigation">
+          <image :src="location" class="icon"></image>
+        </view>
+      </view>
+    </custom-card>
+    <view class="greenhouse-top">
+      <device-card :dataSource="dataSource" />
+    </view>
+    <view class="greenhouse-bottom">
+      <!-- <Element /> -->
+      <view class="greenhouse-bottom-header">
+        卷膜控制
+        <u-icon name="reload" class="reload" @click="reloadHandler" />
+      </view>
+      <operation-card
+        @run-status="runStatusHandler"
+        @close-status="closeStatusHandler"
+        @change-click="changeClickHandler"
+        v-for="(item, index) in juanmoList"
+        :key="index"
+        :dourceData="item"
+      />
+    </view>
+  </view>
+</template>
+
+<script>
+import Element from './components/element.vue';
+import deviceCard from './components/DeviceCard.vue';
+import OperationCard from './components/OperationCard.vue';
+
+export default {
+  components: {
+    Element,
+    deviceCard,
+    OperationCard,
+  },
+  data() {
+    return {
+      location:
+        'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/location.svg',
+      juanmoList: [],
+      dataSource: {
+        devStatus: '1',
+        devStatusName: '在线',
+        devName: '-',
+        devCode: '-',
+        devUpdateddate: '-',
+        devProvincealign: '-',
+      },
+      page: 1,
+      size: 99999,
+    };
+  },
+  methods: {
+    init() {
+      this.getDpdevicedpkzgjuanmoList();
+      this.getDataSource();
+    },
+    async reloadHandler() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/dpkzg/refresh/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      uni.showToast({
+        title: res?.msg || '',
+        icon: 'none',
+        duration: 3000,
+      });
+      this.getDpdevicedpkzgjuanmoList();
+    },
+    changeClickHandler(prop) {
+      const { type, dourceData } = prop;
+      const payload = {
+        code: dourceData.code,
+        type: 'juanmo',
+        op_type: 'run_model',
+        value: type === 'auto' ? '1' : '0',
+      };
+      this.optDevctl(payload);
+    },
+    async optDevctl(payload) {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/dpkzg/devctl/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+          data: payload,
+        },
+        header: {
+          'Content-Type': 'application/json',
+        },
+      });
+      // 提示
+      uni.showToast({
+        title: res?.msg || '',
+        icon: 'none',
+        duration: 3000,
+      });
+      setTimeout(() => {
+        this.getDpdevicedpkzgjuanmoList();
+      }, 1000);
+    },
+    async getDataSource() {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/dpkzg/info/',
+        method: 'post',
+        data: {
+          devBid: this.devBid,
+        },
+      });
+      this.dataSource = res;
+    },
+    runStatusHandler(dourceData) {
+      if (dourceData.down_status === '0' && dourceData.up_status === '1') {
+        this.$set(dourceData, 'up_status', '0');
+      }
+      this.$set(
+        dourceData,
+        'down_status',
+        dourceData.down_status === '1' ? '0' : '1'
+      );
+      const payload = {
+        code: dourceData.code,
+        type: 'juanmo',
+        op_type: 'down',
+        value: dourceData.down_status,
+      };
+      this.optDevctl(payload);
+    },
+    closeStatusHandler(dourceData) {
+      if (dourceData.up_status === '0' && dourceData.down_status === '1') {
+        this.$set(dourceData, 'down_status', '0');
+      }
+      this.$set(
+        dourceData,
+        'up_status',
+        dourceData.up_status === '1' ? '0' : '1'
+      );
+      const payload = {
+        code: dourceData.code,
+        type: 'juanmo',
+        op_type: 'up',
+        value: dourceData.up_status,
+      };
+      this.optDevctl(payload);
+    },
+    toNavigation() {
+      const roundedLongitude =
+        this.dataSource.devLngalign || this.dataSource.devLng;
+      const roundedLatitude =
+        this.dataSource.devLatalign || this.dataSource.devLat;
+      if (!roundedLongitude) {
+        uni.showToast({
+          title: '当前设备无定位信息',
+          icon: 'none',
+          duration: 3000,
+        });
+        return;
+      }
+      if (
+        plus.runtime.isApplicationExist({
+          pname: 'com.autonavi.minimap',
+          action: 'iosamap://',
+        })
+      ) {
+        let url = `amapuri://route/plan?sourceApplication=yourAppName&dlat=${roundedLatitude}&dlon=${roundedLongitude}&dev=0&t=0&style=0&start=&auto=1&rtdType=1&coordinate=wgs84`;
+        plus.runtime.openURL(url);
+      } else if (
+        plus.runtime.isApplicationExist({
+          pname: 'com.baidu.BaiduMap',
+          action: 'baidumap://',
+        })
+      ) {
+        let url = `baidumap://map/direction?destination=${roundedLongitude},${roundedLatitude}&mode=navigation&output=html&coord_type=wgs84`;
+        plus.runtime.openURL(url);
+      } else {
+        uni.showToast({
+          title: '当前未安装 高德地图或百度地图 无法导航',
+          icon: 'none',
+          duration: 3000,
+        });
+      }
+    },
+    // 获取卷膜设备列表
+    async getDpdevicedpkzgjuanmoList(tf) {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/dpkzg/juanmo/list/',
+        method: 'post',
+        data: {
+          pageSize: this.size,
+          pageNum: this.page,
+          devBid: this.devBid,
+        },
+      });
+      this.juanmoList = res;
+    },
+  },
+  onLoad(query) {
+    this.devBid = query.devBid;
+    this.devBid && this.init();
+  },
+};
+</script>
+<style scoped lang="scss">
+uni-page-body {
+  position: relative;
+  height: 100%;
+}
+.icon {
+  width: 40rpx;
+  height: 40rpx;
+}
+.greenhouse-page {
+  background: linear-gradient(
+      180deg,
+      #ffffff00 0%,
+      #eff2fa 23.64%,
+      #eff2fa 100%
+    ),
+    linear-gradient(102deg, #bfeadd 6.77%, #b8f1e7 40.15%, #b9eef5 84.02%);
+  min-height: 100vh;
+  width: 100%;
+  overflow-x: hidden;
+  overflow-y: scroll;
+  .greenhouse-top {
+    text-align: center;
+    margin: 0 auto;
+    margin-top: 18rpx;
+    padding: 0 30rpx;
+  }
+  .greenhouse-bottom {
+    width: calc(100% - 128rpx);
+    padding: 32rpx 32rpx 1rpx 32rpx;
+    background: #ffffff;
+    border-radius: 16rpx;
+    margin: 0 auto;
+    margin-top: 32rpx;
+    .greenhouse-bottom-header {
+      display: flex;
+      justify-content: space-between;
+      color: #042118;
+      font-family: 'Source Han Sans CN VF';
+      font-size: 28rpx;
+      font-weight: 700;
+      margin-bottom: 24rpx;
+      .reload {
+        color: #14a478;
+        font-size: 38rpx;
+        font-weight: 700;
+      }
+    }
+  }
+}
+</style>

+ 308 - 180
pages/equipList/index.vue

@@ -8,8 +8,14 @@
     <view class="textbox">
       <view class="inputs">
         <!-- <u-input v-model="imports" type="text" :border="true" /> -->
-        <u-search placeholder="请输入设备ID" v-model="imports" placeholder-color="#909696" :show-action="false"
-          search-icon-color="#909696" @input="searchinput">
+        <u-search
+          placeholder="请输入设备ID"
+          v-model="imports"
+          placeholder-color="#909696"
+          :show-action="false"
+          search-icon-color="#909696"
+          @input="searchinput"
+        >
         </u-search>
         <!-- <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinput"
 					class="inputbox" :clearable="false" />
@@ -17,41 +23,82 @@
       </view>
       <view class="listbox">
         <view class="listbox_left">
-          <view :class="currents == index
-            ? 'listbox_left_item_act listbox_left_item'
-            : 'listbox_left_item'
-            " v-for="(item, index) in list" :key="index" @click="change(index)">
+          <view
+            :class="
+              currents == index
+                ? 'listbox_left_item_act listbox_left_item'
+                : 'listbox_left_item'
+            "
+            v-for="(item, index) in list"
+            :key="index"
+            @click="change(index)"
+          >
             {{ item.name }}
           </view>
         </view>
         <!-- <view class="list" @scroll='showOut' ref="sollo" id="list"> -->
-        <scroll-view :scroll-top="0" :scroll-y="true" class="list scroll-Y" @scrolltoupper="upper" @scrolltolower="lower"
-          @scroll="scroll">
-          <view class="list_item" v-for="(item, index) in eqlistdata" :key="index" @click="historys(item)">
+        <scroll-view
+          :scroll-top="0"
+          :scroll-y="true"
+          class="list scroll-Y"
+          @scrolltoupper="upper"
+          @scrolltolower="lower"
+          @scroll="scroll"
+        >
+          <view
+            class="list_item"
+            v-for="(item, index) in eqlistdata"
+            :key="index"
+            @click="historys(item)"
+          >
             <view class="list_item_top">
               <p class="p1">
-                <image :src="'http://www.hnyfwlw.com:8006/bigdata_app/image/fourMoodBase/' +
-                  type_id +
-                  '.png'
-                  " mode=""></image>
-                <view>{{ item.device_name == "" ? "--" : item.device_name }}</view>
+                <image
+                  :src="
+                    'http://www.hnyfwlw.com:8006/bigdata_app/image/fourMoodBase/' +
+                    type_id +
+                    '.png'
+                  "
+                  mode=""
+                ></image>
+                <view>{{
+                  item.device_name == '' ? '--' : item.device_name
+                }}</view>
               </p>
-              <p v-if="![11, 19, 20].includes(type_id)" :class="[item.is_online ? 'p2' : 'p_out']">
-                {{ item.is_online ? "在线" : "离线" }}
+              <p
+                v-if="![11, 19, 20].includes(type_id)"
+                :class="[item.is_online ? 'p2' : 'p_out']"
+              >
+                {{ item.is_online ? '在线' : '离线' }}
               </p>
             </view>
             <view class="list_item_text">
               <p>设备ID:{{ item.only_for_show || item.device_id }}</p>
               <p>
-                适配用户:{{ item.real_name == "" ? "无" : item.real_name }}
+                适配用户:{{ item.real_name == '' ? '无' : item.real_name }}
               </p>
-              <p>最新上报时间:{{ (item.uptime) | timeFormat() }}</p>
-              <p v-if="item.addtime === 0">添加设备时间:- -</p>
-              <p v-else>添加设备时间:{{ item.addtime | timeFormat() }}</p>
+
+              <p v-if="type_id == 40 || type_id == 42">
+                最新上报时间:{{ item.uptime }}
+              </p>
+              <p v-else>最新上报时间:{{ item.uptime | timeFormat() }}</p>
+              <p v-if="type_id == 40 || type_id == 42">
+                添加设备时间:{{ item.addtime }}
+              </p>
+              <span v-else>
+                <p v-if="item.addtime === 0">添加设备时间:- -</p>
+                <p v-else>添加设备时间:{{ item.addtime | timeFormat() }}</p>
+              </span>
               <p>设备已运行:{{ item.days }}天</p>
             </view>
-            <view class="list_item_btn" v-if="$QueryPermission(108) && ![13, 17, 18, 11, 19, 20, 14, 22, 25].includes(type_id)"
-              @click.stop="modification(item)">
+            <view
+              class="list_item_btn"
+              v-if="
+                $QueryPermission(108) &&
+                ![13, 17, 18, 11, 19, 20, 14, 22, 25].includes(type_id)
+              "
+              @click.stop="modification(item)"
+            >
               信息修改
             </view>
           </view>
@@ -68,18 +115,26 @@
 			</view>
 		</view> -->
     <view class="loading" v-if="loadingtf">
-      <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
+      <image
+        src="../../static/images/ajax-loader.gif"
+        mode=""
+        class="img"
+      ></image>
     </view>
     <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>
 
 <script>
-import { Debounce, Throttle } from "../../util/anitthro.js";
+import { Debounce, Throttle } from '../../util/anitthro.js';
 export default {
   data() {
     return {
@@ -90,27 +145,86 @@ export default {
       size: 10,
       eqlistdata: [],
       isTop: false,
-	  device_model: 0,
+      device_model: 0,
       infoalter: false, // 权限设置,
       type_id: 0, //设备类型,
       imgpath: [],
       loadingtf: false,
       width: 0, //顶部搜索栏宽度
-      imports: "", //搜索设备ID
+      imports: '', //搜索设备ID
     };
   },
   methods: {
+    // 大棚
+    async getDpDeviceList(tf) {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/dpkzg/yf/list/',
+        method: 'post',
+        data: {
+          pageSize: this.size,
+          pageNum: this.page,
+        },
+      });
+      this.loadingtf = false;
+      const eqlistdata = res || [];
+      eqlistdata.forEach((item) => {
+        const newtime = +new Date() / 1000;
+        const days = (newtime - item.addtime) / 60 / 60 / 24;
+        item.days = Math.round(days);
+        item.device_id = item.devCode;
+        item.uptime = item.devUpdateddate;
+        item.addtime = item.devCreateddate;
+        item.device_name = item.devName;
+        item.real_name = item.realName;
+        item.is_online = item.devStatus == 1 ? true : false;
+      });
+      this.eqlistdata = eqlistdata;
+    },
+    // 水肥
+    async getDeviceList(tf) {
+      const res = await this.$myRequest({
+        url: '/api/v2/iot/mobile/device/sf/zsrf/list/',
+        method: 'post',
+        data: {
+          pageSize: this.size,
+          pageNum: this.page,
+        },
+      });
+      this.loadingtf = false;
+      const eqlistdata = res || [];
+      eqlistdata.forEach((item) => {
+        const newtime = +new Date() / 1000;
+        const days = (newtime - item.addtime) / 60 / 60 / 24;
+        item.days = Math.round(days);
+        item.device_id = item.devCode;
+        item.uptime = item.devUpdateddate;
+        item.addtime = item.devCreateddate;
+        item.device_name = item.devName;
+        item.real_name = item.realName;
+        item.is_online = item.devStatus == 1 ? true : false;
+      });
+      this.eqlistdata = eqlistdata;
+    },
     async eqlist(tf) {
       //设备列表
       this.loadingtf = true;
+      console.log(this.type_id, 'type_idtype_id');
+      if (this.type_id == 42) {
+        this.getDpDeviceList(tf);
+        return;
+      }
+      if (this.type_id == 40) {
+        this.getDeviceList(tf);
+        return;
+      }
       const res = await this.$myRequest({
-        url: "/api/api_gateway?method=forecast.worm_lamp.lamp_list",
+        url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
         data: {
           device_type_id: this.type_id,
           page: this.page,
           page_size: this.size,
           device_id: this.imports,
-		  device_model: this.device_model
+          device_model: this.device_model,
         },
       });
       this.loadingtf = false;
@@ -119,13 +233,13 @@ export default {
       } else {
         var newtime = +new Date() / 1000;
       }
-	  res.data.forEach(item => {
-		  let { uptime, addtime } = item;
-		  item.uptime = addtime;
-		  item.addtime = uptime;
-		  var days = (newtime - item.addtime) / 60 / 60 / 24;
-		  item.days = Math.round(days);
-	  })
+      res.data.forEach((item) => {
+        let { uptime, addtime } = item;
+        item.uptime = addtime;
+        item.addtime = uptime;
+        var days = (newtime - item.addtime) / 60 / 60 / 24;
+        item.days = Math.round(days);
+      });
       if (tf) {
         this.eqlistdata = this.eqlistdata.concat(res.data);
       } else {
@@ -141,7 +255,7 @@ export default {
       //设备列表
       this.loadingtf = true;
       const res = await this.$myRequest({
-        url: "/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list",
+        url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
         data: {
           device_type_id: this.type_id,
           page: this.page,
@@ -166,7 +280,7 @@ export default {
     async camera() {
       //监控
       const res = await this.$myRequest({
-        url: "/api/api_gateway?method=camera.camera_manage.list_camera",
+        url: '/api/api_gateway?method=camera.camera_manage.list_camera',
         data: {
           page_size: 1,
         },
@@ -177,27 +291,25 @@ export default {
     async usertype() {
       //设备列表
       const res = await this.$myRequest({
-        url: "/api/api_gateway?method=home.homes.user_device_type",
+        url: '/api/api_gateway?method=home.homes.user_device_type',
       });
       console.log(res);
       for (var i = 0; i < res.length; i++) {
-        if (
-          res[i].type_name == "温室大棚"
-        ) {
+        if (res[i].type_name == '温室大棚') {
           continue;
         }
         var obj = {
           name: res[i].type_name,
           id: res[i].id,
-		  device_model: res[i].device_model,
-		  pur_id:res[i].pur_id
+          device_model: res[i].device_model,
+          pur_id: res[i].pur_id,
         };
         this.list.push(obj);
       }
-      console.log("设备列表11111111111111", this.list);
+      console.log('设备列表11111111111111', this.list);
       if (res.length) {
         this.type_id = this.list[0].id;
-		this.device_model = this.list[0].device_model;
+        this.device_model = this.list[0].device_model;
         if (this.list[0].id == 10) {
           this.xyeqlist();
         } else {
@@ -208,29 +320,28 @@ export default {
     change(index) {
       console.log(index);
       //头部导航栏的点击
-      this.imports = "";
+      this.imports = '';
       this.current = index;
       this.currents = index;
       this.page = 1;
       this.eqlistdata = [];
       this.type_id = this.list[index].id;
-	  this.device_model = this.list[index].device_model;
+      this.device_model = this.list[index].device_model;
       console.log(this.type_id);
       if (this.list[index].id == 10) {
         this.xyeqlist();
       } else {
         this.eqlist();
       }
-	  
     },
     clickRight() {
       //搜索
-      this.width = "90%";
+      this.width = '90%';
     },
     modification(item) {
       uni.navigateTo({
         url:
-          "./modification?data=" + JSON.stringify(item) + "&id=" + this.type_id,
+          './modification?data=' + JSON.stringify(item) + '&id=' + this.type_id,
       });
     },
     top() {
@@ -240,36 +351,36 @@ export default {
       });
     },
     historys(itemOld) {
-    	let item = JSON.parse(JSON.stringify(itemOld))
-    	console.log("item", item,this.type_id);
-		item.pur_id = this.list[this.current].pur_id
+      let item = JSON.parse(JSON.stringify(itemOld));
+      console.log('item', item, this.type_id);
+      item.pur_id = this.list[this.current].pur_id;
       switch (this.type_id) {
-		// 水肥新设备
-		case 22:
-		var obj = {};
-		obj.d_id = item.d_id;
-		obj.device_id = item.imei;
-		obj.is_online = item.is_online;
-		obj.lat = item.lat;
-		obj.lng = item.lng;
-		obj.equip_name = item.device_name;
-		obj.uptime = item.uptime;
-		uni.navigateTo({
-		  url: "../waterandfernew/details?shebei=" + JSON.stringify(obj),
-		});
-		break
+        // 水肥新设备
+        case 22:
+          var obj = {};
+          obj.d_id = item.d_id;
+          obj.device_id = item.imei;
+          obj.is_online = item.is_online;
+          obj.lat = item.lat;
+          obj.lng = item.lng;
+          obj.equip_name = item.device_name;
+          obj.uptime = item.uptime;
+          uni.navigateTo({
+            url: '../waterandfernew/details?shebei=' + JSON.stringify(obj),
+          });
+          break;
         // 病虫害可视监测
         case 14:
-		item.addtime = item.uptime;
+          item.addtime = item.uptime;
           uni.navigateTo({
-            url: "../cb/sy/detail?detail=" + JSON.stringify(item),
+            url: '../cb/sy/detail?detail=' + JSON.stringify(item),
           });
-          break
+          break;
         case 2:
-		item.addtime = item.uptime;
+          item.addtime = item.uptime;
           uni.navigateTo({
             url:
-              "../prevention/equipmentdetails?shebei=" + JSON.stringify(item),
+              '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
           });
           break;
         case 5:
@@ -283,76 +394,81 @@ export default {
           obj.equip_name = item.device_name;
           obj.uptime = item.uptime;
           uni.navigateTo({
-            url: "../environment/equipment?shebei=" + JSON.stringify(obj),
+            url: '../environment/equipment?shebei=' + JSON.stringify(obj),
           });
           break;
         case 6:
-			uni.navigateTo({
-				url: "/pages/webview/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken
-			})
+          uni.navigateTo({
+            url:
+              '/pages/webview/webview?device_id=' +
+              item.imei +
+              '&accessToken=' +
+              this.accessToken,
+          });
           break;
         case 3:
-		item.addtime = item.uptime;
+          item.addtime = item.uptime;
+          item.type = this.type_id;
+          uni.navigateTo({
+            url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
+          });
+          break;
+        case 28:
+          item.addtime = item.uptime;
           item.type = this.type_id;
           uni.navigateTo({
-            url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item),
+            url: '../cb/smallPest/smallPest?info=' + JSON.stringify(item),
           });
           break;
-		case 28:
-		item.addtime = item.uptime;
-		item.type = this.type_id;
-		uni.navigateTo({
-			url: "../cb/smallPest/smallPest?info=" + JSON.stringify(item),
-		});
-	  break; 
         case 4:
-		item.addtime = item.uptime;
+          item.addtime = item.uptime;
           item.type = this.type_id;
           uni.navigateTo({
-            url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item),
-          }); 
+            url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
+          });
+          break;
+        case 32:
+        case 33:
+        case 34:
+        case 35:
+          item.addtime = item.uptime;
+          item.type = this.type_id;
+          uni.navigateTo({
+            url:
+              '../cb/equip-detail/equip-detail-new?info=' +
+              JSON.stringify(item),
+          });
           break;
-		case 32:
-		case 33:
-		case 34:
-		case 35:
-		
-		item.addtime = item.uptime;
-		  item.type = this.type_id;
-		  uni.navigateTo({
-		    url: "../cb/equip-detail/equip-detail-new?info=" + JSON.stringify(item),
-		  }); 
-		  break;  
         case 7:
-		item.addtime = item.uptime;
+          item.addtime = item.uptime;
           item.type = this.type_id;
           uni.navigateTo({
-            url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item),
+            url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
           });
           break;
         case 8:
           // item.type = this.type_id;
           uni.navigateTo({
-            url: "../cb/thxydetail/thxydetail?imei=" + item.imei
+            url: '../cb/thxydetail/thxydetail?imei=' + item.imei,
+          });
+          break;
+        case 29:
+          // item.type = this.type_id;
+          uni.navigateTo({
+            url: `../cb/nlNewXy/nlNewXy?imei=${item.imei}&showId=${item.only_for_show}`,
+          });
+          break;
+        case 24:
+          // item.type = this.type_id;
+          uni.navigateTo({
+            url: '../cb/zjxydetail/thxydetail?imei=' + item.imei,
           });
           break;
-		  case 29:
-		    // item.type = this.type_id;
-		    uni.navigateTo({
-		      url: `../cb/nlNewXy/nlNewXy?imei=${item.imei}&showId=${item.only_for_show}`
-		    });
-		    break;
-		  case 24:
-		    // item.type = this.type_id;
-		    uni.navigateTo({
-		      url: "../cb/zjxydetail/thxydetail?imei=" + item.imei
-		    });
-		    break;
         case 12:
           console.log(item);
-		  item.addtime = item.uptime;
+          item.addtime = item.uptime;
           uni.navigateTo({
-            url: "../cb/xctdetail/xctdetail?info=" + JSON.stringify(item),
+            url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
           });
           break;
         case 13:
@@ -366,7 +482,7 @@ export default {
           obj.equip_name = item.device_name;
           obj.uptime = item.uptime;
           uni.navigateTo({
-            url: "../waterandfer/datails?shebei=" + JSON.stringify(obj),
+            url: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
           });
           break;
         case 15:
@@ -380,7 +496,7 @@ export default {
           obj.equip_name = item.device_name;
           obj.uptime = item.uptime;
           uni.navigateTo({
-            url: "../environment/gsequipment?shebei=" + JSON.stringify(obj),
+            url: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
           });
           break;
         case 17:
@@ -390,7 +506,7 @@ export default {
           obj.device_id = item.imei;
           obj.is_online = item.is_online;
           uni.navigateTo({
-            url: "../cb/shuifeiL/shuifeiL?detail=" + JSON.stringify(obj),
+            url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
           });
           break;
         case 11:
@@ -405,7 +521,7 @@ export default {
           obj.location = item.address;
           obj.type = 11;
           uni.navigateTo({
-            url: "../disease/cmb?shebei=" + JSON.stringify(obj),
+            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
           });
           break;
         case 19:
@@ -420,7 +536,7 @@ export default {
           obj.location = item.address;
           obj.type = 19;
           uni.navigateTo({
-            url: "../disease/cmb?shebei=" + JSON.stringify(obj),
+            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
           });
           break;
         case 20:
@@ -435,7 +551,7 @@ export default {
           obj.location = item.address;
           obj.type = 20;
           uni.navigateTo({
-            url: "../disease/cmb?shebei=" + JSON.stringify(obj),
+            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
           });
           break;
         case 21:
@@ -450,50 +566,63 @@ export default {
           obj.location = item.address;
           obj.type = 21;
           uni.navigateTo({
-            url: "../disease/cmb?shebei=" + JSON.stringify(obj),
+            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
+          });
+          break;
+        case 26:
+          var obj = {};
+          obj.d_id = item.d_id;
+          obj.device_id = item.imei;
+          obj.is_online = item.is_online;
+          obj.lat = item.lat;
+          obj.lng = item.lng;
+          obj.equip_name = item.device_name;
+          obj.uptime = item.uptime;
+          obj.location = item.address;
+          obj.type = 26;
+          uni.navigateTo({
+            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
+          });
+          break;
+        case 27:
+          var obj = {};
+          obj.d_id = item.d_id;
+          obj.device_id = item.imei;
+          obj.is_online = item.is_online;
+          obj.lat = item.lat;
+          obj.lng = item.lng;
+          obj.equip_name = item.device_name;
+          obj.uptime = item.uptime;
+          obj.location = item.address;
+          obj.type = 26;
+          uni.navigateTo({
+            url: '../disease/mls/mls?shebei=' + JSON.stringify(obj),
+          });
+          break;
+        case 25:
+          item.addtime = item.uptime;
+          uni.navigateTo({
+            url: '../cb/xylps/detail?detail=' + JSON.stringify(item),
           });
           break;
-		  case 26:
-		    var obj = {};
-		    obj.d_id = item.d_id;
-		    obj.device_id = item.imei;
-		    obj.is_online = item.is_online;
-		    obj.lat = item.lat;
-		    obj.lng = item.lng;
-		    obj.equip_name = item.device_name;
-		    obj.uptime = item.uptime;
-		    obj.location = item.address;
-		    obj.type = 26;
-		    uni.navigateTo({
-		      url: "../disease/cmb?shebei=" + JSON.stringify(obj),
-		    });
-		    break;
-			case 27:
-			  var obj = {};
-			  obj.d_id = item.d_id;
-			  obj.device_id = item.imei;
-			  obj.is_online = item.is_online;
-			  obj.lat = item.lat;
-			  obj.lng = item.lng;
-			  obj.equip_name = item.device_name;
-			  obj.uptime = item.uptime;
-			  obj.location = item.address;
-			  obj.type = 26;
-			  uni.navigateTo({
-			    url: "../disease/mls/mls?shebei=" + JSON.stringify(obj),
-			  });
-			  break;
-		  case 25:
-			item.addtime = item.uptime;
-		    uni.navigateTo({
-		      url:  "../cb/xylps/detail?detail=" + JSON.stringify(item),
-		    });
-		    break;
         default:
-			item.addtime = item.uptime;
+          item.addtime = item.uptime;
           item.type = this.type_id;
           uni.navigateTo({
-            url: "../cb/xy2.0/particulars?info=" + JSON.stringify(item),
+            url: '../cb/xy2.0/particulars?info=' + JSON.stringify(item),
+          });
+          break;
+        case 40:
+          item.addtime = item.uptime;
+          console.log(item, 'itemmtiemtiemtiemtie');
+          uni.navigateTo({
+            url: `../cb/shuifeizs/shuifeizs?devBid=${item.devBid}&devName=${item.devName}&devStatus=${item.devStatus}`,
+          });
+          break;
+        case 42:
+          item.addtime = item.uptime;
+          uni.navigateTo({
+            url: `../cb/wenshizs/wenshizs?devBid=${item.devBid}&devName=${item.device_name}&devStatus=${item.devStatus}`,
           });
           break;
       }
@@ -522,9 +651,8 @@ export default {
     scrollTop(e) {
       console.log(e);
     },
-    upper() { },
+    upper() {},
     lower() {
-      
       this.page++;
       if (this.type_id == 10) {
         this.xyeqlist(true);
@@ -532,7 +660,7 @@ export default {
         this.eqlist(true);
       }
     },
-    scroll() { },
+    scroll() {},
   },
   onLoad() {
     // this.list = [];
@@ -543,16 +671,16 @@ export default {
     // this.usertype();
     // this.width = 0;
   },
-  onTabItemTap (e) {
-	  // console.log(e);
-	this.eqlistdata = [];
-  	this.list = [];
-  	this.camera();
-  	this.current = 0;
-  	this.currents = 0;
-  	this.page = 1;
-  	this.usertype();
-  	this.width = 0;
+  onTabItemTap(e) {
+    // console.log(e);
+    this.eqlistdata = [];
+    this.list = [];
+    this.camera();
+    this.current = 0;
+    this.currents = 0;
+    this.page = 1;
+    this.usertype();
+    this.width = 0;
   },
   onReachBottom() {
     this.page++;
@@ -596,8 +724,8 @@ page {
 }
 
 .inputs {
-	width: 95%;
-	margin: 0 auto;
+  width: 95%;
+  margin: 0 auto;
   /deep/.u-content {
     background-color: #fff !important;
   }
@@ -730,7 +858,7 @@ page {
         font-size: 24rpx;
         color: #636363;
         margin-top: 10rpx;
-		word-break: break-all;
+        word-break: break-all;
       }
 
       p:first-child {

BIN
static/images/cb/controlbg.png


+ 92 - 72
util/api.js

@@ -1,74 +1,94 @@
-// let BASE_URL = 'http://114.55.0.7:8002'
+// 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 = 'https://wx.hnyfwlw.com'
-// let BASE_URL = 'http://218.28.198.186:10505'
-export const myRequest=(options)=>{
-	// BASE_URL=uni.getStorageSync('http')
-	// if(BASE_URL==''){
-	// 	BASE_URL = 'https://wx.hnyfwlw.com/'
-	// }
-	// console.log(BASE_URL) 
-	var session_key="";
-	session_key=uni.getStorageSync('session_key');
-	let url=options.url
-	let data=options.data||{}
-	  if (url != 'user.login.login_user' && url != 'pest.pests.insect_discern' &&
-		url != 'pest.pests.plant_discern' &&
-		url != 'pest.pests.pests_contrast' && url != 'pest.pests.pests_expert_img' &&
-		url != 'pest.pests.pests_img' && url != 'recognizationSys' &&
-		url != 'base.bases.base_photo' && url != 'pest.warning_record.rolemanage_img' &&
-		url != 'home.homes.personal_photo' && url != 'ascend.ascend_manage.product_info' &&
-		url != 'ascend.ascend_manage.quality_info' && url != 'ascend.ascend_manage.grow_info' &&
-		url != 'ascend.ascend_manage.all_ascend' && url != 'after_sale.after_sale_manage.device_check' &&
-		url != 'after_sale.after_sale_manage.aftersale_apply') {
-			data.token=session_key
-	  }
-	
-	return new Promise((resolve,reject)=>{
-		uni.request({
-			url:BASE_URL+options.url,
-			method:options.method||'POST',
-			header:{
-				"Content-Type": "application/x-www-form-urlencoded",
-				},
-			data:data,
-			success:(res)=>{
-				if(res.data.errorCode == 403) {
-					uni.removeStorageSync('session_key');
-					uni.showToast({
-						title: '登录已过期,请重新登录!',
-						icon: "none"
-					})
-					if(uni.getStorageSync('isLink')) {
-						return false
-					} else {
-						uni.setStorageSync('isLink', true);
-						return uni.navigateTo({
-							url: '/pages/login/login'
-						});
-					}
-				}
-				if (res.data.message) {
-					if(res.data.message !== "识别无结果" && res.data.message !== "该设备未绑定SIM"){
-						return uni.showToast({
-							title: res.data.message,
-							icon: "none"
-						})
-					}else{
-						resolve(res.data.data)
-					}
-				} 
-				resolve(res.data.data)
-			},
-			fail:(err)=>{
-				uni.showToast({
-					title:'请求接口失败',
-					icon:"none"
-				})
-				reject(err)
-			}
-		})
-	})
-}
+let BASE_URL = 'https://wx.hnyfwlw.com';
+// let BASE_URL = 'https://wx.hnyfwlw.com';
+// let BASE_URL = 'http://218.28.198.186:10508';
+export const myRequest = (options) => {
+  // BASE_URL=uni.getStorageSync('http')
+  // if(BASE_URL==''){
+  // 	BASE_URL = 'https://wx.hnyfwlw.com/'
+  // }
+  // console.log(BASE_URL)
+  var session_key = '';
+  session_key = uni.getStorageSync('session_key');
+  let url = options.url;
+  let data = options.data || {};
+  if (
+    url != 'user.login.login_user' &&
+    url != 'pest.pests.insect_discern' &&
+    url != 'pest.pests.plant_discern' &&
+    url != 'pest.pests.pests_contrast' &&
+    url != 'pest.pests.pests_expert_img' &&
+    url != 'pest.pests.pests_img' &&
+    url != 'recognizationSys' &&
+    url != 'base.bases.base_photo' &&
+    url != 'pest.warning_record.rolemanage_img' &&
+    url != 'home.homes.personal_photo' &&
+    url != 'ascend.ascend_manage.product_info' &&
+    url != 'ascend.ascend_manage.quality_info' &&
+    url != 'ascend.ascend_manage.grow_info' &&
+    url != 'ascend.ascend_manage.all_ascend' &&
+    url != 'after_sale.after_sale_manage.device_check' &&
+    url != 'after_sale.after_sale_manage.aftersale_apply'
+  ) {
+    data.token = session_key;
+  }
+
+  return new Promise((resolve, reject) => {
+    uni.request({
+      url: BASE_URL + options.url,
+      method: options.method || 'POST',
+      header: options.header || {
+        'Content-Type': 'application/x-www-form-urlencoded',
+      },
+      data: data,
+      success: (res) => {
+        if (res.data.errorCode == 403) {
+          uni.removeStorageSync('session_key');
+          uni.showToast({
+            title: '登录已过期,请重新登录!',
+            icon: 'none',
+          });
+          if (uni.getStorageSync('isLink')) {
+            return false;
+          } else {
+            uni.setStorageSync('isLink', true);
+            return uni.navigateTo({
+              url: '/pages/login/login',
+            });
+          }
+        }
+        if (res.data.message) {
+          if (
+            res.data.message !== '识别无结果' &&
+            res.data.message !== '该设备未绑定SIM'
+          ) {
+            return uni.showToast({
+              title: res.data.message,
+              icon: 'none',
+            });
+          } else {
+            resolve(res.data.data);
+          }
+        }
+        if (options.header) {
+          resolve(res.data);
+          return;
+        }
+        if (res.data.data) {
+          resolve(res.data.data);
+        } else {
+          resolve(res.data);
+        }
+      },
+      fail: (err) => {
+        uni.showToast({
+          title: '请求接口失败',
+          icon: 'none',
+        });
+        reject(err);
+      },
+    });
+  });
+};