Browse Source

feat: 设备添加

allen 19 hours atrás
parent
commit
3ca5b3c00f

+ 22 - 6
pages.json

@@ -54,6 +54,18 @@
 				}
 			]
 		},
+    {
+			"root": "pages/fmSys",
+			"pages": [{
+					"path": "details",
+					"style": {
+						"navigationBarTitleText": "",
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
+					}
+				}
+			]
+		},
 		{
 			"root": "pages/cb/shuifeizs",
 			"pages": [{
@@ -120,6 +132,15 @@
 			}]
 		},
 		{
+			"root": "pages/webviewdgp",
+			"pages": [{
+				"path": "webview",
+				"style": {
+					"navigationBarTitleText": "监控列表"
+				}
+			}]
+		},
+		{
 			"root": "pages/disandpests",
 			"pages": [{
 				"path": "index",
@@ -239,7 +260,6 @@
 					"path": "xctset",
 					"style": {
 						"navigationBarTitleText": "设备控制"
-						// "navigationStyle": "custom"
 					}
 				}
 			]
@@ -785,7 +805,6 @@
 					"style": {
 						"navigationBarTitleText": "sim卡详情",
 						"enablePullDownRefresh": false
-						// "navigationStyle": "custom"
 					}
 				},
 				{
@@ -951,7 +970,6 @@
 					"path": "mls/forecastResult",
 					"style": {
 						"navigationBarTitleText": "防控决策"
-						// "navigationStyle": "custom"
 					}
 				}
 			]
@@ -971,7 +989,6 @@
 					"style": {
 						"navigationBarTitleText": "设备位置",
 						"enablePullDownRefresh": false
-						// "navigationStyle": "custom"
 					}
 				},
 				{
@@ -1178,8 +1195,7 @@
 		}
 	],
 	"condition": {
-		//模式配置,仅开发期间生效
-		"current": 3, //当前激活的模式(list 的索引项)
+		"current": 3,
 		"list": [{
 				"name": "about",
 				"path": "pages/my/about/about"

+ 0 - 911
pages/equipList - 副本/index.vue

@@ -1,911 +0,0 @@
-<template>
-  <view>
-    <!-- <view class="status_bar"></view>
-		<view style="position: fixed;top:44px;z-index: 100;width: 100%;">
-			<uni-nav-bar right-icon="search" title="设备列表" @clickRight="clickRight"></uni-nav-bar>
-			
-		</view> -->
-    <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>
-        <!-- <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinput"
-					class="inputbox" :clearable="false" />
-				<u-icon name="search" size="40" class="icon" @click="search"></u-icon> -->
-      </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)"
-          >
-            {{ 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)"
-          >
-            <view class="list_item_top">
-              <p class="p1">
-                <image
-                  :src="
-                    $imageURL+'/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>
-            </view>
-            <view class="list_item_text">
-              <p>设备ID:{{ item.only_for_show || item.device_id }}</p>
-              <p>
-                适配用户:{{ item.real_name == '' ? '无' : item.real_name }}
-              </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>
-          </view>
-        </scroll-view>
-
-        <!-- </view> -->
-      </view>
-    </view>
-
-    <!-- <view class="utabs_box">
-			<view class="utabs">
-				<u-tabs :list="list" :is-scroll="true" :current="currents" @change="change" item-width="140"
-					font-size="24" gutter="20" bar-width="60" active-color="#42b983" v-if="list.length"></u-tabs>
-			</view>
-		</view> -->
-    <view class="loading" v-if="loadingtf">
-      <image
-        src="../../static/images/ajax-loader.gif"
-        mode=""
-        class="img"
-      ></image>
-    </view>
-    <view class="top" v-if="isTop" @click="top">
-      <image
-        :src="
-          $imageURL+'/bigdata_app' +
-          '/image/6209a98f0cb3b5086f2ca36152c9269.png'
-        "
-        mode=""
-      ></image>
-    </view>
-  </view>
-</template>
-
-<script>
-import { Debounce, Throttle } from '../../util/anitthro.js';
-export default {
-  data() {
-    return {
-      list: [],
-      current: 0,
-      currents: 0,
-      page: 1,
-      size: 10,
-      eqlistdata: [],
-      isTop: false,
-      device_model: 0,
-      infoalter: false, // 权限设置,
-      type_id: 0, //设备类型,
-      imgpath: [],
-      loadingtf: false,
-      width: 0, //顶部搜索栏宽度
-      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',
-        data: {
-          device_type_id: this.type_id,
-          page: this.page,
-          page_size: this.size,
-          device_id: this.imports,
-          device_model: this.device_model,
-        },
-      });
-      this.loadingtf = false;
-      if ([11, 19, 20].includes(Number(this.type_id))) {
-        var newtime = +new Date() / 1000;
-      } 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);
-      });
-      if (tf) {
-        this.eqlistdata = this.eqlistdata.concat(res.data);
-      } else {
-        this.eqlistdata = res.data;
-      }
-      console.log(this.eqlistdata);
-      // for (var i = 0; i < this.eqlistdata.length; i++) {
-      //   var days = (newtime - this.eqlistdata[i].addtime) / 60 / 60 / 24;
-      //   this.eqlistdata[i].days = Math.round(days);
-      // }
-    },
-    async xyeqlist(tf) {
-      //设备列表
-      this.loadingtf = true;
-      const res = await this.$myRequest({
-        url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
-        data: {
-          device_type_id: this.type_id,
-          page: this.page,
-          page_size: this.size,
-          device_id: this.imports,
-        },
-      });
-      this.loadingtf = false;
-      var newtime = +new Date() / 1000;
-      if (tf) {
-        this.eqlistdata = this.eqlistdata.concat(res.data);
-      } else {
-        this.eqlistdata = res.data;
-      }
-      for (var i = 0; i < this.eqlistdata.length; i++) {
-        var days = (newtime - this.eqlistdata[i].addtime) / 60 / 60 / 24;
-        this.eqlistdata[i].days = Math.round(days);
-      }
-      console.log(res);
-    },
-    //camera.camera_manage.list_camera
-    async camera() {
-      //监控
-      const res = await this.$myRequest({
-        url: '/api/api_gateway?method=camera.camera_manage.list_camera',
-        data: {
-          page_size: 1,
-        },
-      });
-      this.accessToken = res.accessToken;
-    },
-    // homes.user_device_type
-    async usertype() {
-      //设备列表
-      const res = await this.$myRequest({
-        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 == '温室大棚') {
-          continue;
-        }
-        var obj = {
-          name: res[i].type_name,
-          id: res[i].id,
-          device_model: res[i].device_model,
-          pur_id: res[i].pur_id,
-        };
-        this.list.push(obj);
-      }
-      console.log('设备列表11111111111111', this.list);
-      if (res.length) {
-        this.type_id = this.list[0].id;
-        this.device_model = this.list[0].device_model;
-        if (this.list[0].id == 10) {
-          this.xyeqlist();
-        } else {
-          this.eqlist();
-        }
-      }
-    },
-    change(index) {
-      console.log(index);
-      //头部导航栏的点击
-      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;
-      console.log(this.type_id);
-      if (this.list[index].id == 10) {
-        this.xyeqlist();
-      } else {
-        this.eqlist();
-      }
-    },
-    clickRight() {
-      //搜索
-      this.width = '90%';
-    },
-    modification(item) {
-      uni.navigateTo({
-        url:
-          './modification?data=' + JSON.stringify(item) + '&id=' + this.type_id,
-      });
-    },
-    top() {
-      uni.pageScrollTo({
-        scrollTop: 0,
-        duration: 500,
-      });
-    },
-    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;
-      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 14:
-          item.addtime = item.uptime;
-          uni.navigateTo({
-            url: '../cb/sy/detail?detail=' + JSON.stringify(item),
-          });
-          break;
-        case 2:
-          item.addtime = item.uptime;
-          uni.navigateTo({
-            url:
-              '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
-          });
-          break;
-		case 38:
-			// console.log(item);
-			var obj = {};
-			obj.d_id = item.d_id;
-			obj.equip_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: '../environment/equipment-new?shebei=' + JSON.stringify(obj),
-			});
-			break;
-        case 5:
-          console.log(item);
-          var obj = {};
-          obj.d_id = item.d_id;
-          obj.equip_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: '../environment/equipment?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 6:
-          uni.navigateTo({
-            url:
-              '/pages/webview/webview?device_id=' +
-              item.imei +
-              '&accessToken=' +
-              this.accessToken,
-          });
-          break;
-        case 3:
-          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/smallPest/smallPest?info=' + JSON.stringify(item),
-          });
-          break;
-        case 4:
-          item.addtime = item.uptime;
-          item.type = this.type_id;
-          uni.navigateTo({
-            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 7:
-          item.addtime = item.uptime;
-          item.type = this.type_id;
-          uni.navigateTo({
-            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,
-          });
-          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;
-          uni.navigateTo({
-            url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
-          });
-          break;
-        case 13:
-          console.log(item);
-          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: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 15:
-          console.log(item);
-          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: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 17:
-          break;
-        case 18:
-          var obj = {};
-          obj.device_id = item.imei;
-          obj.is_online = item.is_online;
-          uni.navigateTo({
-            url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
-          });
-          break;
-        case 11:
-          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 = 11;
-          uni.navigateTo({
-            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 19:
-          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 = 19;
-          uni.navigateTo({
-            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 20:
-          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 = 20;
-          uni.navigateTo({
-            url: '../disease/cmb?shebei=' + JSON.stringify(obj),
-          });
-          break;
-        case 21:
-          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 = 21;
-          uni.navigateTo({
-            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;
-        default:
-          item.addtime = item.uptime;
-          item.type = this.type_id;
-          uni.navigateTo({
-            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;
-      }
-    },
-    search() {
-      //搜索
-      this.eqlistdata = [];
-      this.page = 1;
-      if (this.list[this.currents].id == 10) {
-        this.xyeqlist();
-      } else {
-        this.eqlist();
-      }
-    },
-    searchinput() {
-      Debounce(() => {
-        this.eqlistdata = [];
-        this.page = 1;
-        if (this.list[this.currents].id == 10) {
-          this.xyeqlist();
-        } else {
-          this.eqlist();
-        }
-      }, 1000)();
-    },
-    scrollTop(e) {
-      console.log(e);
-    },
-    upper() {},
-    lower() {
-      this.page++;
-      if (this.type_id == 10) {
-        this.xyeqlist(true);
-      } else {
-        this.eqlist(true);
-      }
-    },
-    scroll() {},
-  },
-  onLoad() {
-    // 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++;
-    if (this.type_id == 10) {
-      this.xyeqlist(true);
-    } else {
-      this.eqlist(true);
-    }
-  },
-  onPageScroll(e) {
-    //nvue暂不支持滚动监听,可用bindingx代替
-    if (e.scrollTop > 200) {
-      //距离大于200时显示
-      this.isTop = true;
-    } else {
-      //距离小于200时隐藏
-      this.isTop = false;
-    }
-  },
-};
-</script>
-<style lang="scss">
-page {
-  background-color: #00b075;
-}
-
-/deep/.uni-icons {
-  font-size: 40rpx !important;
-}
-
-.textbox {
-  width: 100%;
-  height: calc(100vh - 30rpx);
-  padding: 20rpx 6rpx;
-  box-sizing: border-box;
-  border-top-left-radius: 80rpx;
-  border-top-right-radius: 80rpx;
-  margin-top: 30rpx;
-  background-color: #f9f9f9;
-  box-sizing: border-box;
-}
-
-.inputs {
-  width: 95%;
-  margin: 0 auto;
-  /deep/.u-content {
-    background-color: #fff !important;
-  }
-
-  /deep/.uni-input-wrapper {
-    background-color: #fff !important;
-  }
-}
-
-.utabs_box {
-  width: 100%;
-  position: fixed;
-  top: 88px;
-  background-color: #ffffff;
-  z-index: 100;
-
-  .utabs {
-    width: 95%;
-    margin: 0 auto;
-  }
-}
-
-.loading {
-  position: fixed;
-  top: 440px;
-  width: 95%;
-  left: 2.5%;
-  text-align: center;
-
-  .img {
-    width: 300rpx;
-    height: 40rpx;
-  }
-}
-
-.listbox {
-  display: flex;
-  justify-content: space-around;
-  height: calc(100vh - 150rpx);
-  margin-top: 20rpx;
-
-  .listbox_left {
-    background-color: #fff;
-    padding: 20rpx 10rpx 20rpx 0;
-    width: 240rpx;
-    overflow: auto;
-
-    .listbox_left_item {
-      height: 50rpx;
-      width: 100%;
-      margin-bottom: 20rpx;
-      text-align: center;
-      border-radius: 10rpx;
-      line-height: 50rpx;
-      overflow: hidden; //溢出隐藏
-      white-space: nowrap; //禁止换行
-      text-overflow: ellipsis; //...
-    }
-
-    .listbox_left_item_act {
-      background-color: rgba(0, 176, 117, 0.2);
-      color: #00b075;
-    }
-  }
-}
-
-.list {
-  width: calc(100vw - 300rpx);
-  background-color: #fdfdfd;
-  // margin-bottom: 100rpx;
-  overflow-y: auto;
-
-  .list_item {
-    width: 100%;
-    margin: 0 auto 20rpx;
-    padding: 20rpx 20rpx;
-    box-sizing: border-box;
-    position: relative;
-    background-color: #ffffff;
-    box-shadow: 0 0 10rpx #bcb9ca;
-
-    .list_item_top {
-      display: flex;
-      justify-content: space-between;
-
-      .p1 {
-        width: 86%;
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        height: 60rpx;
-        line-height: 60rpx;
-        font-size: 28rpx;
-        overflow: hidden;
-
-        image {
-          width: 40rpx;
-          height: 40rpx;
-          vertical-align: text-top;
-          margin-right: 20rpx;
-        }
-
-        view {
-          width: calc(100% - 40rpx);
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-        }
-      }
-
-      .p2 {
-        height: 60rpx;
-        line-height: 60rpx;
-        font-size: 28rpx;
-        color: #42b983;
-      }
-
-      .p_out {
-        height: 60rpx;
-        line-height: 60rpx;
-        font-size: 28rpx;
-        color: red;
-      }
-    }
-
-    .list_item_text {
-      margin-top: 20rpx;
-
-      p {
-        font-size: 24rpx;
-        color: #636363;
-        margin-top: 10rpx;
-        word-break: break-all;
-      }
-
-      p:first-child {
-        font-size: 28rpx;
-        font-weight: 700;
-      }
-    }
-
-    .list_item_btn {
-      width: 126rpx;
-      color: #42b983;
-      height: 40rpx;
-      text-align: center;
-      border: 1rpx solid #42b983;
-      border-radius: 25rpx;
-      font-size: 24rpx;
-      line-height: 35rpx;
-      position: absolute;
-      bottom: 15rpx;
-      right: 20rpx;
-    }
-  }
-}
-
-.top {
-  position: fixed;
-  right: 30px;
-  bottom: 100px;
-  z-index: 100;
-
-  image {
-    width: 100rpx;
-    height: 100rpx;
-  }
-}
-</style>

File diff suppressed because it is too large
+ 909 - 969
pages/equipList/index.vue


+ 12 - 0
pages/equipList/search.vue

@@ -261,6 +261,18 @@
 							url: "../cb/shuifeiL/shuifeiL?detail=" + JSON.stringify(obj),
 						});
 						break;
+          case 43:
+            uni.navigateTo({
+              url: "/pages/fmSys/details?info=" + JSON.stringify(item)
+            })
+          break;
+          case 44:
+            uni.navigateTo({
+              url: "/pages/webviewdgp/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken || uni
+                .getStorageSync('session_key') +
+                '&type=dgp'
+            })
+          break;
 					case 11:
 						var obj = {};
 						obj.d_id = item.d_id;

+ 995 - 0
pages/equipList2/index.vue

@@ -0,0 +1,995 @@
+<template>
+	<view>
+
+
+		<view class="textbox">
+			<view class="inputs">
+
+				<u-search placeholder="请输入设备ID" v-model="imports" placeholder-color="#909696" :show-action="false"
+					search-icon-color="#909696" @input="searchinput">
+				</u-search>
+
+			</view>
+			
+				<view class="tab">
+					<view class="tab-content">
+						<view class="tab-box">
+							<view v-for="(item,index) in menuList" :key="index" @click="change(index)"
+								:class="['tab-item',currents==index?'active':'']">
+								<image class="img-icon" :src="$imageURL+item.icon" mode=""></image>
+								<view class="text">{{item.name}}</view>
+							</view>
+
+						</view>
+					</view>
+				</view>
+				<view class="listbox">
+				<view class="second-tab">
+					<view class="tab-box">
+						<view v-for="(item,index) in list" :key="index" @click="change(index)"
+							:class="['tab-item',currents==index?'active':'']">
+							<text>{{item.name}}</text>
+
+						</view>
+
+					</view>
+				</view>
+				<view class="third-tab">
+					<view class="third-tab-item">总计</view>
+					<view class="third-tab-item">在线</view>
+					<view class="third-tab-item">离线</view>
+				</view>
+				<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"> <span class="title">{{ (item.device_name || '--' )| yfEllipsis(7)}}</span><span class="sub-title">{{ item.only_for_show || item.device_id }}</span></p>
+							
+							<p v-if="![11, 19, 20].includes(type_id)"  class="online-status">
+								<!-- {{ item.is_online ? '在线' : '离线' }} -->
+								<image v-if="item.is_online" :src="$imageURL+'/bigdata_app/newImg/home/online.png'" mode=""></image>
+								<image v-else :src="$imageURL+'/bigdata_app/newImg/home/outline.png'" mode=""></image>
+							</p>
+						</view>
+						<view class="list_item_text">
+							
+							<p v-if="type_id == 40 || type_id == 42">
+								<span class="label">上报时间</span> {{ item.uptime }}
+							</p>
+							<p v-else><span class="label">上报时间</span>{{ item.uptime | timeFormat() }}</p>
+							<p>
+								<span class="label">设备位置</span>{{ (item.address|| '无') | yfEllipsis(16)}}
+							</p>
+						</view>
+					</view>
+				</scroll-view>
+
+				<!-- </view> -->
+			</view>
+		</view>
+
+		<!-- <view class="utabs_box">
+			<view class="utabs">
+				<u-tabs :list="list" :is-scroll="true" :current="currents" @change="change" item-width="140"
+					font-size="24" gutter="20" bar-width="60" active-color="#42b983" v-if="list.length"></u-tabs>
+			</view>
+		</view> -->
+		<view class="loading" v-if="loadingtf">
+			<image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
+		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image :src="
+          $imageURL+'/bigdata_app' +
+          '/image/6209a98f0cb3b5086f2ca36152c9269.png'
+        " mode=""></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		Debounce,
+		Throttle
+	} from '../../util/anitthro.js';
+	export default {
+		data() {
+			return {
+				list: [],
+				current: 0,
+				currents: 0,
+				page: 1,
+				size: 10,
+				eqlistdata: [],
+				isTop: false,
+				device_model: 0,
+				infoalter: false, // 权限设置,
+				type_id: 0, //设备类型,
+				imgpath: [],
+				loadingtf: false,
+				width: 0, //顶部搜索栏宽度
+				imports: '', //搜索设备ID
+				menuList: [{
+					icon: '/bigdata_app/newImg/home/sqjd.png',
+					name: '四情基地',
+
+				}, {
+					icon: '/bigdata_app/newImg/home/zngg.png',
+					name: '智能灌溉',
+
+				}, {
+					icon: '/bigdata_app/newImg/home/yhgl.png',
+					name: '用户管理',
+				}, {
+					icon: '/bigdata_app/newImg/home/shfw.png',
+					name: '售后服务',
+
+				}, {
+					icon: '/bigdata_app/newImg/home/more.png',
+					name: '更多功能'
+				}, {
+					icon: '/bigdata_app/newImg/home/more.png',
+					name: '更多功能'
+				}]
+			};
+		},
+		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',
+					data: {
+						device_type_id: this.type_id,
+						page: this.page,
+						page_size: this.size,
+						device_id: this.imports,
+						device_model: this.device_model,
+					},
+				});
+				this.loadingtf = false;
+				if ([11, 19, 20].includes(Number(this.type_id))) {
+					var newtime = +new Date() / 1000;
+				} 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);
+				});
+				if (tf) {
+					this.eqlistdata = this.eqlistdata.concat(res.data);
+				} else {
+					this.eqlistdata = res.data;
+				}
+				console.log(this.eqlistdata);
+				// for (var i = 0; i < this.eqlistdata.length; i++) {
+				//   var days = (newtime - this.eqlistdata[i].addtime) / 60 / 60 / 24;
+				//   this.eqlistdata[i].days = Math.round(days);
+				// }
+			},
+			async xyeqlist(tf) {
+				//设备列表
+				this.loadingtf = true;
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
+					data: {
+						device_type_id: this.type_id,
+						page: this.page,
+						page_size: this.size,
+						device_id: this.imports,
+					},
+				});
+				this.loadingtf = false;
+				var newtime = +new Date() / 1000;
+				if (tf) {
+					this.eqlistdata = this.eqlistdata.concat(res.data);
+				} else {
+					this.eqlistdata = res.data;
+				}
+				for (var i = 0; i < this.eqlistdata.length; i++) {
+					var days = (newtime - this.eqlistdata[i].addtime) / 60 / 60 / 24;
+					this.eqlistdata[i].days = Math.round(days);
+				}
+				console.log(res);
+			},
+			//camera.camera_manage.list_camera
+			async camera() {
+				//监控
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=camera.camera_manage.list_camera',
+					data: {
+						page_size: 1,
+					},
+				});
+				this.accessToken = res.accessToken;
+			},
+			// homes.user_device_type
+			async usertype() {
+				//设备列表
+				const res = await this.$myRequest({
+					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 == '温室大棚') {
+						continue;
+					}
+					var obj = {
+						name: res[i].type_name,
+						id: res[i].id,
+						device_model: res[i].device_model,
+						pur_id: res[i].pur_id,
+					};
+					this.list.push(obj);
+				}
+				console.log('设备列表11111111111111', this.list);
+				if (res.length) {
+					this.type_id = this.list[0].id;
+					this.device_model = this.list[0].device_model;
+					if (this.list[0].id == 10) {
+						this.xyeqlist();
+					} else {
+						this.eqlist();
+					}
+				}
+			},
+			change(index) {
+				console.log(index);
+				//头部导航栏的点击
+				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;
+				console.log(this.type_id);
+				if (this.list[index].id == 10) {
+					this.xyeqlist();
+				} else {
+					this.eqlist();
+				}
+			},
+			clickRight() {
+				//搜索
+				this.width = '90%';
+			},
+			modification(item) {
+				uni.navigateTo({
+					url: './modification?data=' + JSON.stringify(item) + '&id=' + this.type_id,
+				});
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500,
+				});
+			},
+			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;
+				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 14:
+						item.addtime = item.uptime;
+						uni.navigateTo({
+							url: '../cb/sy/detail?detail=' + JSON.stringify(item),
+						});
+						break;
+					case 2:
+						item.addtime = item.uptime;
+						uni.navigateTo({
+							url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
+						});
+						break;
+					case 38:
+						// console.log(item);
+						var obj = {};
+						obj.d_id = item.d_id;
+						obj.equip_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: '../environment/equipment-new?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 5:
+						console.log(item);
+						var obj = {};
+						obj.d_id = item.d_id;
+						obj.equip_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: '../environment/equipment?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 6:
+						uni.navigateTo({
+							url: '/pages/webview/webview?device_id=' +
+								item.imei +
+								'&accessToken=' +
+								this.accessToken,
+						});
+						break;
+					case 3:
+						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/smallPest/smallPest?info=' + JSON.stringify(item),
+						});
+						break;
+					case 4:
+						item.addtime = item.uptime;
+						item.type = this.type_id;
+						uni.navigateTo({
+							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 7:
+						item.addtime = item.uptime;
+						item.type = this.type_id;
+						uni.navigateTo({
+							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,
+						});
+						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;
+						uni.navigateTo({
+							url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
+						});
+						break;
+					case 13:
+						console.log(item);
+						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: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 15:
+						console.log(item);
+						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: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 17:
+						break;
+					case 18:
+						var obj = {};
+						obj.device_id = item.imei;
+						obj.is_online = item.is_online;
+						uni.navigateTo({
+							url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
+						});
+						break;
+          case 43:
+            uni.navigateTo({
+              url: "/pages/fmSys/details?info=" + JSON.stringify(item)
+            })
+          break;
+          case 44:
+            uni.navigateTo({
+              url: "/pages/webviewdgp/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken || uni
+                .getStorageSync('session_key') +
+                '&type=dgp'
+            })
+          break;
+					case 11:
+						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 = 11;
+						uni.navigateTo({
+							url: '../disease/cmb?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 19:
+						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 = 19;
+						uni.navigateTo({
+							url: '../disease/cmb?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 20:
+						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 = 20;
+						uni.navigateTo({
+							url: '../disease/cmb?shebei=' + JSON.stringify(obj),
+						});
+						break;
+					case 21:
+						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 = 21;
+						uni.navigateTo({
+							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;
+					default:
+						item.addtime = item.uptime;
+						item.type = this.type_id;
+						uni.navigateTo({
+							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;
+				}
+			},
+			search() {
+				//搜索
+				this.eqlistdata = [];
+				this.page = 1;
+				if (this.list[this.currents].id == 10) {
+					this.xyeqlist();
+				} else {
+					this.eqlist();
+				}
+			},
+			searchinput() {
+				Debounce(() => {
+					this.eqlistdata = [];
+					this.page = 1;
+					if (this.list[this.currents].id == 10) {
+						this.xyeqlist();
+					} else {
+						this.eqlist();
+					}
+				}, 1000)();
+			},
+			scrollTop(e) {
+				console.log(e);
+			},
+			upper() {},
+			lower() {
+				this.page++;
+				if (this.type_id == 10) {
+					this.xyeqlist(true);
+				} else {
+					this.eqlist(true);
+				}
+			},
+			scroll() {},
+		},
+		onLoad() {
+			// 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++;
+			if (this.type_id == 10) {
+				this.xyeqlist(true);
+			} else {
+				this.eqlist(true);
+			}
+		},
+		onPageScroll(e) {
+			//nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) {
+				//距离大于200时显示
+				this.isTop = true;
+			} else {
+				//距离小于200时隐藏
+				this.isTop = false;
+			}
+		},
+	};
+</script>
+<style lang="scss">
+	page {
+		background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
+	}
+
+	/deep/.uni-icons {
+		font-size: 40rpx !important;
+	}
+
+	.textbox {
+		width: 100%;
+		height: 100vh;
+		padding-top: 112rpx;
+		box-sizing: border-box;
+
+	}
+
+	.inputs {
+		width: 55%;
+		margin-left: 12rpx;
+
+		/deep/.u-content {
+			background-color: #fff !important;
+		}
+
+		/deep/.uni-input-wrapper {
+			background-color: #fff !important;
+		}
+
+	}
+
+	.utabs_box {
+		width: 100%;
+		position: fixed;
+		top: 88px;
+		background-color: #ffffff;
+		z-index: 100;
+
+		.utabs {
+			width: 95%;
+			margin: 0 auto;
+		}
+	}
+
+	.loading {
+		position: fixed;
+		top: 440px;
+		width: 95%;
+		left: 2.5%;
+		text-align: center;
+
+		.img {
+			width: 300rpx;
+			height: 40rpx;
+		}
+	}
+
+
+	.listbox{
+		// background: #F1F4F8;
+	}
+
+
+	.tab-box {
+		font-size: 30rpx;
+		// padding: 32rpx;
+		box-sizing: border-box;
+		width: 100%;
+		height: 100%;
+		overflow-y: hidden;
+		overflow-x: auto;
+		white-space: nowrap;
+
+		.tab-item {
+			cursor: pointer;
+			position: relative;
+			text-align: center;
+			display: inline-block;
+			padding: 16rpx 24rpx;
+			box-sizing: border-box;
+
+			span {
+				display: inline-block;
+			}
+		}
+	}
+
+	.tab {
+		// background-color: #0BBC58;
+		margin-top: 42rpx;
+		margin-bottom: 38rpx;
+		padding: 0 32rpx;
+		
+		.img-icon {
+			width: 80rpx;
+			height: 80rpx;
+			margin-bottom: 12rpx;
+		}
+		
+		.text {
+			color: #303133;
+			font-size: 24rpx;
+		}
+		.tab-content {
+			width: 100%;
+		
+			height: 162rpx;
+		
+		}
+
+		.tab-item.active {
+
+			border-radius: 24rpx;
+		
+			background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
+
+		}
+		
+	}
+
+	.second-tab {
+		height: 80rpx;
+		.tab-item{
+			font-size: 28rpx;
+			color: #999999;
+		}
+		.tab-item.active {
+			color: #303133;
+			font-weight: 700;
+			
+		}
+		.tab-item.active::after {
+		  content: '';
+		  position: absolute;
+		  bottom: 0;
+		  left: 50%;
+		  transform: translateX(-50%);
+		  width: 18px; /* 比文字略宽 */
+		  height: 18px;
+		  border: 3px solid #0BBC58;
+		  border-radius: 50%;
+			border-color: transparent; /* 隐藏其他部分 */
+
+		    border-bottom-color: #0BBC58; /* 组合成45度角 */
+		    // transform: rotate(0deg); /* 调整角度 */
+		}
+	}
+
+	.third-tab {
+		margin: 8rpx 0;
+		height: 64rpx;
+		line-height: 64rpx;
+		display: flex;
+		justify-content: space-between;
+
+		.third-tab-item {
+			flex: 1;
+			text-align: center;
+		}
+	}
+
+	.list {
+		width: 100%;
+		background-color: #F5F6FA;
+		// margin-bottom: 100rpx;
+		overflow-y: auto;
+		padding: 0 32rpx;
+		box-sizing: border-box;
+
+		.list_item {
+			width: 100%;
+			margin: 0 auto 24rpx;
+			padding: 32rpx;
+			box-sizing: border-box;
+			position: relative;
+			background-color: #ffffff;
+			border-radius: 16rpx;
+
+			.list_item_top {
+		
+
+				.p1 {
+					width: 86%;
+
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					overflow: hidden;
+
+				
+
+					.title{
+						 color: #333333;
+						 
+						 font-size: 28rpx;
+						
+						 font-weight: 700;
+						margin-right: 8rpx;
+					}
+					
+					.sub-title{
+						 color: #666666;
+						 
+						 font-size: 28rpx;
+						
+						 font-weight: 400;
+						
+					}
+				}
+
+				
+			}
+			.online-status{
+				font-size: 28rpx;
+				position: absolute;
+				top:0rpx;
+				text-align: center;
+				right: 0rpx;
+				width: 76px;
+				height: 28px;
+				// line-height: 28px;
+				// border-radius: 0px 0px 0px 26px;
+				
+				// border: 1px solid #ffffff;
+				image{
+					width: 152rpx;
+					height: 56rpx;
+				}
+	
+			}
+			// .p2 {
+					
+			// 	color: #0BBC58;
+			// 	background: #0bbc581a;
+			// }
+			
+			// .p_out {
+					
+			// 	color: #FB4E52;
+			// 	background: #fb4e521a;
+			// }
+			.list_item_text {
+				margin-top: 20rpx;
+				
+				p {
+					font-size: 24rpx;
+					color: #303133;
+					margin-top: 10rpx;
+					word-break: break-all;
+				}
+				
+
+				.label{
+					 color: #999999;
+					 text-align: right;
+					margin-right: 32rpx;
+					 font-size: 24rpx;
+				}
+			}
+
+			.list_item_btn {
+				width: 126rpx;
+				color: #42b983;
+				height: 40rpx;
+				text-align: center;
+				border: 1rpx solid #42b983;
+				border-radius: 25rpx;
+				font-size: 24rpx;
+				line-height: 35rpx;
+				position: absolute;
+				bottom: 15rpx;
+				right: 20rpx;
+			}
+		}
+	}
+
+	.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>

pages/equipList - 副本/modification.vue → pages/equipList2/modification.vue


pages/equipList - 副本/seabox/modification.vue → pages/equipList2/seabox/modification.vue


pages/equipList - 副本/seabox/search.vue → pages/equipList2/seabox/search.vue


+ 12 - 0
pages/equipList - 副本/search.vue

@@ -261,6 +261,18 @@
 							url: "../cb/shuifeiL/shuifeiL?detail=" + JSON.stringify(obj),
 						});
 						break;
+          case 43:
+            uni.navigateTo({
+              url: "/pages/fmSys/details?info=" + JSON.stringify(item)
+            })
+          break;
+          case 44:
+            uni.navigateTo({
+              url: "/pages/webviewdgp/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken || uni
+                .getStorageSync('session_key') +
+                '&type=dgp'
+            })
+          break;
 					case 11:
 						var obj = {};
 						obj.d_id = item.d_id;

+ 864 - 0
pages/fmSys/details.vue

@@ -0,0 +1,864 @@
+<template>
+	<view class="fm-page">
+		<!-- <view class="status_bar"></view> -->
+		<uni-nav-bar left-icon="back" background-color='rgba(0,0,0,0)' title="闸门" @clickLeft="clickLeft">
+			<!-- 	<view class="self-title">标题栏</view>
+			<template v-slot:left><view class="self-back"><uni-icons type="arrowleft" size="24"></uni-icons></view></template>
+		 -->
+		</uni-nav-bar>
+		<view class="fm-content">
+
+
+			<view class="info">
+				<view class="device-id" @click="copy(equipInfo)">
+					<image class="logo"
+						:src="`${$imageURL}/bigdata_pc/equipdistribute/${equipInfo.type}.png`" mode="">
+					</image>
+					{{equipInfo.imei||equipInfo.device_id}}
+					<image :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'" mode=""
+						class="tishi">
+					</image>
+					<view
+						:class="['float-right','yficonfont',equipInfo.is_online==1?'on icon-zaixian':'off icon-lixian']">
+						{{equipInfo.is_online==1?'在线':'离线'}}
+					</view>
+				</view>
+				<view class="info-list">
+					<span class="float-left">设备名称:</span> <span class="float-right">{{equipInfo.device_name}}</span>
+				</view>
+				<view class="info-list">
+					<span class="float-left">上报时间:</span> <span
+						class="float-right">{{equipInfo.addtime||equipInfo.uptime | timeFormat}}</span>
+				</view>
+				<view class="info-list">
+					<span class="float-left">设备地址:</span> <span
+						class="float-right">{{equipInfo.address?equipInfo.address:"--"}}</span>
+				</view>
+
+
+				<u-calendar v-model="calendar_show" mode="date" :max-date="date" @change="timeChange($event)">
+				</u-calendar>
+				<u-toast ref="toast" />
+			</view>
+			<view class="title"></view>
+			<view class="newState">
+				<view class="top">
+					<view class="left">
+						<image class="img" 
+						:src="$imageURL+'/bigdata_app/image/irrigate/fm.png'"
+						></image>
+						<view>
+							<p> <span class="num">{{deviceData.nowHeight}}</span> mm</p>
+							<p>{{deviceData.deviceStatus}}</p>
+						</view>
+
+					</view>
+					<view class="btn" style="width:170rpx">
+						<u-button text="设置开度" size="mini" @click="kdShow = true">设置开度</u-button>
+					</view>
+					<view class="right btn">
+						<u-button text="刷新" size="mini" @click="zfControl('refresh')">刷新</u-button>
+					</view>
+				</view>
+				<view class="up-down">
+					<view class="bottom">
+						<view class="opt">
+							<image 
+							:src="$imageURL+'/bigdata_app/image/irrigate/fm-up.png'"
+							></image>
+							<!-- <p class="num">到位</p>
+						<p>顶到位</p> -->
+						</view>
+						<view class="btn">
+							<u-button text="上升" size="mini" @click="zfControl('up')">上升</u-button>
+						</view>
+					</view>
+					<view class="bottom">
+						<view class="opt">
+							<image :src="$imageURL+'/bigdata_app/image/irrigate/fm-down.png'"
+							></image>
+							<!-- <p class="num">未到位</p>
+						<p>底到位</p> -->
+						</view>
+						<view class="btn">
+							<u-button class="active" text="下降" size="mini" @click="zfControl('down')">下降</u-button>
+						</view>
+					</view>
+				</view>
+				<view class="btn">
+					<button text="停止" @click="zfControl('stop')">停止</button>
+				</view>
+			</view>
+
+			<!-- 操作记录 -->
+			<view class="consoleList">
+				<view class="title">操作记录</view>
+				<view class="histimeBox">
+					<u-icon name="calendar" color="#C1C1C1" size="24"></u-icon>
+					<view class="time" @click="consoleshow = true">
+						{{consoleTime.startDate ? consoleTime.startDate : '开始'}}
+					</view>
+					<view class="">至</view>
+					<view class="time" @click="consoleshow = true">{{consoleTime.endDate ? consoleTime.endDate : '结束'}}
+					</view>
+					<u-icon name="close-circle" color="#C1C1C1" size="28" @click="clearContime"
+						v-if="consoleTime.startDate"></u-icon>
+				</view>
+				<u-calendar  @maxDate="maxDate" v-model="consoleshow" mode="range" @change="changeConsoleDate"></u-calendar>
+				<view class="tableList tableTitle">
+
+					<view>时间</view>
+					<view>操作内容</view>
+					<view>操作结果</view>
+					<view>操作人</view>
+				</view>
+				<view class="tableList" v-for="(item, index) in tableData" :key="item.addtime + index">
+					<view>{{item.addtime}}</view>
+					<view :class="item.status=='成功' ? 'success' : 'error'">{{item.order}}</view>
+					<view>{{item.status}}</view>
+					<view>{{item.user}}</view>
+				</view>
+				<u-loadmore style="margin-top: 16rpx;" :status="status" />
+			</view>
+			<u-popup v-model="kdShow" mode="center" width="600rpx">
+				<view style="padding: 40rpx;">
+					<slider style="margin-top: 20rpx;" :value="kdValue" show-value="true" :min="0" :max="1000"
+						block-color="#57C878" activeColor="#57C878" step="1" />
+					<view class="btn-box">
+						<u-button @click="kdSubmit" size="mini" type="success">确定</u-button>
+					</view>
+				</view>
+
+			</u-popup>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		QueryPermission,
+		getPermissionById,
+		getUserPermission
+	} from "@/util/QueryPermission.js"
+	export default {
+		data() {
+			return {
+				      maxDate: '2050-12-31',
+				city: "",
+				type: null, //设备类型
+				device_status: null,
+				equipInfo: {},
+				cbd: [
+
+				],
+				newState: {}, //设备最新状态
+				setTimeShow: false,
+				calendar_show: false,
+				culErr: '',
+
+				decoy: '',
+				newtishitf: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
+				date: "", //日历最大可选日期
+				operateType: '',
+				status: '', //是否加载更多
+				page: 1,
+				tableData: [],
+				deviceData: {},
+				consoleshow: false,
+				consoleTime: {},
+				kdValue: 0,
+				kdShow: false
+			}
+		},
+		computed: {
+
+
+
+		},
+		filters: {
+			equipType(type) {
+				switch (type) {
+					case 3:
+						return "虫情测报灯";
+					case 7:
+						return "孢子仪";
+					case 4:
+						return "性诱测报"
+
+				}
+			},
+			formatValue(val, a1, a2) {
+				if (a2 == 4 && a1 == "电池状态") {
+					switch (Number(val)) {
+						case 0:
+							return '正常';
+							break;
+						case 1:
+							return '欠压';
+							break;
+						case 2:
+							return '过压';
+							break;
+					}
+				} else {
+
+					return val ? val : '无'
+				}
+			}
+		},
+		onReachBottom() {
+			if (this.status == 'loadmore') {
+				this.page++;
+				this.getEquipcontroldata()
+			}
+		},
+		onLoad(option) {
+
+			this.equipInfo = JSON.parse(option.info)
+			console.log(this.equipInfo,'equipInfoequipInfo')
+			this.getEquipcontroldata()
+			this.getDeviceList()
+			// 		this.getDeviceStatus()
+			// 		this.type = Number(this.equipInfo.type) || Number(this.equipInfo.equip_type) || Number(this.equipInfo
+			// 			.device_type_id)
+			// 		this.equipInfo.type = this.type
+
+
+			// 		this.getState()
+
+			// 		// this.selectaddress(Number(this.equipInfo.lat), Number(this.equipInfo.lng))
+			// 		var times = new Date()
+			// 		this.date = times.getFullYear() + 1 + "-" + Number(times.getMonth() + 1) + "-" + times.getDate()
+		},
+		methods: {
+			clickLeft() {
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+			kdSubmit() {
+				this.kdShow = false
+				this.zfControl('value')
+			},
+			// 指令下发
+			zfControl(cmd) {
+
+				this.$myRequest({
+					method: 'POST',
+					url: '/api/api_gateway?method=hran.view.hran_order',
+					data: {
+						d_id: this.equipInfo.d_id,
+						order: cmd,
+						controlValue: this.kdValue
+					}
+				}).then((res) => {
+					console.log('指令', res)
+					if (res == true) {
+						uni.showToast({
+							title: '指令下发成功!',
+							duration: 2000,
+						});
+						setTimeout(() => {
+							this.tableData = [];
+							this.page = 1;
+							this.getEquipcontroldata()
+						}, 2000)
+					} else {
+						uni.showToast({
+							title: '指令下发失败!',
+							duration: 2000,
+						});
+					}
+				})
+			},
+			changeConsoleDate(e) {
+				console.log(e)
+				this.consoleTime = e;
+				this.tableData = [];
+				this.page = 1;
+				this.getEquipcontroldata();
+			},
+			clearContime() {
+				this.consoleTime = {};
+				this.tableData = [];
+				this.page = 1;
+				this.getEquipcontroldata();
+			},
+			//操作记录
+			async getEquipcontroldata() {
+				uni.showLoading({
+					title: '加载中'
+				});
+				const {
+					consoleTime
+				} = this;
+				let begin = consoleTime.startDate ? new Date(consoleTime.startDate+ ' 00:00:00').getTime() / 1000 : '';
+				let end = consoleTime.endDate ? new Date(consoleTime.endDate+ ' 23:59:59').getTime() / 1000 : '';
+				//操作记录
+				let res = await this.$myRequest({
+					method: "POST",
+					url: "/api/api_gateway?method=hran.view.hran_order_list",
+					data: {
+						d_id: this.equipInfo.d_id,
+						page: this.page,
+						page_size: 15,
+						start: begin,
+						end: end
+					},
+				})
+				console.log(res)
+				uni.hideLoading();
+				// this.tableData = [];
+				const record = res.data;
+				this.tableData = [...this.tableData, ...record];
+				this.total = res.total;
+				if (this.page * 15 > this.total) {
+					this.status = 'nomore'
+				} else {
+					this.status = 'loadmore'
+				}
+				// console.log(this.tableData);
+			},
+			// 获取设备数据
+			getDeviceList() {
+				this.devicetf = true
+				const {
+					consoleTime
+				} = this;
+				let begin = consoleTime.startDate ? new Date(consoleTime.startDate+ ' 00:00:00').getTime() / 1000 : '';
+				let end = consoleTime.endDate ? new Date(consoleTime.endDate+ ' 23:59:59').getTime() / 1000 : '';
+				try {
+					this.$myRequest({
+						method: 'POST',
+						url: '/api/api_gateway?method=hran.view.hran_data',
+						data: {
+							d_id: this.equipInfo.d_id,
+							start: begin,
+							end: end,
+							page: 1,
+							page_size: 1
+						}
+					}).then((res) => {
+						this.devicetf = false
+						console.log('设备数据', res)
+
+						if (res.data.length > 0) {
+							const {
+								data,
+								title
+							} = res
+							// console.log(data, title, total)
+							this.deviceData = data[0]
+							// this.deviceTitle = title
+						} else {
+							this.deviceData = {}
+						}
+
+					})
+				} catch (error) {
+					console.log('+++++', error)
+				}
+			},
+			async getDeviceStatus() {
+
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.devices_list',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.imei || this.equipInfo.device_id,
+						page: 1,
+						size: 999
+					}
+				})
+				let newRes = res.device[0]
+				this.equipInfo = {
+					...this.equipInfo,
+					...newRes
+				}
+				console.log('响应', this.equipInfo)
+			},
+			async getState() {
+				this.dataloadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.device_status',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.d_id
+					}
+				})
+				this.newState = res
+				this.dataloadingtf = false
+				console.log('res', res)
+			},
+
+			partClick(path) {
+				console.log(path)
+				var device_id = this.equipInfo.device_id || this.equipInfo.imei
+				uni.navigateTo({
+					url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + device_id + "&device_type=" + this
+						.type
+				});
+			},
+
+
+			operate(type) {
+				this.calendar_show = true
+				this.operateType = type
+			},
+			timeChange(e, filed) {
+				// // 根据type_id,执行相应的操作
+
+				// let typeId = this.equipInfo.type
+				// let postData = {}
+				// if(typeId===32){
+				// 	// 添加诱芯
+				// }else if(typeId === 33){
+				// 	// 添加诱芯,更换色板
+				// 	this.sbSubmit(e.result)
+				// }else if(typeId === 34){
+				// 	// 添加诱芯,更换卷带
+				// 	this.jdSubmit(e.result)
+				// }
+				this.yxSubmit(e.result)
+			},
+
+			async yxSubmit(time) {
+				let {
+					title,
+					url,
+					field
+				} = this.operateOptions[this.operateType]
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写' + title + '到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				let postData = {
+					device_type_id: this.equipInfo.type,
+					id: this.equipInfo.device_id
+				}
+				postData[field] = +new Date(time) / 1000
+				const res = await this.$myRequest({
+					url: url,
+					data: postData
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: title + '时间设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			// 色板
+			async sbSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写色板到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.sban',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.device_id,
+						sban_expire_time: +new Date(time) / 1000
+					}
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: '设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			async jdSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写卷带到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.syone_jd',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.device_id,
+						jd_expire_time: +new Date(time) / 1000
+					}
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: '设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+
+				}
+			},
+			selectaddress(lat, lng) { //获取分布位置
+				uni.request({
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," + lat +
+						"&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: res => {
+						console.log(res)
+						this.city = res.data.regeocode.formatted_address
+					}
+				});
+			},
+			copy(item) {
+				console.log(item)
+				uni.setClipboardData({
+					data: item.imei || item.device_id,
+					success: function() {
+						console.log('success');
+					}
+				});
+			}
+		},
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		height: 100%;
+
+		.fm-page {
+			width: 100%;
+			min-height: 100%;
+			background: linear-gradient(180deg, #f5f6fa00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
+			padding-top: 88rpx;
+		}
+
+		.fm-content {
+			padding: 0rpx 32rpx;
+			box-sizing: border-box;
+		}
+
+		.title {
+			color: #999999;
+			margin: 32rpx 0;
+		}
+
+		.logo {
+			width: 36rpx;
+			height: 36rpx;
+			margin-right: 12rpx;
+			position: relative;
+			top: 8rpx;
+		}
+
+		.device-id {
+			height: 60rpx;
+			line-height: 60rpx;
+			margin-bottom: 18rpx;
+			color: #5C5C5C;
+
+			.float-right {
+				float: right;
+				width: 88px;
+				height: 30px;
+				text-align: center;
+				position: absolute;
+				top: 0;
+				right: 0;
+				border-top-right-radius: 24rpx;
+			}
+		}
+
+		.on {
+			background-image: url('/static/images/cb/online.png');
+			color: #fff;
+		}
+
+		.off {
+			background-image: url('/static/images/cb/outline.png');
+			color: #999999;
+		}
+
+		.info {
+			position: relative;
+			padding: 8rpx 32rpx 32rpx 32rpx;
+
+			line-height: 50rpx;
+			font-size: 26rpx;
+			border-radius: 24rpx;
+
+			background-color: #fff;
+
+			box-sizing: border-box;
+			width: 100%;
+
+			.info-list {
+				overflow: hidden;
+				font-size: 12px;
+
+				.float-right {
+					float: right;
+					color: #666;
+
+					.arrow {
+						margin-left: 10rpx;
+					}
+				}
+
+				.float-left {
+					float: left;
+					color: #999;
+				}
+
+			}
+
+			.tishi {
+				width: 28rpx;
+				height: 28rpx;
+				margin: 0rpx 0 0 12rpx;
+				position: relative;
+				top: 6rpx;
+			}
+		}
+
+		.tit {
+			font-weight: 800;
+			height: 50rpx;
+			font-size: 30rpx;
+			margin-bottom: 20rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.span {
+				color: #6e6c76;
+				font-size: 24rpx;
+				display: flex;
+				justify-content: space-between;
+				/* margin-top: 12rpx; */
+			}
+		}
+
+
+		.newState {
+			padding: 32rpx;
+			border-radius: 16rpx;
+			background: #FFF;
+
+			.top {
+				height: 112rpx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.left {
+					width: 40%;
+					display: flex;
+					align-items: center;
+				}
+
+				.right {
+					width: 160rpx;
+				}
+
+				.img {
+					float: left;
+					width: 110rpx;
+					height: 110rpx;
+					margin-right: 32rpx;
+				}
+
+				p:nth-child(2) {
+					color: #687A74;
+				}
+
+				.num {
+					font-size: 40rpx;
+					font-weight: 700;
+					color: #042118;
+				}
+			}
+
+			.up-down {
+				height: 222rpx;
+				margin: 32rpx 0;
+				display: flex;
+				gap: 18rpx;
+				justify-content: space-between;
+			}
+
+			.bottom {
+				box-sizing: border-box;
+				height: 100%;
+				display: flex;
+				padding: 32rpx 0;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				gap: 30rpx;
+				flex: 1 0 0;
+				border-radius: 16rpx;
+				background: linear-gradient(180deg, #14a4781a 0%, #14a47800 100%), #FFF;
+
+				.opt {
+					width: 70rpx;
+					height: 70rpx;
+					font-size: 24rpx;
+					color: #687A74;
+
+					image {
+						width: 64rpx;
+						height: 64rpx;
+						float: left;
+						margin-right: 16rpx;
+					}
+
+					.num {
+						color: #042118;
+						font-weight: 700;
+						font-size: 28rpx;
+					}
+				}
+			}
+
+			.btn {
+				button {
+					font-size: 28rpx;
+					width: 100%;
+					background: #EEF0F8;
+					height: 63rpx;
+					line-height: 63rpx;
+					border: none;
+					outline: none;
+					border-radius: 16rpx;
+
+					&:after {
+						border: none;
+					}
+
+					&.active {
+						color: #fff;
+						background: #14A478;
+					}
+				}
+			}
+
+		}
+
+
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+
+	.red {
+		color: rgb(235, 103, 101);
+	}
+
+	.consoleList {
+		padding: 32rpx;
+		background: #fff;
+		border-radius: 16rpx;
+		margin-top: 32rpx;
+		min-height: calc(100vh - 1020rpx);
+
+		.title {
+			margin: 0;
+			margin-bottom: 16rpx;
+			color: #042118;
+			font-weight: 600;
+		}
+
+		.histimeBox {
+			margin: 32rpx 0;
+		}
+
+
+
+		.tableList {
+			font-size: 28rpx;
+			height: 93rpx;
+			color: #042118;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			border-bottom: 2rpx solid var(--neutral-color-border-base, #DCE6E3);
+
+			view {
+				text-align: center;
+			}
+
+			.success {
+				color: #14A478;
+			}
+
+			.error {
+				color: #FF5951;
+			}
+
+			view:nth-child(1) {
+				width: 160rpx;
+				text-align: left;
+			}
+
+			view:nth-child(2) {
+				width: 170rpx;
+			}
+
+			view:nth-child(3) {
+				width: 120rpx;
+			}
+		}
+
+		.tableTitle {
+			/* background: #E8F3F0; */
+			color: #042118;
+			font-weight: 500;
+			height: 78rpx;
+		}
+	}
+
+	.histimeBox {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		height: 56rpx;
+		padding: 6rpx 24rpx;
+		box-sizing: border-box;
+		border-radius: 8rpx;
+		margin-top: 54rpx;
+		border: 2rpx solid var(--neutral-color-border-light, #e4edea);
+
+		.u-icon {
+			z-index: 10;
+		}
+
+		.time {
+			width: 280rpx;
+			color: #c1c1c1;
+		}
+
+		view {
+			color: #333333;
+			text-align: center;
+		}
+
+	}
+
+	.btn-box {
+		text-align: center;
+	}
+</style>

+ 150 - 449
pages/index/index.vue

@@ -1,183 +1,125 @@
 <template>
-	<view class="home">
-		<view class="welcom">{{ hello }} 欢迎登录</view>
-		<view class="weather-bg">
-			<view class="weather-box">
-
-
-				<view class="weather">
-					<view class="weatext">
-						<view>今天<span class="text-span">{{weatherinfo.air_level}}</span></view>
-						<view class="text-value">{{weatherinfo.at}}℃</view>
-					</view>
-					<view class="weatext">
-
-
-						<image :src="
+	<view>
+		<view class="weather">
+			<image :src="
           'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
           weatherinfo.wea +
           '.png'
         " mode="" class="weaimg"></image>
-
-						<view class="weatext_title">
-							{{ weatherinfo.wea }}
-						</view>
-
-					</view>
+			<view class="weatext">
+				<view class="weatext_title">
+					{{ hello }}
 				</view>
-				<view class="weather">
-					<view class="weatext">
-						<view>湿度<span class="text-span">{{weatherinfo.ah | ahFilter}}</span></view>
-						<view class="text-value">{{weatherinfo.ah}}%</view>
-					</view>
-					<view class="weatext">
-						<view>PM2.5</view>
-						<view class="textbox">
-							{{ weatherinfo.air_pm25 }}
-						</view>
-
-					</view>
-				</view>
-
+				<view class=""> 欢迎登录云飞智控 </view>
 			</view>
-			<view class="weather-warning">
-				<image class="weather-alert" :src="$imageURL+'/bigdata_app/newImg/home/weather-alert.png'" mode=""></image>
-			{{weatherinfo.alarm_content}}
-			</view>
-
 		</view>
-		<view class="ai-box">
-			<view class="ai-content">
-				<image :src="$imageURL+'/bigdata_app/newImg/home/ai-bot.png'" class="float-left" mode=""></image>
-				<view class="ai-text">
-					<view class="ai-text-title">我是千耘农业种植大模型</view>
-					<view class="ai-text-subtitle">耕耘千百变,智慧一点通</view>
+		<view class="weatherinfo">
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/weizhi.png'" mode="" class="weaimg">
+				</image>
+				<view class="textbox">
+					{{ weatherinfo.district || '-' }}
 				</view>
-				<view class="float-right">
-					问一问
+			</view>
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/wendu.png'" mode="" class="weaimg"></image>
+				<view class="textbox"> {{ weatherinfo.at || '-' }}℃ </view>
+			</view>
+			<view class="weatherinfo_item">
+				<image :src="$imageURL+'/bigdata_app/newindex/shidu.png'" mode="" class="weaimg"></image>
+				<view class="textbox"> {{ weatherinfo.ah || '-' }} </view>
+			</view>
+			<view class="weatherinfo_item">
+				<view class="first_item"> PM2.5 </view>
+				<view class="textbox">
+					{{ weatherinfo.air_pm25 || '-' }}
 				</view>
 			</view>
 		</view>
 		<view class="functionbox">
-			
+			<view class="functionbox_title"> 功能应用 </view>
 			<view class="functionbox_text">
 				<view class="functionbox_text_item" v-if="jurisdiction.sqtf" @click="tabfunction(0)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/sqjd.png'" mode="" class="itemimg">
+					<image :src="$imageURL+'/bigdata_app/newindex/base.png'" mode="" class="itemimg">
 					</image>
 					<view class=""> 四情基地 </view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(1)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/zngg.png'" mode="" class="itemimg">
+					<image :src="$imageURL+'/bigdata_app/newindex/worm.png'" mode="" class="itemimg">
 					</image>
-					<view class=""> 智能灌溉 </view>
+					<view class=""> 田间随识 </view>
 				</view>
 				<view class="functionbox_text_item" v-if="jurisdiction.zjtf" @click="tabfunction(2)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/yhgl.png'" mode="" class="itemimg"></image>
-					<view class=""> 用户管理 </view>
-				</view>
-				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
-					<view class=""> 售后服务 </view>
-				</view>
-				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
-					<view class=""> 售后服务 </view>
-				</view>
-				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
-					<view class=""> 售后服务 </view>
+					<image :src="$imageURL+'/bigdata_app/newindex/knowledge.png'" mode=""
+						class="itemimg"></image>
+					<view class=""> 知识百科 </view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
+					<image :src="$imageURL+'/bigdata_app/newindex/aftersale.png'" mode=""
+						class="itemimg"></image>
 					<view class=""> 售后服务 </view>
 				</view>
 			</view>
-<!-- 			<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
-				:duration="duration">
-				<swiper-item>
-
-
-				</swiper-item>
-				<swiper-item>
-					<view class="swiper-item uni-bg-green">B</view>
-				</swiper-item>
-
-			</swiper> -->
 		</view>
 		<view class="facilitybox">
-			<view class="facilitybox-content">
-				<view class="facilitybox_title"> 智慧助手 </view>
-				<view style="display: flex;gap:24rpx;flex-direction: column;">
-					<view class="facilitybox_itembox">
-						<view class="facilitybox_item facilitybox-zhuanjia" v-if="jurisdiction.zjtf"
-							@click="tabfunction(2)">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/zjhk.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span">
-								<text> 专家库 </text>
-
-								<view class="text">农业相关博士、教授、研究员</view>
-							</view>
-						</view>
-						<view class="facilitybox_item" style="display: flex; flex-direction: column;gap: 24rpx;">
-							<view class="facilitybox-suishi"
-								@click="tabfunction(1)">
-
-								<image style="width: 72rpx;height:72rpx;margin-right: 10rpx;"
-									:src="$imageURL+'/bigdata_app/newImg/home/tjss.png'" mode=""
-									class="itemimg float-right">
-								</image>
-								<view class="facilitybox_span"> 田间随识 </view>
-							</view>
-							<view class="facilitybox-bchk"
-								@click="worm">
-								<image :src="$imageURL+'/bigdata_app/newImg/home/cshk.png'" mode="" class="itemimg">
-								</image>
-								<view style="width: 69%;" class="facilitybox_span"> 病虫草鼠害库 </view>
-							</view>
-						</view>
-
-					</view>
-					<view class="facilitybox_itembox">
-						<view class="facilitybox_item facilitybox-jwjy" v-if="jurisdiction.fztf"
-							@click="tabequipment('../prevention/index')">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/jwjy.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span"> 积温积雨 </view>
-						</view>
-						<view class="facilitybox_item facilitybox-jgqs" v-if="jurisdiction.jktf"
-							@click="tabequipment('../monitor/index')">
-							<image :src="$imageURL+'/bigdata_app/newImg/home/jgqs.png'" mode="" class="itemimg">
-							</image>
-							<view class="facilitybox_span"> 价格趋势 </view>
-						</view>
-
-					</view>
+			<view class="facilitybox_title"> 系统设备 </view>
+			<view class="facilitybox_itembox">
+				<view class="facilitybox_item" v-if="jurisdiction.cbtf" @click="tabequipment('../cb/index/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/cb.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 测报系统 </view>
 				</view>
-			</view>
-			<view class="banner-ad">
-			<view class="ad-text">
-				<view class="title">
-					松墨天牛拍照性诱智能监测
+				<view class="facilitybox_item" v-if="jurisdiction.cbyj" @click="tabequipment('../cbqxyj/cbwarn')">
+					<image :src="$imageURL+'/bigdata_app/newindex/cbyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 测报预警 </view>
 				</view>
-				<view class="sub-title">
-					AI慧眼识天牛    智守青山护松林
+				<view class="facilitybox_item" v-if="jurisdiction.fztf" @click="tabequipment('../prevention/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/fz.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 防治系统 </view>
 				</view>
-				<view class="btn">
-					查看详情
+				<view class="facilitybox_item" v-if="jurisdiction.jktf" @click="tabequipment('../monitor/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/jk.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 监控系统 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.hjtf" @click="tabequipment('../environment/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/hj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 环境监测 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.qxz" @click="tabequipment('../qxzyj/cbwarn', 5)">
+					<image :src="$imageURL+'/bigdata_app/newindex/qxyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 气象预警 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.sq" @click="tabequipment('../qxzyj/cbwarn', '15')">
+					<image :src="$imageURL+'/bigdata_app/newindex/sqyj.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 墒情预警 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.ggtf" @click="tabequipment('../irrigate/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/guangai.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 智能灌溉 </view>
+				</view>
+				<view class="facilitybox_item" v-if="jurisdiction.sbtf"
+					@click="tabequipment('../equipMange/index/index')">
+					<image :src="$imageURL+'/bigdata_app/newindex/user.png'" mode="" class="itemimg">
+					</image>
+					<view class=""> 用户管理 </view>
 				</view>
-			</view>
 			</view>
 		</view>
-
-		<!-- 	<view class="insectattack">
+		<view class="insectattack">
 			<view class="insectattack_title" @click="worm">
 				<view class=""> 虫情百科 </view>
 				<view class="iconbox">
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 			</view>
-
+			
 		</view>
 		<view class="insectattack">
 			<view class="insectattack_title" @click="virus">
@@ -186,8 +128,8 @@
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 			</view>
-
-		</view> -->
+			
+		</view>
 	</view>
 </template>
 
@@ -220,31 +162,10 @@
 		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg' // 分享图片,可选
 		//   }
 		// },
-		filters:{
-			ahFilter(value){
-	
-				if(value>70){
-					return"湿润"
-				}else if(value<30){
-					return'干燥'
-				}else{
-					return'正常'
-				}
-			}
-		},
 		data() {
 			return {
-				indicatorDots: true,
-				autoplay: false,
-				interval: 2000,
-				duration: 500,
 				weatherinfo: {
 					wea: '晴',
-					air_level: '优',
-					at: '23',
-					air_pm25: '3',
-					ah: '56',
-					alarm_content: '天气警告'
 				},
 				hello: '',
 				jurisdiction: {
@@ -288,7 +209,12 @@
 						lat: lat,
 					},
 				});
-
+				// uni.showToast({
+				// 	title: JSON.stringify(res[0]),
+				// 	duration: 20000,
+				// 	icon:'none'
+				// });
+				//    console.log(res);
 				this.weatherinfo = res[0];
 			},
 			async getUserlogin() {
@@ -610,7 +536,7 @@
 			}
 		},
 		onLoad() {
-
+		
 			console.log(this.$imageURL)
 			var time = new Date();
 			var hours = time.getHours();
@@ -632,167 +558,76 @@
 
 <style lang="less">
 	page {
-		background: linear-gradient(180deg, #1FC676 11.72%, #1FC676 11.52%, #D5F9E7 29.83%, #F5F6FA 36.96%), #FFF;
-		// background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
-		// background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
+		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
 		background-size: 100%;
 		background-repeat: no-repeat;
 		background-color: #f9f9f9;
 	}
 
-	.home {
-		// background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
-		width: 100%;
-		height: 100%;
-		padding-top: 94rpx;
-		box-sizing: border-box;
-	}
-
-	.welcom {
-		height: 64rpx;
-		line-height: 64rpx;
-		padding-left: 16rpx;
-		font-size: 40rpx;
-		color: #fff;
-	}
-
-	.weather-bg {
-		width: 100%;
-		height: 212rpx;
-		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/banner-bg.png);
-		background-size: 100% 100%;
-		background-repeat: no-repeat;
-	}
-
-	.weather-box {
-		display: flex;
-		margin: 24rpx 0 16rpx 0;
-	}
-
-	.weather:nth-child(1) {
-
-		border-right: 1px solid rgba(255, 255, 255, 0.6);
-	}
-
 	.weather {
-		flex: 1;
 		display: flex;
-
+		width: 85%;
+		margin: 0 auto;
+		padding-top: 40rpx;
 
 		.weaimg {
-			width: 42rpx;
-			height: 42rpx;
+			width: 296rpx;
+			height: 296rpx;
 		}
 
 		.weatext {
-			gap: 8rpx;
-			flex: 1;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			font-size: 24rpx;
-			color: rgba(255, 255, 255, 0.8);
-		}
-
-		.weatext_title {
-			font-size: 24rpx;
+			width: 300rpx;
+			text-align: center;
+			font-size: 36rpx;
 			color: #fff;
-		}
-
-		.text-span {
-			color: #0BBC58;
-			margin-left: 16rpx;
-			padding: 0 2px;
-			border-radius: 4px;
-			background: rgba(255, 255, 255, 0.6);
-		}
+			padding-top: 60rpx;
+			margin-left: 60rpx;
 
-		.text-value {
-			font-size: 48rpx;
-			color: #fff;
-		}
-	}
-
-	.weather-warning {
-		margin: 20rpx 0;
-		padding: 0 40rpx;
-		color: #fff;
-		.weather-alert{
-			width:30rpx;
-			height: 30rpx;
-			margin-right: 10rpx;
+			.weatext_title {
+				font-size: 80rpx;
+				margin-bottom: 30rpx;
+			}
 		}
 	}
 
-	.ai-box {
-		width: 100%;
-		padding: 0 40rpx;
-		box-sizing: border-box;
-		height: 128rpx;
-		margin-bottom: 12rpx;
-		position: relative;
-		top: -20rpx;
-
-		.ai-content {
-			box-sizing: border-box;
-			height: 100%;
-			border-radius: 8px;
-			border: 1.5px solid #FFF;
-			background: linear-gradient(180deg, #ffffffa3 0%, #FFF 100%);
-			padding: 24rpx;
+	.weatherinfo {
+		display: flex;
+		background-color: rgba(255, 255, 255, 0.2);
+		width: 85%;
+		margin: 60rpx auto;
+		padding: 30rpx;
+		justify-content: space-around;
+		border-radius: 170rpx;
 
-			image {
-				width: 80rpx;
-				height: 80rpx;
-				float: left;
-				margin-right: 16rpx;
-			}
+		.weatherinfo_item {
+			text-align: center;
 
-			.float-right {
-				float: right;
-				padding: 4px 12px;
+			.first_item {
+				height: 50rpx;
+				margin-bottom: 10rpx;
 				color: #fff;
-				border-radius: 28px;
-				background: #0BBC58;
-				margin: 12rpx 0;
-			}
-
-			.ai-text {
-
-				float: left;
+				line-height: 50rpx;
 			}
 
-			.ai-text-title {
-				color: #333834;
-				line-height: 40rpx;
-				font-size: 28rpx;
-
-				font-weight: 700;
+			.weaimg {
+				width: 50rpx;
+				height: 50rpx;
 			}
 
-			.ai-text-subtitle {
-				color: #7b9783;
-				line-height: 40rpx;
-				font-size: 20rpx;
-
-				font-weight: 400;
-
+			.textbox {
+				text-align: center;
+				color: #fff;
 			}
 		}
-
-
 	}
 
-
 	.functionbox {
-		width: 100%;
-		// height: 240rpx;
-		padding: 0rpx 32rpx 0 32rpx;
-		box-sizing: border-box;
-		margin-bottom: 16rpx;
-		.swiper {
-			height: 208rpx;
-		}
+		width: 85%;
+		margin: 0 auto;
+		padding: 30rpx;
+		// box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 30rpx;
 
 		.functionbox_title {
 			padding-left: 20rpx;
@@ -801,184 +636,50 @@
 
 		.functionbox_text {
 			display: flex;
-			flex-wrap: wrap;
-			// justify-content: space-around;
+			justify-content: space-around;
 			margin-top: 30rpx;
-			
+
 			.functionbox_text_item {
-				width:20%;
 				text-align: center;
 				color: #616666;
-				font-size: 24rpx;
-				margin-bottom: 32rpx;
+
 				.itemimg {
-					width: 80rpx;
-					height: 80rpx;
-					margin-bottom: 16rpx;
+					width: 60rpx;
+					height: 60rpx;
+					margin-bottom: 20rpx;
 				}
 			}
 		}
 	}
 
 	.facilitybox {
-		width: 100%;
-		padding: 0 32rpx;
-		box-sizing: border-box;
-		background: #F5F6FA;
-
-		.facilitybox-content {
-			border-radius: 16rpx;
-			background: #FFF;
-			padding: 32rpx;
-		}
+		width: 90%;
+		margin: 0 auto;
+		padding: 30rpx;
 
 		.facilitybox_title {
-			font-size: 30rpx;
-			color: #333;
-			margin-bottom: 24rpx;
+			font-size: 34rpx;
 			// padding-left: 20rpx;
 		}
 
 		.facilitybox_itembox {
-
 			display: flex;
-			gap: 32rpx;
+			// justify-content: space-around;
+			flex-wrap: wrap;
+			margin-top: 30rpx;
 
 			.facilitybox_item {
-				flex: 1;
-
+				width: 25%;
+				text-align: center;
 				color: #616666;
-
-				.facilitybox_span {
-					padding: 16rpx 24rpx;
-					width: 50%;
-					color: #0B3F5D;
-					font-weight: 500;
-					font-size: 28rpx;
-
-					.text {
-						font-size: 20rpx;
-						color: #4E916E;
-						font-weight: 400;
-						margin-top: 9rpx;
-					}
-				}
+				margin-bottom: 20rpx;
 
 				.itemimg {
-					width: 90rpx;
-					height: 90rpx;
-					float: right;
-					margin: 7rpx 0;
-				}
-			}
-
-			.facilitybox-zhuanjia {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #D3FBE6 0%, #F5F7FA 100%);
-				position: relative;
-
-				.itemimg {
-					width: 112rpx;
-					height: 146rpx;
-					position: absolute;
-					bottom: 0;
-					right: 16rpx;
-				}
-
-				text {
-					color: #003318;
-					font-weight: 500;
-					font-size: 28rpx;
-
-				}
-			}
-
-			.facilitybox-suishi {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #CAECFF 0%, #F5F7FA 99.89%);
-				padding: 9rpx 0;
-
-				.facilitybox_span {
-					color: #0B3F5D;
+					width: 100rpx;
+					height: 100rpx;
+					margin-bottom: 20rpx;
 				}
 			}
-
-			.facilitybox-bchk {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #EEE5F6 0%, #F5F7FA 95.65%);
-				// height: 102rpx;
-				padding: 10rpx 0;
-
-				.facilitybox_span {
-					color: #3E2B50;
-				}
-
-				.itemimg {
-					width: 78rpx;
-					height: 72rpx;
-					margin-right: 10rpx;
-				}
-			}
-
-			.facilitybox-jgqs {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #D2E5FF 0%, #F5F7FA 95.65%);
-
-				.facilitybox_span {
-					color: #0D2E5B;
-				}
-			}
-
-			.facilitybox-jwjy {
-				border-radius: 8px;
-				background: linear-gradient(180deg, #FFF4D2 0%, #F5F7FA 95.65%);
-
-				.facilitybox_span {
-					color: #3D4012;
-				}
-			}
-		}
-	}
-
-
-	.banner-ad {
-		margin: 32rpx 0;
-		height: 224rpx;
-		border-radius: 8px;
-		background-size: 100% 100%;
-		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/ad-banner.png);
-		.ad-text{
-			height: 100%;
-			display: flex;
-			flex-direction: column;
-			justify-content: space-around;
-			padding: 40rpx;
-			box-sizing: border-box;
-			.title{
-				 color: #333333;
-				 
-				 font-size: 28rpx;
-				 font-style: normal;
-				 font-weight: 700;
-				 line-height: normal;
-			}
-			.sub-title{
-				 color: #666666;
-				
-				 font-size: 20rpx;
-				 font-style: normal;
-				 font-weight: 500;
-				 line-height: normal;
-			}
-			.btn{
-				text-align: center;
-				width: 112rpx;
-				color:#fff;
-				padding: 4px 0px;
-				font-size: 20rpx;
-				border-radius: 4px;
-				background: linear-gradient(106deg, #0BBC58 2.6%, #7CE6FB 86.51%);
-			}
 		}
 	}
 

+ 455 - 150
pages/index/index - 副本.vue

@@ -1,125 +1,187 @@
 <template>
-	<view>
-		<view class="weather">
-			<image :src="
+	<view class="home">
+		<view class="welcom">{{ hello }} 欢迎登录</view>
+		<view class="weather-bg">
+			<view class="weather-box">
+
+
+				<view class="weather">
+					<view class="weatext">
+						<view>今天<span class="text-span">{{weatherinfo.air_level}}</span></view>
+						<view class="text-value">{{weatherinfo.at}}℃</view>
+					</view>
+					<view class="weatext">
+
+
+						<image :src="
           'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/weather/' +
           weatherinfo.wea +
           '.png'
         " mode="" class="weaimg"></image>
-			<view class="weatext">
-				<view class="weatext_title">
-					{{ hello }}
+
+						<view class="weatext_title">
+							{{ weatherinfo.wea }}
+						</view>
+
+					</view>
 				</view>
-				<view class=""> 欢迎登录云飞智控 </view>
-			</view>
-		</view>
-		<view class="weatherinfo">
-			<view class="weatherinfo_item">
-				<image :src="$imageURL+'/bigdata_app/newindex/weizhi.png'" mode="" class="weaimg">
-				</image>
-				<view class="textbox">
-					{{ weatherinfo.district || '-' }}
+				<view class="weather">
+					<view class="weatext">
+						<view>湿度<span class="text-span">{{weatherinfo.ah | ahFilter}}</span></view>
+						<view class="text-value">{{weatherinfo.ah}}%</view>
+					</view>
+					<view class="weatext">
+						<view>PM2.5</view>
+						<view class="textbox">
+							{{ weatherinfo.air_pm25 }}
+						</view>
+
+					</view>
 				</view>
+
 			</view>
-			<view class="weatherinfo_item">
-				<image :src="$imageURL+'/bigdata_app/newindex/wendu.png'" mode="" class="weaimg"></image>
-				<view class="textbox"> {{ weatherinfo.at || '-' }}℃ </view>
-			</view>
-			<view class="weatherinfo_item">
-				<image :src="$imageURL+'/bigdata_app/newindex/shidu.png'" mode="" class="weaimg"></image>
-				<view class="textbox"> {{ weatherinfo.ah || '-' }} </view>
+			<view class="weather-warning">
+				<image class="weather-alert" :src="$imageURL+'/bigdata_app/newImg/home/weather-alert.png'" mode=""></image>
+			{{weatherinfo.alarm_content}}
 			</view>
-			<view class="weatherinfo_item">
-				<view class="first_item"> PM2.5 </view>
-				<view class="textbox">
-					{{ weatherinfo.air_pm25 || '-' }}
+
+		</view>
+		<view class="ai-box">
+			<view class="ai-content">
+				<image :src="$imageURL+'/bigdata_app/newImg/home/ai-bot.png'" class="float-left" mode=""></image>
+				<view class="ai-text">
+					<view class="ai-text-title">我是千耘农业种植大模型</view>
+					<view class="ai-text-subtitle">耕耘千百变,智慧一点通</view>
+				</view>
+				<view class="float-right">
+					问一问
 				</view>
 			</view>
 		</view>
 		<view class="functionbox">
-			<view class="functionbox_title"> 功能应用 </view>
+			
 			<view class="functionbox_text">
 				<view class="functionbox_text_item" v-if="jurisdiction.sqtf" @click="tabfunction(0)">
-					<image :src="$imageURL+'/bigdata_app/newindex/base.png'" mode="" class="itemimg">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/sqjd.png'" mode="" class="itemimg">
 					</image>
 					<view class=""> 四情基地 </view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(1)">
-					<image :src="$imageURL+'/bigdata_app/newindex/worm.png'" mode="" class="itemimg">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/zngg.png'" mode="" class="itemimg">
 					</image>
-					<view class=""> 田间随识 </view>
+					<view class=""> 智能灌溉 </view>
 				</view>
 				<view class="functionbox_text_item" v-if="jurisdiction.zjtf" @click="tabfunction(2)">
-					<image :src="$imageURL+'/bigdata_app/newindex/knowledge.png'" mode=""
-						class="itemimg"></image>
-					<view class=""> 知识百科 </view>
+					<image :src="$imageURL+'/bigdata_app/newImg/home/yhgl.png'" mode="" class="itemimg"></image>
+					<view class=""> 用户管理 </view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image :src="$imageURL+'/bigdata_app/newindex/aftersale.png'" mode=""
-						class="itemimg"></image>
+					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
 					<view class=""> 售后服务 </view>
 				</view>
-			</view>
-		</view>
-		<view class="facilitybox">
-			<view class="facilitybox_title"> 系统设备 </view>
-			<view class="facilitybox_itembox">
-				<view class="facilitybox_item" v-if="jurisdiction.cbtf" @click="tabequipment('../cb/index/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/cb.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 测报系统 </view>
-				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.cbyj" @click="tabequipment('../cbqxyj/cbwarn')">
-					<image :src="$imageURL+'/bigdata_app/newindex/cbyj.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 测报预警 </view>
+				<view class="functionbox_text_item" @click="tabfunction(3)">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
+					<view class=""> 售后服务 </view>
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.fztf" @click="tabequipment('../prevention/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/fz.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 防治系统 </view>
+				<view class="functionbox_text_item" @click="tabfunction(3)">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
+					<view class=""> 售后服务 </view>
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.jktf" @click="tabequipment('../monitor/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/jk.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 监控系统 </view>
+				<view class="functionbox_text_item" @click="tabfunction(3)">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
+					<view class=""> 售后服务 </view>
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.hjtf" @click="tabequipment('../environment/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/hj.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 环境监测 </view>
+				<view class="functionbox_text_item" @click="tabfunction(9)">
+					<image :src="$imageURL+'/bigdata_app/newImg/home/shfw.png'" mode="" class="itemimg"></image>
+					<view class=""> 更多功能 </view>
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.qxz" @click="tabequipment('../qxzyj/cbwarn', 5)">
-					<image :src="$imageURL+'/bigdata_app/newindex/qxyj.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 气象预警 </view>
+			</view>
+<!-- 			<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
+				:duration="duration">
+				<swiper-item>
+
+
+				</swiper-item>
+				<swiper-item>
+					<view class="swiper-item uni-bg-green">B</view>
+				</swiper-item>
+
+			</swiper> -->
+		</view>
+		<view class="facilitybox">
+			<view class="facilitybox-content">
+				<view class="facilitybox_title"> 智慧助手 </view>
+				<view style="display: flex;gap:24rpx;flex-direction: column;">
+					<view class="facilitybox_itembox">
+						<view class="facilitybox_item facilitybox-zhuanjia" v-if="jurisdiction.zjtf"
+							@click="tabfunction(2)">
+							<image :src="$imageURL+'/bigdata_app/newImg/home/zjhk.png'" mode="" class="itemimg">
+							</image>
+							<view class="facilitybox_span">
+								<text> 专家库 </text>
+
+								<view class="text">农业相关博士、教授、研究员</view>
+							</view>
+						</view>
+						<view class="facilitybox_item" style="display: flex; flex-direction: column;gap: 24rpx;">
+							<view class="facilitybox-suishi"
+								@click="tabfunction(1)">
+
+								<image style="width: 72rpx;height:72rpx;margin-right: 10rpx;"
+									:src="$imageURL+'/bigdata_app/newImg/home/tjss.png'" mode=""
+									class="itemimg float-right">
+								</image>
+								<view class="facilitybox_span"> 田间随识 </view>
+							</view>
+							<view class="facilitybox-bchk"
+								@click="worm">
+								<image :src="$imageURL+'/bigdata_app/newImg/home/cshk.png'" mode="" class="itemimg">
+								</image>
+								<view style="width: 69%;" class="facilitybox_span"> 病虫草鼠害库 </view>
+							</view>
+						</view>
+
+					</view>
+					<view class="facilitybox_itembox">
+						<view class="facilitybox_item facilitybox-jwjy" v-if="jurisdiction.fztf"
+							@click="tabequipment('../prevention/index')">
+							<image :src="$imageURL+'/bigdata_app/newImg/home/jwjy.png'" mode="" class="itemimg">
+							</image>
+							<view class="facilitybox_span"> 积温积雨 </view>
+						</view>
+						<view class="facilitybox_item facilitybox-jgqs" v-if="jurisdiction.jktf"
+							@click="tabequipment('../monitor/index')">
+							<image :src="$imageURL+'/bigdata_app/newImg/home/jgqs.png'" mode="" class="itemimg">
+							</image>
+							<view class="facilitybox_span"> 价格趋势 </view>
+						</view>
+
+					</view>
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.sq" @click="tabequipment('../qxzyj/cbwarn', '15')">
-					<image :src="$imageURL+'/bigdata_app/newindex/sqyj.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 墒情预警 </view>
+			</view>
+			<view class="banner-ad">
+			<view class="ad-text">
+				<view class="title">
+					松墨天牛拍照性诱智能监测
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.ggtf" @click="tabequipment('../irrigate/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/guangai.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 智能灌溉 </view>
+				<view class="sub-title">
+					AI慧眼识天牛    智守青山护松林
 				</view>
-				<view class="facilitybox_item" v-if="jurisdiction.sbtf"
-					@click="tabequipment('../equipMange/index/index')">
-					<image :src="$imageURL+'/bigdata_app/newindex/user.png'" mode="" class="itemimg">
-					</image>
-					<view class=""> 用户管理 </view>
+				<view class="btn">
+					查看详情
 				</view>
 			</view>
+			</view>
 		</view>
-		<view class="insectattack">
+
+		<!-- 	<view class="insectattack">
 			<view class="insectattack_title" @click="worm">
 				<view class=""> 虫情百科 </view>
 				<view class="iconbox">
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 			</view>
-			
+
 		</view>
 		<view class="insectattack">
 			<view class="insectattack_title" @click="virus">
@@ -128,8 +190,8 @@
 					<u-icon name="arrow-right"></u-icon>
 				</view>
 			</view>
-			
-		</view>
+
+		</view> -->
 	</view>
 </template>
 
@@ -162,10 +224,31 @@
 		//     imageUrl: 'http://www.hnyfwlw.com:8006/data/home_logo/log1.jpg' // 分享图片,可选
 		//   }
 		// },
+		filters:{
+			ahFilter(value){
+	
+				if(value>70){
+					return"湿润"
+				}else if(value<30){
+					return'干燥'
+				}else{
+					return'正常'
+				}
+			}
+		},
 		data() {
 			return {
+				indicatorDots: true,
+				autoplay: false,
+				interval: 2000,
+				duration: 500,
 				weatherinfo: {
 					wea: '晴',
+					air_level: '优',
+					at: '23',
+					air_pm25: '3',
+					ah: '56',
+					alarm_content: '天气警告'
 				},
 				hello: '',
 				jurisdiction: {
@@ -209,12 +292,7 @@
 						lat: lat,
 					},
 				});
-				// uni.showToast({
-				// 	title: JSON.stringify(res[0]),
-				// 	duration: 20000,
-				// 	icon:'none'
-				// });
-				//    console.log(res);
+
 				this.weatherinfo = res[0];
 			},
 			async getUserlogin() {
@@ -330,7 +408,9 @@
 					uni.navigateTo({
 						url: '../afterSale/index',
 					});
-				}
+				} else if (index == 9) {
+          
+        }
 			},
 			tabequipment(url, type) {
 				console.log(url);
@@ -536,7 +616,7 @@
 			}
 		},
 		onLoad() {
-		
+
 			console.log(this.$imageURL)
 			var time = new Date();
 			var hours = time.getHours();
@@ -558,76 +638,167 @@
 
 <style lang="less">
 	page {
-		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
+		background: linear-gradient(180deg, #1FC676 11.72%, #1FC676 11.52%, #D5F9E7 29.83%, #F5F6FA 36.96%), #FFF;
+		// background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newindex/bg.png);
+		// background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
 		background-size: 100%;
 		background-repeat: no-repeat;
 		background-color: #f9f9f9;
 	}
 
+	.home {
+		// background: linear-gradient(180deg, #1FC676 8.72%, #1FC676 18.52%, #D5F9E7 21.83%, #F5F6FA 25.96%), #FFF;
+		width: 100%;
+		height: 100%;
+		padding-top: 94rpx;
+		box-sizing: border-box;
+	}
+
+	.welcom {
+		height: 64rpx;
+		line-height: 64rpx;
+		padding-left: 16rpx;
+		font-size: 40rpx;
+		color: #fff;
+	}
+
+	.weather-bg {
+		width: 100%;
+		height: 212rpx;
+		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/banner-bg.png);
+		background-size: 100% 100%;
+		background-repeat: no-repeat;
+	}
+
+	.weather-box {
+		display: flex;
+		margin: 24rpx 0 16rpx 0;
+	}
+
+	.weather:nth-child(1) {
+
+		border-right: 1px solid rgba(255, 255, 255, 0.6);
+	}
+
 	.weather {
+		flex: 1;
 		display: flex;
-		width: 85%;
-		margin: 0 auto;
-		padding-top: 40rpx;
+
 
 		.weaimg {
-			width: 296rpx;
-			height: 296rpx;
+			width: 42rpx;
+			height: 42rpx;
 		}
 
 		.weatext {
-			width: 300rpx;
-			text-align: center;
-			font-size: 36rpx;
+			gap: 8rpx;
+			flex: 1;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			font-size: 24rpx;
+			color: rgba(255, 255, 255, 0.8);
+		}
+
+		.weatext_title {
+			font-size: 24rpx;
 			color: #fff;
-			padding-top: 60rpx;
-			margin-left: 60rpx;
+		}
 
-			.weatext_title {
-				font-size: 80rpx;
-				margin-bottom: 30rpx;
-			}
+		.text-span {
+			color: #0BBC58;
+			margin-left: 16rpx;
+			padding: 0 2px;
+			border-radius: 4px;
+			background: rgba(255, 255, 255, 0.6);
+		}
+
+		.text-value {
+			font-size: 48rpx;
+			color: #fff;
 		}
 	}
 
-	.weatherinfo {
-		display: flex;
-		background-color: rgba(255, 255, 255, 0.2);
-		width: 85%;
-		margin: 60rpx auto;
-		padding: 30rpx;
-		justify-content: space-around;
-		border-radius: 170rpx;
+	.weather-warning {
+		margin: 20rpx 0;
+		padding: 0 40rpx;
+		color: #fff;
+		.weather-alert{
+			width:30rpx;
+			height: 30rpx;
+			margin-right: 10rpx;
+		}
+	}
+
+	.ai-box {
+		width: 100%;
+		padding: 0 40rpx;
+		box-sizing: border-box;
+		height: 128rpx;
+		margin-bottom: 12rpx;
+		position: relative;
+		top: -20rpx;
 
-		.weatherinfo_item {
-			text-align: center;
+		.ai-content {
+			box-sizing: border-box;
+			height: 100%;
+			border-radius: 8px;
+			border: 1.5px solid #FFF;
+			background: linear-gradient(180deg, #ffffffa3 0%, #FFF 100%);
+			padding: 24rpx;
 
-			.first_item {
-				height: 50rpx;
-				margin-bottom: 10rpx;
+			image {
+				width: 80rpx;
+				height: 80rpx;
+				float: left;
+				margin-right: 16rpx;
+			}
+
+			.float-right {
+				float: right;
+				padding: 4px 12px;
 				color: #fff;
-				line-height: 50rpx;
+				border-radius: 28px;
+				background: #0BBC58;
+				margin: 12rpx 0;
 			}
 
-			.weaimg {
-				width: 50rpx;
-				height: 50rpx;
+			.ai-text {
+
+				float: left;
 			}
 
-			.textbox {
-				text-align: center;
-				color: #fff;
+			.ai-text-title {
+				color: #333834;
+				line-height: 40rpx;
+				font-size: 28rpx;
+
+				font-weight: 700;
+			}
+
+			.ai-text-subtitle {
+				color: #7b9783;
+				line-height: 40rpx;
+				font-size: 20rpx;
+
+				font-weight: 400;
+
 			}
 		}
+
+
 	}
 
+
 	.functionbox {
-		width: 85%;
-		margin: 0 auto;
-		padding: 30rpx;
-		// box-sizing: border-box;
-		background-color: #fff;
-		border-radius: 30rpx;
+		width: 100%;
+		// height: 240rpx;
+		padding: 0rpx 32rpx 0 32rpx;
+		box-sizing: border-box;
+		margin-bottom: 16rpx;
+		.swiper {
+			height: 208rpx;
+		}
 
 		.functionbox_title {
 			padding-left: 20rpx;
@@ -636,50 +807,184 @@
 
 		.functionbox_text {
 			display: flex;
-			justify-content: space-around;
+			flex-wrap: wrap;
+			// justify-content: space-around;
 			margin-top: 30rpx;
-
+			
 			.functionbox_text_item {
+				width:20%;
 				text-align: center;
 				color: #616666;
-
+				font-size: 24rpx;
+				margin-bottom: 32rpx;
 				.itemimg {
-					width: 60rpx;
-					height: 60rpx;
-					margin-bottom: 20rpx;
+					width: 80rpx;
+					height: 80rpx;
+					margin-bottom: 16rpx;
 				}
 			}
 		}
 	}
 
 	.facilitybox {
-		width: 90%;
-		margin: 0 auto;
-		padding: 30rpx;
+		width: 100%;
+		padding: 0 32rpx;
+		box-sizing: border-box;
+		background: #F5F6FA;
+
+		.facilitybox-content {
+			border-radius: 16rpx;
+			background: #FFF;
+			padding: 32rpx;
+		}
 
 		.facilitybox_title {
-			font-size: 34rpx;
+			font-size: 30rpx;
+			color: #333;
+			margin-bottom: 24rpx;
 			// padding-left: 20rpx;
 		}
 
 		.facilitybox_itembox {
+
 			display: flex;
-			// justify-content: space-around;
-			flex-wrap: wrap;
-			margin-top: 30rpx;
+			gap: 32rpx;
 
 			.facilitybox_item {
-				width: 25%;
-				text-align: center;
+				flex: 1;
+
 				color: #616666;
-				margin-bottom: 20rpx;
+
+				.facilitybox_span {
+					padding: 16rpx 24rpx;
+					width: 50%;
+					color: #0B3F5D;
+					font-weight: 500;
+					font-size: 28rpx;
+
+					.text {
+						font-size: 20rpx;
+						color: #4E916E;
+						font-weight: 400;
+						margin-top: 9rpx;
+					}
+				}
 
 				.itemimg {
-					width: 100rpx;
-					height: 100rpx;
-					margin-bottom: 20rpx;
+					width: 90rpx;
+					height: 90rpx;
+					float: right;
+					margin: 7rpx 0;
+				}
+			}
+
+			.facilitybox-zhuanjia {
+				border-radius: 8px;
+				background: linear-gradient(180deg, #D3FBE6 0%, #F5F7FA 100%);
+				position: relative;
+
+				.itemimg {
+					width: 112rpx;
+					height: 146rpx;
+					position: absolute;
+					bottom: 0;
+					right: 16rpx;
+				}
+
+				text {
+					color: #003318;
+					font-weight: 500;
+					font-size: 28rpx;
+
+				}
+			}
+
+			.facilitybox-suishi {
+				border-radius: 8px;
+				background: linear-gradient(180deg, #CAECFF 0%, #F5F7FA 99.89%);
+				padding: 9rpx 0;
+
+				.facilitybox_span {
+					color: #0B3F5D;
 				}
 			}
+
+			.facilitybox-bchk {
+				border-radius: 8px;
+				background: linear-gradient(180deg, #EEE5F6 0%, #F5F7FA 95.65%);
+				// height: 102rpx;
+				padding: 10rpx 0;
+
+				.facilitybox_span {
+					color: #3E2B50;
+				}
+
+				.itemimg {
+					width: 78rpx;
+					height: 72rpx;
+					margin-right: 10rpx;
+				}
+			}
+
+			.facilitybox-jgqs {
+				border-radius: 8px;
+				background: linear-gradient(180deg, #D2E5FF 0%, #F5F7FA 95.65%);
+
+				.facilitybox_span {
+					color: #0D2E5B;
+				}
+			}
+
+			.facilitybox-jwjy {
+				border-radius: 8px;
+				background: linear-gradient(180deg, #FFF4D2 0%, #F5F7FA 95.65%);
+
+				.facilitybox_span {
+					color: #3D4012;
+				}
+			}
+		}
+	}
+
+
+	.banner-ad {
+		margin: 32rpx 0;
+		height: 224rpx;
+		border-radius: 8px;
+		background-size: 100% 100%;
+		background-image: url(https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/ad-banner.png);
+		.ad-text{
+			height: 100%;
+			display: flex;
+			flex-direction: column;
+			justify-content: space-around;
+			padding: 40rpx;
+			box-sizing: border-box;
+			.title{
+				 color: #333333;
+				 
+				 font-size: 28rpx;
+				 font-style: normal;
+				 font-weight: 700;
+				 line-height: normal;
+			}
+			.sub-title{
+				 color: #666666;
+				
+				 font-size: 20rpx;
+				 font-style: normal;
+				 font-weight: 500;
+				 line-height: normal;
+			}
+			.btn{
+				text-align: center;
+				width: 112rpx;
+				color:#fff;
+				padding: 4px 0px;
+				font-size: 20rpx;
+				border-radius: 4px;
+				background: linear-gradient(106deg, #0BBC58 2.6%, #7CE6FB 86.51%);
+			}
 		}
 	}
 

+ 39 - 0
pages/webviewdgp/webview.vue

@@ -0,0 +1,39 @@
+<template>
+	<view class="webview">
+		<web-view :src="url" id="webcon"  cache-control="no-cache">
+		</web-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				url: '',
+				device_id: '',
+				accessToken: ''
+			}
+		},
+		onLoad(options) {
+			this.device_id = options.device_id
+			this.accessToken = uni.getStorageSync('session_key')
+			this.url = "https://wx.hnyfwlw.com/wexin/h52dgp.html?device_id=" + this.device_id + "&accessToken=" + this.accessToken
+			// this.url = "http://192.168.1.136:7777/h52dgp.html?device_id=" + this.device_id + "&accessToken=" + this.accessToken
+			// this.url = "https://demo.nyzhwlw.com/wechat?device_id=" + this.device_id + "&accessToken=" + this.accessToken
+			//设置 webview 界面的状态栏的 title
+			uni.setNavigationBarTitle({
+				title: '监控详情'
+			});
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+	.webview {
+		width: 100vw;
+		height: 100vh;
+	}
+</style>

+ 539 - 0
static/font/demo.css

@@ -0,0 +1,539 @@
+/* Logo 字体 */
+@font-face {
+  font-family: "iconfont logo";
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
+}
+
+.logo {
+  font-family: "iconfont logo";
+  font-size: 160px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+/* tabs */
+.nav-tabs {
+  position: relative;
+}
+
+.nav-tabs .nav-more {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  height: 42px;
+  line-height: 42px;
+  color: #666;
+}
+
+#tabs {
+  border-bottom: 1px solid #eee;
+}
+
+#tabs li {
+  cursor: pointer;
+  width: 100px;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  font-size: 16px;
+  border-bottom: 2px solid transparent;
+  position: relative;
+  z-index: 1;
+  margin-bottom: -1px;
+  color: #666;
+}
+
+
+#tabs .active {
+  border-bottom-color: #f00;
+  color: #222;
+}
+
+.tab-container .content {
+  display: none;
+}
+
+/* 页面布局 */
+.main {
+  padding: 30px 100px;
+  width: 960px;
+  margin: 0 auto;
+}
+
+.main .logo {
+  color: #333;
+  text-align: left;
+  margin-bottom: 30px;
+  line-height: 1;
+  height: 110px;
+  margin-top: -50px;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.main .logo a {
+  font-size: 160px;
+  color: #333;
+}
+
+.helps {
+  margin-top: 40px;
+}
+
+.helps pre {
+  padding: 20px;
+  margin: 10px 0;
+  border: solid 1px #e7e1cd;
+  background-color: #fffdef;
+  overflow: auto;
+}
+
+.icon_lists {
+  width: 100% !important;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.icon_lists li {
+  width: 100px;
+  margin-bottom: 10px;
+  margin-right: 20px;
+  text-align: center;
+  list-style: none !important;
+  cursor: default;
+}
+
+.icon_lists li .code-name {
+  line-height: 1.2;
+}
+
+.icon_lists .icon {
+  display: block;
+  height: 100px;
+  line-height: 100px;
+  font-size: 42px;
+  margin: 10px auto;
+  color: #333;
+  -webkit-transition: font-size 0.25s linear, width 0.25s linear;
+  -moz-transition: font-size 0.25s linear, width 0.25s linear;
+  transition: font-size 0.25s linear, width 0.25s linear;
+}
+
+.icon_lists .icon:hover {
+  font-size: 100px;
+}
+
+.icon_lists .svg-icon {
+  /* 通过设置 font-size 来改变图标大小 */
+  width: 1em;
+  /* 图标和文字相邻时,垂直对齐 */
+  vertical-align: -0.15em;
+  /* 通过设置 color 来改变 SVG 的颜色/fill */
+  fill: currentColor;
+  /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
+      normalize.css 中也包含这行 */
+  overflow: hidden;
+}
+
+.icon_lists li .name,
+.icon_lists li .code-name {
+  color: #666;
+}
+
+/* markdown 样式 */
+.markdown {
+  color: #666;
+  font-size: 14px;
+  line-height: 1.8;
+}
+
+.highlight {
+  line-height: 1.5;
+}
+
+.markdown img {
+  vertical-align: middle;
+  max-width: 100%;
+}
+
+.markdown h1 {
+  color: #404040;
+  font-weight: 500;
+  line-height: 40px;
+  margin-bottom: 24px;
+}
+
+.markdown h2,
+.markdown h3,
+.markdown h4,
+.markdown h5,
+.markdown h6 {
+  color: #404040;
+  margin: 1.6em 0 0.6em 0;
+  font-weight: 500;
+  clear: both;
+}
+
+.markdown h1 {
+  font-size: 28px;
+}
+
+.markdown h2 {
+  font-size: 22px;
+}
+
+.markdown h3 {
+  font-size: 16px;
+}
+
+.markdown h4 {
+  font-size: 14px;
+}
+
+.markdown h5 {
+  font-size: 12px;
+}
+
+.markdown h6 {
+  font-size: 12px;
+}
+
+.markdown hr {
+  height: 1px;
+  border: 0;
+  background: #e9e9e9;
+  margin: 16px 0;
+  clear: both;
+}
+
+.markdown p {
+  margin: 1em 0;
+}
+
+.markdown>p,
+.markdown>blockquote,
+.markdown>.highlight,
+.markdown>ol,
+.markdown>ul {
+  width: 80%;
+}
+
+.markdown ul>li {
+  list-style: circle;
+}
+
+.markdown>ul li,
+.markdown blockquote ul>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown>ul li p,
+.markdown>ol li p {
+  margin: 0.6em 0;
+}
+
+.markdown ol>li {
+  list-style: decimal;
+}
+
+.markdown>ol li,
+.markdown blockquote ol>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown code {
+  margin: 0 3px;
+  padding: 0 5px;
+  background: #eee;
+  border-radius: 3px;
+}
+
+.markdown strong,
+.markdown b {
+  font-weight: 600;
+}
+
+.markdown>table {
+  border-collapse: collapse;
+  border-spacing: 0px;
+  empty-cells: show;
+  border: 1px solid #e9e9e9;
+  width: 95%;
+  margin-bottom: 24px;
+}
+
+.markdown>table th {
+  white-space: nowrap;
+  color: #333;
+  font-weight: 600;
+}
+
+.markdown>table th,
+.markdown>table td {
+  border: 1px solid #e9e9e9;
+  padding: 8px 16px;
+  text-align: left;
+}
+
+.markdown>table th {
+  background: #F7F7F7;
+}
+
+.markdown blockquote {
+  font-size: 90%;
+  color: #999;
+  border-left: 4px solid #e9e9e9;
+  padding-left: 0.8em;
+  margin: 1em 0;
+}
+
+.markdown blockquote p {
+  margin: 0;
+}
+
+.markdown .anchor {
+  opacity: 0;
+  transition: opacity 0.3s ease;
+  margin-left: 8px;
+}
+
+.markdown .waiting {
+  color: #ccc;
+}
+
+.markdown h1:hover .anchor,
+.markdown h2:hover .anchor,
+.markdown h3:hover .anchor,
+.markdown h4:hover .anchor,
+.markdown h5:hover .anchor,
+.markdown h6:hover .anchor {
+  opacity: 1;
+  display: inline-block;
+}
+
+.markdown>br,
+.markdown>p>br {
+  clear: both;
+}
+
+
+.hljs {
+  display: block;
+  background: white;
+  padding: 0.5em;
+  color: #333333;
+  overflow-x: auto;
+}
+
+.hljs-comment,
+.hljs-meta {
+  color: #969896;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-strong,
+.hljs-emphasis,
+.hljs-quote {
+  color: #df5000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+  color: #a71d5d;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute {
+  color: #0086b3;
+}
+
+.hljs-section,
+.hljs-name {
+  color: #63a35c;
+}
+
+.hljs-tag {
+  color: #333333;
+}
+
+.hljs-title,
+.hljs-attr,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+  color: #795da3;
+}
+
+.hljs-addition {
+  color: #55a532;
+  background-color: #eaffea;
+}
+
+.hljs-deletion {
+  color: #bd2c00;
+  background-color: #ffecec;
+}
+
+.hljs-link {
+  text-decoration: underline;
+}
+
+/* 代码高亮 */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+code[class*="language-"],
+pre[class*="language-"] {
+  color: black;
+  background: none;
+  text-shadow: 0 1px white;
+  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+  text-align: left;
+  white-space: pre;
+  word-spacing: normal;
+  word-break: normal;
+  word-wrap: normal;
+  line-height: 1.5;
+
+  -moz-tab-size: 4;
+  -o-tab-size: 4;
+  tab-size: 4;
+
+  -webkit-hyphens: none;
+  -moz-hyphens: none;
+  -ms-hyphens: none;
+  hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection,
+pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection,
+code[class*="language-"] ::-moz-selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection,
+pre[class*="language-"] ::selection,
+code[class*="language-"]::selection,
+code[class*="language-"] ::selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+@media print {
+
+  code[class*="language-"],
+  pre[class*="language-"] {
+    text-shadow: none;
+  }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+  padding: 1em;
+  margin: .5em 0;
+  overflow: auto;
+}
+
+:not(pre)>code[class*="language-"],
+pre[class*="language-"] {
+  background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre)>code[class*="language-"] {
+  padding: .1em;
+  border-radius: .3em;
+  white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+  color: slategray;
+}
+
+.token.punctuation {
+  color: #999;
+}
+
+.namespace {
+  opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+  color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+  color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+  color: #9a6e3a;
+  background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+  color: #07a;
+}
+
+.token.function,
+.token.class-name {
+  color: #DD4A68;
+}
+
+.token.regex,
+.token.important,
+.token.variable {
+  color: #e90;
+}
+
+.token.important,
+.token.bold {
+  font-weight: bold;
+}
+
+.token.italic {
+  font-style: italic;
+}
+
+.token.entity {
+  cursor: help;
+}

File diff suppressed because it is too large
+ 3938 - 0
static/font/demo_index.html


File diff suppressed because it is too large
+ 668 - 0
static/font/iconfont.css


BIN
static/font/iconfont.eot


File diff suppressed because it is too large
+ 1 - 0
static/font/iconfont.js


File diff suppressed because it is too large
+ 1150 - 0
static/font/iconfont.json


File diff suppressed because it is too large
+ 245 - 0
static/font/iconfont.svg


BIN
static/font/iconfont.ttf


BIN
static/font/iconfont.woff


BIN
static/font/iconfont.woff2


+ 818 - 0
static/h52dgp.html

@@ -0,0 +1,818 @@
+<!DOCTYPE html>
+<html lang=zh-CN>
+	<head>
+		<meta charset="utf-8" />
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<title>监控详情页</title>
+		<link href="https://unpkg.com/video.js@7.10.2/dist/video-js.min.css" rel="stylesheet" />
+		<style type="text/css">
+			body {
+				margin: 0;
+				background-color: #f3f3f3;
+			}
+
+			span.vjs-control-text {
+				display: none;
+			}
+
+			/* iframe {
+				width: 375px;
+				height: 667px;
+				background-color: #fff;
+				box-sizing: content-box;
+				border: none;
+			} */
+			.btn-box {
+				margin-top: 20px;
+				display: flex;
+				flex-direction: row;
+				justify-content: space-around;
+				align-items: center;
+			}
+
+			.btn-container {
+				position: relative;
+			}
+
+			.videoBtnPlay {
+				position: absolute;
+				height: 100px;
+				width: 100px;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%, -50%);
+			}
+
+			.more,
+			.less {
+				flex: 1
+			}
+
+			img {
+				width: 100%;
+			}
+
+			.direc {
+				width: 150px;
+				height: 150px;
+				background: url('https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/monitor/1.png');
+				background-size: 100% auto;
+				background-repeat: no-repeat;
+				position: relative;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+			}
+
+			.direc div {
+				width: 50px;
+				height: 50px;
+				position: absolute;
+			}
+
+			.photo {
+				font-size: 30px;
+				color: #4ec467;
+				padding: 16px;
+			}
+
+			.top {
+				top: 0;
+				left: 50px
+			}
+
+			.bottom {
+				bottom: 0;
+				left: 50px
+			}
+
+			.left {
+				left: 0;
+				top: 50px
+			}
+
+			.right {
+				right: 0;
+				top: 50px
+			}
+
+			#box {
+				height: 300px;
+				width: 100%;
+				background: #000;
+				overflow: hidden;
+			}
+
+			#dialog {
+				display: none;
+				min-width: 200px;
+				line-height: 80px;
+				background: rgba(0, 0, 0, .8);
+				color: #fff;
+				text-align: center;
+				position: absolute;
+				left: 50%;
+				margin-left: -100px;
+				border-radius: 4px;
+				z-index: 999;
+				top: 50%;
+				margin-top: -40px;
+			}
+
+			.imgBtn {
+				position: absolute;
+				width: 100%;
+				padding: 10px;
+				bottom: 0;
+				left: 0;
+				text-align: center;
+				color: #338cd9;
+				font-size: 16px;
+				box-sizing: border-box;
+				display: flex;
+				justify-content: center;
+				gap: 16px;
+			}
+
+			.imgBtn div {
+				/* padding: 0 16px; */
+			}
+
+			.imgBtn img {
+				display: inline-block;
+				width: 20px;
+				height: 20px;
+				vertical-align: middle;
+				margin-right: 2px;
+				margin-bottom: 3px;
+			}
+
+			.imgBtnDgp {
+				display: none;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="btn-container">
+			<div id="box"> </div>
+			<div class="videoBtnPlay">
+				<img src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/wxplayer.png" />
+			</div>
+		</div>
+		<div id="dialog">
+
+		</div>
+		<div class="btn-box">
+			<div class="more" ontouchstart="_configCamera('move', 8)" ontouchend="_stopConfigCamera()">
+				<image src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/monitor/3.png" mode="widthFix">
+				</image>
+			</div>
+			<div class="direc">
+				<div class="top" ontouchstart="_configCamera('move', 0)" ontouchend="_stopConfigCamera()">
+
+				</div>
+				<div class="bottom" ontouchstart="_configCamera('move', 1)" ontouchend="_stopConfigCamera()">
+
+				</div>
+				<p class="photo yficonfont icon-paizhao-xianxing" ontouchstart="_configCamera('takephoto', '')">
+
+				</p>
+				<div class="left" ontouchstart="_configCamera('move', 2)" ontouchend="_stopConfigCamera()">
+
+				</div>
+				<div class="right" ontouchstart="_configCamera('move', 3)" ontouchend="_stopConfigCamera()">
+
+				</div>
+			</div>
+			<div class="less" ontouchstart="_configCamera('move', 9)" ontouchend="_stopConfigCamera()">
+				<image src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/monitor/2.png" mode="widthFix">
+				</image>
+			</div>
+		</div>
+		<div class="imgBtn">
+			<div class="imgBtnCamrea"> <img src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/img_icon.png" />查看图片</div>
+			<div class="imgBtnDgp"><img src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/img/img_icon.png" />查看光谱图片</div>
+
+		</div>
+	</body>
+	<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
+	<!-- 微信 JS-SDK 如果不需要兼容小程序,则无需引用此 JS 文件。 -->
+	<!-- <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> -->
+	<!-- uni 的 SDK -->
+	<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
+
+	<script src="https://unpkg.com/video.js@7.10.2/dist/video.min.js"></script>
+	<script type="module">
+		import Player from 'https://wx.hnyfwlw.com/wexin/videoPlayer/videoPlay-js.js'
+		// const domin = 'https://wx.hnyfwlw.com'
+    const domin = 'http://218.28.198.186:10508'
+		// 检测HLS支持
+		function checkHLSSupport() {
+			const video = document.createElement('video');
+			return video.canPlayType('application/vnd.apple.mpegurl') !== '' || 
+				   video.canPlayType('application/x-mpegURL') !== '';
+		}
+		
+		// 加载HLS.js库(如果需要)
+		function loadHLSJS() {
+			return new Promise((resolve, reject) => {
+				if (window.Hls) {
+					resolve();
+					return;
+				}
+				
+				const script = document.createElement('script');
+				script.src = 'https://cdn.jsdelivr.net/npm/hls.js@latest';
+				script.onload = () => {
+					console.log('HLS.js加载完成');
+					resolve();
+				};
+				script.onerror = reject;
+				document.head.appendChild(script);
+			});
+		}
+		
+		let player = null
+		let stopTimer = 0
+		
+		// 更安全的URL参数解析
+		function getUrlParam(name) {
+			const urlParams = new URLSearchParams(window.location.search)
+			return urlParams.get(name) || ''
+		}
+		
+		var device_id = getUrlParam('device_id')
+		var accessToken = getUrlParam('accessToken') 
+		var videoType = getUrlParam('videoType')
+		var token = accessToken
+		
+		console.log('解析结果:', { device_id, accessToken, videoType })
+		console.log('视频类型检查:', videoType, videoType === 'dgp')
+		// 通用错误处理函数
+		function showError(message, duration = 3000) {
+			$('#dialog').html(message).stop().show(500).delay(duration).hide(500);
+			$('.videoBtnPlay').show();
+		}
+		
+		// 安全的JSON解析
+		function safeParseJSON(str) {
+			try {
+				return JSON.parse(str);
+			} catch(e) {
+				console.warn('JSON解析失败,尝试eval:', e);
+				try {
+					return eval('(' + str + ')');
+				} catch(e2) {
+					console.error('数据解析完全失败:', e2);
+					return null;
+				}
+			}
+		}
+		
+		// 验证API响应
+		function validateAPIResponse(res, apiName = 'API') {
+			console.log(`${apiName}响应:`, res);
+			
+			if (!res) {
+				console.error(`${apiName}响应为空`);
+				return { valid: false, error: '服务器无响应' };
+			}
+			
+			if (res.message && res.message !== '') {
+				console.error(`${apiName}返回错误:`, res.message);
+				return { valid: false, error: res.message };
+			}
+			
+			if (!res.data) {
+				console.error(`${apiName}返回数据为空`);
+				return { valid: false, error: '返回数据为空' };
+			}
+			
+			return { valid: true, data: res.data };
+		}
+		
+		// 获取可用的视频源
+		function getAvailableVideoSource(data, preferredType = 'hls') {
+			const sources = {
+				hls: data.hls,
+				hlsHd: data.hlsHd,
+				rtmp: data.rtmp,
+				rtsp: data.rtsp
+			};
+			
+			console.log('可用视频源:', sources);
+			
+			// 优先使用指定类型
+			if (sources[preferredType] && sources[preferredType] !== 'undefined' && sources[preferredType] !== '') {
+				return { source: sources[preferredType], type: preferredType };
+			}
+			
+			// 按优先级查找可用源
+			const priority = ['hls', 'hlsHd', 'rtmp', 'rtsp'];
+			for (const type of priority) {
+				if (sources[type] && sources[type] !== 'undefined' && sources[type] !== '') {
+					return { source: sources[type], type: type };
+				}
+			}
+			
+			return { source: null, type: null };
+		}
+		
+		// 检查设备状态
+		function checkDeviceStatus() {
+			console.log('检查设备状态...');
+			$('#dialog').html('检查设备状态...').stop().show();
+			
+			return $.ajax({
+				type: "POST",
+				url: `${domin}/api/api_gateway?method=device.device_manage.get_device_info`,
+				data: {
+					device_id: device_id,
+					token: token
+				},
+				timeout: 5000
+			}).then((res) => {
+				console.log('设备状态响应:', res);
+				if (res && res.message === '' && res.data) {
+					const deviceInfo = typeof res.data === 'string' ? safeParseJSON(res.data) : res.data;
+					console.log('设备信息:', deviceInfo);
+					return deviceInfo;
+				} else {
+					throw new Error(res.message || '获取设备信息失败');
+				}
+			}).catch((error) => {
+				console.error('设备状态检查失败:', error);
+				showError('设备状态检查失败: ' + (error.message || '网络错误'));
+				throw error;
+			});
+		}
+		
+		window._configCamera = configCamera;
+		window._stopConfigCamera = stopConfigCamera;
+		window._postPic = postPic;
+		
+		// 确保DOM加载完成后再执行jQuery操作
+		$(document).ready(function() {
+			// 初始化HLS支持
+			if (!checkHLSSupport()) {
+				console.log('浏览器不支持原生HLS,加载HLS.js');
+				loadHLSJS().catch(e => {
+					console.error('HLS.js加载失败:', e);
+				});
+			}
+			
+			if (videoType == 'dgp') {
+				$('.imgBtnDgp').show()
+			} else {
+				$('.imgBtnDgp').hide()
+			}
+			
+			$('.photo').click(() => {
+				// 拍照功能
+			})
+		})
+
+		function configCamera(ctrl, movenum) {
+			if (ctrl == "takephoto") {
+
+				if (player) {
+					// 云联的拍照特殊处理
+					player.screenshot('yunlianPlayer')
+				} else {
+
+					$('#dialog').html('拍照指令正在下发,请等待...').stop().show(50)
+					let url = `${domin}/api/api_gateway?method=camera.camera_manage.camera_takephoto`
+					if (videoType == 'dgp') {
+						url = `${domin}/api/api_gateway?method=camera.camera_manage.multi_camera_takephoto`
+					}
+					$.ajax({
+						type: "POST",
+						url: url,
+						data: {
+							device_id: device_id,
+							token
+						}
+					}).then((res) => {
+
+						if (res.data == true) {
+							$('#dialog').html('拍照成功').stop().show(500).delay(1000).hide(500)
+						} else {
+							$('#dialog').html(res.message).stop().show(500).delay(1000).hide(500)
+						}
+					});
+				}
+
+			} else {
+				let url = `${domin}/api/api_gateway?method=camera.camera_manage.ctrl_camera`
+				let postData = {
+					device_id: device_id,
+					token
+				}
+				if (videoType == 'dgp') {
+					url = `${domin}/api/api_gateway?method=camera.camera_manage.multi_ctrl_camera`
+					postData.ctrl = movenum
+				} else {
+					postData.ctrl = ctrl
+					postData.movenum = movenum
+				}
+				//上下左右、放大、缩小
+				$.ajax({
+					type: "POST",
+					url: url,
+					data: postData
+				}).then((res) => {
+					$('#dialog').html('指令下发成功,请等待...').stop().show(500).delay(3000).hide(500)
+				})
+			}
+		}
+
+		function stopConfigCamera() {
+
+			if (videoType == 'dgp') {
+				if(stopTimer) clearTimeout(stopTimer)
+				stopTimer = setTimeout(()=>{
+					$.ajax({
+						type: "POST",
+						url: "http://47.110.79.22:9000/api/api_gateway?method=camera.camera_manage.mulit_stop_move",
+						data: {
+							device_id: device_id,
+							token
+						},
+					});
+				},3000)
+				
+			} else {
+				$.ajax({
+					type: "POST",
+					url: "http://47.110.79.22:9000/api/api_gateway?method=camera.camera_manage.ctrl_camera",
+					data: {
+						device_id: device_id,
+						ctrl: "stop",
+						token
+					},
+				});
+			}
+		}
+
+		function postPic(file) {
+			let form = new FormData()
+			form.append('img_file', file)
+			form.append('device_id', device_id)
+			form.append('token', token)
+			$.ajax({
+				type: "POST",
+				url: "http://47.110.79.22:9000/api/api_gateway?method=camera.camera_manage.save_camera_photo",
+				contentType: false,
+				processData: false,
+				data: form
+			}).then((res) => {
+
+				if (res.message == '') {
+					$('#dialog').html('拍照成功').stop().show(500).delay(1500).hide(500)
+				} else {
+					$('#dialog').html(res.data.message).stop().show(500).delay(1500).hide(500)
+				}
+			});
+
+		}
+		async function initYunlianPlayer(videoURL) {
+			var playHtml =
+				`<div id="yunlianPlayer" style="width: 100%;height: 300px;overflow: hidden;"></div>`;
+			$("#box").html(playHtml)
+			player = new Player(['yunlianPlayer'], {
+				playFileOver: () => {
+					console.log('播放结束')
+				},
+				playError: (id, e) => {
+					console.log('播放错误', id, e)
+				},
+				talkStart: () => {
+					console.log('对讲开始')
+				},
+				runtimeInitializedCallBack: () => {
+					console.log('播放器初始化完成')
+				},
+				captureCallback: (id, data) => {
+					// console.log('截图返回的数据', data.buffer)
+					const blob = new Blob([data], {
+						type: 'image/jpeg'
+					})
+					_postPic(blob)
+				}
+			})
+			await player.init()
+			setTimeout(() => {
+				player.play('yunlianPlayer', {
+					streamURL: videoURL,
+
+					channelId: '0',
+
+					bitStream: '0',
+
+					isLive: true
+				})
+			}, 1000)
+		}
+
+
+		$('.videoBtnPlay').click(function() {
+			$('.videoBtnPlay').hide()
+			console.log(videoType,'videoTypevideoType')
+			
+			// 显示加载提示
+			$('#dialog').html('正在获取视频流...').stop().show();
+			
+			// 先检查设备状态(可选,如果API支持的话)
+			// checkDeviceStatus().then(() => {
+				if (videoType == 'dgp') {
+					$.ajax({
+						type: "POST",
+						url: "http://47.110.79.22:9000/api/api_gateway?method=camera.camera_manage.multi_addr_camera",
+						data: {
+							device_id: device_id,
+							token
+						},
+						timeout: 15000 // 15秒超时
+					}).then((res) => {
+					$('#dialog').hide(); // 隐藏加载提示
+					
+					const validation = validateAPIResponse(res, 'DGP视频流API');
+					if (!validation.valid) {
+						showError(validation.error);
+						return;
+					}
+					
+					let data = validation.data;
+					if (typeof data == 'string') {
+						data = safeParseJSON(data);
+						if (!data) {
+							showError('DGP数据解析失败');
+							return;
+						}
+					}
+					
+					console.log('DGP解析后的数据:', data);
+					
+					// 获取可用的视频源(DGP优先使用rtmp)
+					const videoSource = getAvailableVideoSource(data, 'rtmp');
+					
+					if (!videoSource.source) {
+						console.error('DGP没有找到可用的视频源');
+						showError('设备可能离线或未配置视频流,请检查设备状态');
+						return;
+					}
+					
+					console.log(`使用${videoSource.type}视频源:`, videoSource.source);
+						
+					console.log(`使用${videoSource.type}视频源:`, videoSource.source);
+					
+					const hlsHdSrc = videoSource.source;
+					
+					var playHtml =
+						`<video id="myPlayer" poster='' controls playsInline webkit-playsinline style="width:100%; height:100%;"></video>`;
+					$("#box").html(playHtml)
+					
+					var myVideo = videojs(`myPlayer`, {
+						controls: true,
+						autoplay: false,
+						preload: 'metadata',
+						sources: [{
+							type: videoSource.type === 'rtmp' ? 'rtmp/flv' : 'application/x-mpegURL',
+							src: hlsHdSrc,
+						}],
+						html5: {
+							hls: {
+								enableLowInitialPlaylist: true,
+								smoothQualityChange: true,
+								overrideNative: true
+							}
+						}
+					}, function onPlayerReady() {
+						console.log('DGP播放器准备完成');
+						// 延迟播放,确保源加载完成
+						setTimeout(() => {
+							myVideo.play().catch(e => {
+								console.error('DGP播放失败:', e);
+								showError('DGP视频播放失败: ' + e.message);
+							});
+						}, 500);
+					});
+					
+					// 添加错误处理
+					myVideo.on('error', function(e) {
+						console.error('DGP Video.js错误:', e, myVideo.error());
+						const error = myVideo.error();
+						let errorMsg = 'DGP视频播放出错';
+						
+						if (error) {
+							switch(error.code) {
+								case 1:
+									errorMsg = 'DGP视频加载被中止';
+									break;
+								case 2:
+									errorMsg = 'DGP网络错误导致视频下载失败';
+									break;
+								case 3:
+									errorMsg = 'DGP视频解码失败';
+									break;
+								case 4:
+									errorMsg = 'DGP视频格式不支持或视频源无效';
+									break;
+								default:
+									errorMsg = 'DGP未知播放错误';
+							}
+						}
+						
+						showError(errorMsg);
+					});
+					
+					myVideo.on('play', function() {
+						console.log('DGP开始播放')
+					});
+					
+					myVideo.on('loadstart', function() {
+						console.log('DGP开始加载视频');
+					});
+					
+					myVideo.on('canplay', function() {
+						console.log('DGP视频可以播放');
+					});
+				})
+
+			} else {
+				$.ajax({
+					type: "POST",
+					// url: "http://47.110.79.22:9000/api/api_gateway?method=camera.camera_manage.multi_addr_camera",
+					url: "http://192.168.1.107:8000/api/api_gateway?method=camera.camera_manage.multi_addr_camera",
+					data: {
+						device_id: device_id,
+						token
+						// device_id: 'FA8690323-1',
+						// token: localStorage.getItem('session_key')
+					}
+				}).then((res) => {
+					console.log('API响应:', res);
+					if (res && res.message == '') {
+						var data = null
+						if (typeof res.data == 'string') {
+							data = safeParseJSON(res.data);
+						} else {
+							data = res.data;
+						}
+						
+						if (!data) {
+							showError('数据解析失败');
+							return;
+						}
+						
+						console.log('解析后的数据:', data);
+						console.log('数据字段检查:', {
+							type_id: data.type_id,
+							hls: data.hls,
+							hlsHd: data.hlsHd,
+							rtsp: data.rtsp,
+							rtmp: data.rtmp
+						});
+						
+						if (data.type_id == 2) {
+							// 大华云联
+							if (!data.rtsp || data.rtsp === 'undefined' || data.rtsp === '') {
+								console.error('RTSP视频源无效:', data.rtsp);
+								showError('RTSP视频源获取失败,请检查设备配置');
+								return;
+							}
+							initYunlianPlayer(data.rtsp)
+
+						} else {
+							let hlsHdSrc = data.type_id == 0 ? data.hls : data.hlsHd;
+							
+							console.log('选择的视频源字段:', data.type_id == 0 ? 'hls' : 'hlsHd');
+							console.log('视频源值:', hlsHdSrc);
+							
+							// 如果主要源无效,尝试备用源
+							if (!hlsHdSrc || hlsHdSrc === 'undefined' || hlsHdSrc === '') {
+								console.warn('主要视频源无效,尝试备用源');
+								hlsHdSrc = data.hls || data.hlsHd || data.rtmp || data.rtsp;
+								console.log('备用视频源:', hlsHdSrc);
+							}
+							
+							// 验证视频源
+							if (!hlsHdSrc || hlsHdSrc === 'undefined' || hlsHdSrc === '') {
+								console.error('所有视频源都无效:', {
+									hls: data.hls,
+									hlsHd: data.hlsHd,
+									rtmp: data.rtmp,
+									rtsp: data.rtsp
+								});
+								showError('视频源获取失败,请检查设备是否在线或联系管理员');
+								return;
+							}
+							
+							console.log('视频源:', hlsHdSrc);
+							
+							var playHtml =
+								`<video id="myPlayer" poster='' controls playsInline webkit-playsinline style="width:100%; height:100%;"></video>`;
+							$("#box").html(playHtml)
+							
+							var myVideo = videojs(`myPlayer`, {
+								controls: true,
+								autoplay: false,
+								preload: 'metadata',
+								sources: [{
+									type: 'application/x-mpegURL',
+									src: hlsHdSrc,
+								}],
+								html5: {
+									hls: {
+										enableLowInitialPlaylist: true,
+										smoothQualityChange: true,
+										overrideNative: true
+									}
+								}
+							}, function onPlayerReady() {
+								console.log('播放器准备完成');
+								setTimeout(() => {
+									myVideo.play().catch(e => {
+										console.error('播放失败:', e);
+										$('#dialog').html('视频播放失败: ' + e.message).stop().show(500).delay(3000).hide(500);
+										$('.videoBtnPlay').show();
+									});
+								}, 500);
+							});
+							
+							// 添加错误处理
+							myVideo.on('error', function(e) {
+								console.error('Video.js错误:', e, myVideo.error());
+								const error = myVideo.error();
+								let errorMsg = '视频播放出错';
+								
+								if (error) {
+									switch(error.code) {
+										case 1:
+											errorMsg = '视频加载被中止';
+											break;
+										case 2:
+											errorMsg = '网络错误导致视频下载失败';
+											break;
+										case 3:
+											errorMsg = '视频解码失败';
+											break;
+										case 4:
+											errorMsg = '视频格式不支持或视频源无效';
+											break;
+										default:
+											errorMsg = '未知播放错误';
+									}
+								}
+								
+								$('#dialog').html(errorMsg).stop().show(500).delay(3000).hide(500);
+								$('.videoBtnPlay').show();
+							});
+							
+							myVideo.on('play', function() {
+								console.log('开始播放')
+							});
+							
+							myVideo.on('loadstart', function() {
+								console.log('开始加载视频');
+							});
+							
+							myVideo.on('canplay', function() {
+								console.log('视频可以播放');
+							});
+						}
+
+					} else {
+						alert(res.message)
+					}
+
+				})
+
+			}
+
+		})
+		document.addEventListener('UniAppJSBridgeReady', function() {
+
+			$('.imgBtnCamrea').click(function() {
+				// if (player) {
+				// 	player.close('yunlianPlayer')
+				// 	player = null
+				// }
+				uni.navigateTo({
+					url: '/pages/monitor/imagelist?id=' + device_id
+				})
+			})
+			$('.imgBtnDgp').click(function() {
+				// if (player) {
+				// 	player.close('yunlianPlayer')
+				// 	player = null
+				// }
+
+				uni.navigateTo({
+					url: '/pages/monitor/dgpImagelist?id=' + device_id
+				})
+			})
+		});
+	</script>
+</html>

File diff suppressed because it is too large
+ 1 - 0
static/videoPlayer/playerWasm/PlaySDKInterface.js


File diff suppressed because it is too large
+ 1023 - 0
static/videoPlayer/playerWasm/public.js


File diff suppressed because it is too large
+ 1147 - 0
static/videoPlayer/videoPlay-js.js


+ 2 - 1
util/api.js

@@ -2,8 +2,9 @@
 // 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 = 'https://wx.hnyfwlw.com';
 // let BASE_URL = 'http://218.28.198.186:10508';
+let BASE_URL = 'http://192.168.1.107:8000';
 export const myRequest = (options) => {
   // BASE_URL=uni.getStorageSync('http')
   // if(BASE_URL==''){