2023-11-21 18:54:33 +08:00
|
|
|
<template>
|
2023-11-23 10:58:26 +08:00
|
|
|
<view class="" style="position: relative;">
|
|
|
|
<view class="top">
|
2023-11-30 17:51:39 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
<view class="" style="height:var(--status-bar-height) ;">
|
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
|
<view class="nav-con" style="justify-content: space-between;">
|
|
|
|
<!-- #endif -->
|
|
|
|
<!-- #ifdef H5 -->
|
|
|
|
<view class="nav-con" style="justify-content: flex-end;">
|
|
|
|
<!-- #endif -->
|
|
|
|
|
|
|
|
|
|
|
|
<view class="nav">
|
|
|
|
|
|
|
|
|
|
|
|
<view class="">
|
|
|
|
<u-icon name="scan" @click="scanFn" color="white" :size="30"></u-icon>
|
|
|
|
</view>
|
|
|
|
<view class="" style="margin-left: 20rpx;">
|
|
|
|
<u-icon name="coupon-fill" color="white" @click="showModal=true" :size="28"></u-icon>
|
|
|
|
</view>
|
|
|
|
<view class="" style="margin-left: 20rpx;">
|
|
|
|
<u-icon name="plus-circle" color="white" @click="navto('/pages/addLand/addLand')"
|
|
|
|
:size="28"></u-icon>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
|
<view class="" style="margin-top: -5rpx;">
|
|
|
|
|
|
|
|
<Myindex url='/pages/index/massif' />
|
|
|
|
</view>
|
|
|
|
<!-- #endif -->
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
|
|
|
<view class="">
|
|
|
|
<view class="" style="height:var(--status-bar-height) ;">
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="nav-con" style="margin-bottom: 80rpx;">
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-21 18:54:33 +08:00
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="content" v-if="true">
|
|
|
|
<!-- 土地信息 -->
|
|
|
|
<view class="">
|
|
|
|
<view class="card" v-if="Object.keys(dataobj).length>0">
|
|
|
|
<view class="" @click="navgo">
|
|
|
|
<view class="" style="margin: 10rpx 0;">
|
|
|
|
土地名称: {{dataobj.title}}
|
|
|
|
</view>
|
|
|
|
<!-- <view class="" style="margin: 10rpx 0;">
|
2023-11-23 10:58:26 +08:00
|
|
|
农作物: 洋芋
|
2023-11-25 16:18:54 +08:00
|
|
|
</view> -->
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="" style="margin: 10rpx 0;">
|
|
|
|
土地面积: {{dataobj.total_area}}亩
|
|
|
|
</view>
|
|
|
|
<view class="" style="margin: 10rpx 0;">
|
|
|
|
种植面积: {{dataobj.total_area-dataobj.residual_area}}亩
|
|
|
|
</view>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="changeLand" @click="show=true">
|
|
|
|
切换土地
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
|
2023-11-21 18:54:33 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="card" v-else>
|
2023-11-23 10:58:26 +08:00
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
<view class="">
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="">
|
|
|
|
暂无信息
|
|
|
|
</view>
|
2023-11-27 18:23:17 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
2023-11-27 18:23:17 +08:00
|
|
|
|
|
|
|
|
2023-11-21 18:54:33 +08:00
|
|
|
</view>
|
2023-12-07 09:34:25 +08:00
|
|
|
|
2023-11-21 18:54:33 +08:00
|
|
|
</view>
|
2023-12-09 17:07:42 +08:00
|
|
|
<view class="add-thing" v-if="(dataobj.total_area-dataobj.residual_area)==0" @click="palnt(dataobj.id)">
|
|
|
|
新增种植
|
|
|
|
</view>
|
|
|
|
<view class="" v-else>
|
|
|
|
<view class="add-thing" @click="showPicker1=true" v-if="columns2[0]&&columns2[0].length>0">
|
2023-12-07 09:34:25 +08:00
|
|
|
|
2023-12-09 17:07:42 +08:00
|
|
|
记农事
|
|
|
|
</view>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<!-- 苗情监测 -->
|
|
|
|
<view class="">
|
|
|
|
<view class="live-video soil-monitor">
|
|
|
|
<view class="head">
|
|
|
|
<view class="tit">
|
|
|
|
苗情监测数据
|
|
|
|
</view>
|
|
|
|
<view class="flushed-time">
|
|
|
|
<u-icon name="clock"></u-icon>
|
|
|
|
<text>刷新时间: {{getNowTimeFn()}} </text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="video" @click="navto('/pages/live/live')">
|
|
|
|
<!-- <u--image :src="url" width="100%" height="300rpx"></u--image> -->
|
|
|
|
<u-swiper :list="dataobj.pic" width="100%" height="300rpx"></u-swiper>
|
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
|
|
|
<!-- 土壤监测 -->
|
|
|
|
<view class="">
|
|
|
|
<view class="soil-monitor">
|
|
|
|
<view class="head">
|
|
|
|
<view class="tit">
|
|
|
|
土壤监测数据
|
|
|
|
</view>
|
|
|
|
<view class="flushed-time">
|
|
|
|
<u-icon name="clock"></u-icon>
|
|
|
|
<text>刷新时间: {{getNowTimeFn()}} </text>
|
|
|
|
</view>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="monitor-content"
|
|
|
|
v-if="dataobj&&dataobj.monitor&&dataobj.soil_monitor_data&&Object.keys(dataobj.soil_monitor_data).length>0">
|
|
|
|
<view class="monitor-card" v-for="(item,index) in soilList" :key="index">
|
|
|
|
<view class="name">
|
|
|
|
<view class="">
|
|
|
|
<u--image :src="item.icon" width="38.55rpx" height="38.55rpx"></u--image>
|
|
|
|
</view>
|
|
|
|
<view class="" style="margin-left: 10rpx;">
|
|
|
|
{{item.name}}
|
|
|
|
</view>
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="num">
|
|
|
|
<text style="font-size: 70rpx;">{{item.num}}</text>
|
|
|
|
<text>{{item.unit}}</text>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="coneng-detail" v-else>
|
2023-11-29 18:11:21 +08:00
|
|
|
<view class="">
|
2023-11-30 17:51:39 +08:00
|
|
|
<image src="@/static/img/zw.png" mode="aspectFit"></image>
|
|
|
|
<view class="">
|
|
|
|
暂无数据
|
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<!-- 环境监测 -->
|
|
|
|
<view class="soil-monitor">
|
|
|
|
<view class="head">
|
|
|
|
<view class="tit">
|
|
|
|
环境监测数据
|
|
|
|
</view>
|
|
|
|
<view class="flushed-time">
|
|
|
|
<u-icon name="clock"></u-icon>
|
|
|
|
<text>刷新时间: {{getNowTimeFn()}} </text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="monitor-content"
|
|
|
|
v-if="dataobj&&dataobj.monitor&&dataobj.monitor.air_monitor_data&&Object.keys(dataobj.monitor.air_monitor_data).length>0">
|
|
|
|
<view class="monitor-card" v-for="(item,index) in environmentList" :key="index">
|
|
|
|
<view class="name">
|
|
|
|
<view class="">
|
|
|
|
<u--image :src="item.icon" width="38.55rpx" height="38.55rpx"></u--image>
|
|
|
|
</view>
|
|
|
|
<view class="" style="margin-left: 10rpx;">
|
|
|
|
{{item.name}}
|
|
|
|
</view>
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="num">
|
|
|
|
<text style="font-size: 70rpx;">{{item.num}}</text>
|
|
|
|
<text>{{item.unit}}</text>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="coneng-detail" v-else>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
|
|
|
<view class="">
|
2023-11-30 17:51:39 +08:00
|
|
|
<image src="@/static/img/zw.png" mode="aspectFit"></image>
|
|
|
|
<view class="">
|
|
|
|
暂无数据
|
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
2023-11-29 18:11:21 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<!-- 组件 -->
|
2023-11-23 10:58:26 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<u-loading-page :loading="showLoading"></u-loading-page>
|
2023-11-23 10:58:26 +08:00
|
|
|
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<u-action-sheet :show="show" keyName="name" closeOnClickOverlay :actions="columns" title="请选择"
|
|
|
|
@close="show = false" @select="confirm">
|
|
|
|
</u-action-sheet>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
<view class="empty" v-else>
|
|
|
|
<view class="addLand">
|
|
|
|
<view class="">
|
|
|
|
你还没有土地信息
|
|
|
|
</view>
|
|
|
|
<view class="addBtn" @click="navto('/pages/addLand/addLand')">
|
|
|
|
去添加
|
|
|
|
</view>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
|
|
|
<!-- 组件 -->
|
|
|
|
|
|
|
|
<view class="Modal">
|
|
|
|
<u-popup :show="showModal" mode="center" @close="closeModal" :round="10">
|
|
|
|
<view class="Modal">
|
|
|
|
<text> 产品编号:</text>
|
|
|
|
<uni-data-select v-model="equipmentId" style="width: 300rpx;margin-left: 30rpx;"
|
|
|
|
:localdata="range"></uni-data-select>
|
2023-11-27 18:23:17 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
|
|
|
|
<view class="Modal-btn">
|
|
|
|
<view class="Modal-btna" @click="closeModal">
|
|
|
|
取消
|
|
|
|
</view>
|
|
|
|
<view class="Modal-btnb" @click="bindFn">
|
|
|
|
确定
|
|
|
|
</view>
|
2023-11-23 10:58:26 +08:00
|
|
|
</view>
|
2023-11-30 17:51:39 +08:00
|
|
|
</u-popup>
|
2023-11-27 18:23:17 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
</view>
|
|
|
|
<u-picker keyName="name" :show="showPicker1" @cancel="showPicker1=false" @confirm="confirm1"
|
|
|
|
:columns="columns2"></u-picker>
|
2023-11-27 18:23:17 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
<u-picker keyName="label" :show="showPicker" @cancel="showPicker=false" @confirm="confirm2"
|
|
|
|
:columns="columns1"></u-picker>
|
|
|
|
</view>
|
2023-11-21 18:54:33 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import {
|
2023-11-23 10:58:26 +08:00
|
|
|
reactive,
|
|
|
|
ref
|
|
|
|
} from 'vue';
|
|
|
|
import {
|
2023-11-28 18:08:39 +08:00
|
|
|
onLoad,
|
|
|
|
onShow
|
2023-11-23 10:58:26 +08:00
|
|
|
} from "@dcloudio/uni-app"
|
2023-11-30 17:51:39 +08:00
|
|
|
import Myindex from '@/components/return/index.vue';
|
2023-11-25 16:18:54 +08:00
|
|
|
import {
|
2023-11-27 18:23:17 +08:00
|
|
|
bindproduct,
|
2023-11-25 16:18:54 +08:00
|
|
|
lindexist,
|
2023-11-27 18:23:17 +08:00
|
|
|
landlist,
|
2023-11-29 18:11:21 +08:00
|
|
|
plantlist,
|
2023-11-27 18:23:17 +08:00
|
|
|
landproduct
|
2023-11-28 18:08:39 +08:00
|
|
|
} from '@/api/api.js'
|
2023-11-30 17:51:39 +08:00
|
|
|
import store from "@/store/index.js"
|
2023-11-29 18:11:21 +08:00
|
|
|
const showPicker = ref(false)
|
|
|
|
const showPicker1 = ref(false)
|
2023-11-27 18:23:17 +08:00
|
|
|
const showModal = ref(false)
|
2023-11-29 18:11:21 +08:00
|
|
|
const columns1 = reactive([
|
|
|
|
[{
|
|
|
|
label: '施肥',
|
|
|
|
route: "/pages/husbandryForm/fertilize"
|
|
|
|
}, {
|
|
|
|
label: '除草',
|
|
|
|
route: "/pages/husbandryForm/weeding"
|
|
|
|
}, {
|
|
|
|
label: '灌溉',
|
|
|
|
route: "/pages/husbandryForm/irrigate"
|
|
|
|
}, {
|
|
|
|
label: '除虫',
|
|
|
|
route: "/pages/husbandryForm/Pest"
|
|
|
|
}, {
|
|
|
|
label: '收获',
|
|
|
|
route: "/pages/husbandryForm/harvest"
|
|
|
|
}]
|
|
|
|
]);
|
2023-11-23 10:58:26 +08:00
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
const columns2 = reactive([])
|
2023-11-28 18:08:39 +08:00
|
|
|
const range = reactive([])
|
2023-11-23 10:58:26 +08:00
|
|
|
// 土壤监测数据
|
|
|
|
const url = ref('https://ceshi-worker-task.lihaink.cn//uploads//images//20231121//202311211336582b7920656.jpg')
|
|
|
|
const soilList = reactive([{
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/CTWD.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤温度",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "℃",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/SD.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤湿度",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "%RH",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-12-07 11:53:21 +08:00
|
|
|
icon: "/static/img/DD.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤导电率",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "μS/cm",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-12-07 11:53:21 +08:00
|
|
|
icon: "/static/img/PH.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤PH值",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "PH",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/AHL.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤含氮量",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "mg/kg",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-12-07 11:53:21 +08:00
|
|
|
icon: "/static/img/Hl.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤含磷量",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "mg/kg",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-12-07 11:53:21 +08:00
|
|
|
icon: "/static/img/HJ.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "土壤含钾量",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "mg/kg",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
},
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
])
|
2023-11-30 17:51:39 +08:00
|
|
|
onLoad(() => {
|
|
|
|
// console.log(store.state.userInfo)
|
|
|
|
if (!store.state.userInfo) {
|
|
|
|
uni.redirectTo({
|
|
|
|
url: '/pages/Login/login'
|
|
|
|
})
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
}
|
|
|
|
})
|
2023-11-25 16:18:54 +08:00
|
|
|
const dataobj = reactive({})
|
2023-11-27 18:23:17 +08:00
|
|
|
const tdId = ref('')
|
2023-11-29 18:11:21 +08:00
|
|
|
const palntId = ref('')
|
2023-11-23 10:58:26 +08:00
|
|
|
// 绑定设备
|
|
|
|
const equipmentId = ref("")
|
|
|
|
const bindFn = () => {
|
2023-11-27 18:23:17 +08:00
|
|
|
biproduct()
|
2023-11-23 10:58:26 +08:00
|
|
|
showModal.value = false
|
|
|
|
}
|
|
|
|
// 扫码
|
|
|
|
const scanFn = () => {
|
|
|
|
uni.scanCode({
|
2023-11-21 18:54:33 +08:00
|
|
|
success: function(res) {
|
2023-11-28 18:08:39 +08:00
|
|
|
// console.log('条码类型:' + res.scanType);
|
|
|
|
console.log('条码内容:' + res.result.split('='));
|
|
|
|
uni.navigateTo({
|
2023-11-29 18:11:21 +08:00
|
|
|
url: '/pages/landDetail/results?id=' + res.result.split('=')[1]
|
2023-11-28 18:08:39 +08:00
|
|
|
})
|
2023-11-21 18:54:33 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
const show = ref(false)
|
|
|
|
const showLoading = ref(false)
|
2023-11-25 16:18:54 +08:00
|
|
|
const columns = reactive([]);
|
2023-11-23 10:58:26 +08:00
|
|
|
// 环境监测数据
|
|
|
|
const environmentList = reactive([{
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/FS.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "风速",
|
|
|
|
num: 20,
|
|
|
|
unit: "%",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/FX.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "风向",
|
|
|
|
num: 20,
|
|
|
|
unit: "%",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/CTWD.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "温度",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "℃",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/SD.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "湿度",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "%RH",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: '/static/img/CO2.png',
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "二氧化碳",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "ppm",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-12-07 11:53:21 +08:00
|
|
|
icon: "/static/img/QY.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "气压",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "KPa",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/JY.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "雨量",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "mm",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}, {
|
2023-11-28 18:08:39 +08:00
|
|
|
icon: "/static/img/GZ.png",
|
2023-11-23 10:58:26 +08:00
|
|
|
name: "光照量",
|
|
|
|
num: 20,
|
2023-11-27 18:23:17 +08:00
|
|
|
unit: "Lux",
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
},
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
])
|
2023-11-28 18:08:39 +08:00
|
|
|
onShow(() => {
|
2023-11-25 16:18:54 +08:00
|
|
|
getlist()
|
|
|
|
getlist1()
|
2023-11-27 18:23:17 +08:00
|
|
|
getlist2()
|
2023-12-01 10:54:01 +08:00
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
})
|
2023-11-27 18:23:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
//列表获取
|
2023-11-25 16:18:54 +08:00
|
|
|
const getlist = () => {
|
|
|
|
lindexist({
|
2023-11-27 18:23:17 +08:00
|
|
|
land_id: tdId.value
|
2023-11-25 16:18:54 +08:00
|
|
|
}).then((res) => {
|
2023-11-27 18:23:17 +08:00
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
if (res.code == 1) {
|
2023-11-30 17:51:39 +08:00
|
|
|
if (Object.keys(res.data).length > 0) {
|
|
|
|
getlist3(res.data.id)
|
|
|
|
|
|
|
|
Object.assign(dataobj, res.data);
|
|
|
|
|
|
|
|
if (res.data && res.data.monitor && res.data.monitor.soil_monitor_data) {
|
|
|
|
soilList[0].num = res.data.monitor.soil_monitor_data.temperature
|
|
|
|
soilList[1].num = res.data.monitor.soil_monitor_data.moisture
|
|
|
|
soilList[2].num = res.data.monitor.soil_monitor_data.conductivity
|
|
|
|
soilList[3].num = res.data.monitor.soil_monitor_data.ph
|
|
|
|
soilList[4].num = res.data.monitor.soil_monitor_data.n_content
|
|
|
|
soilList[5].num = res.data.monitor.soil_monitor_data.p_content
|
|
|
|
soilList[6].num = res.data.monitor.soil_monitor_data.k_content
|
|
|
|
}
|
|
|
|
if (res.data && res.data.monitor && res.data.monitor.air_monitor_data) {
|
|
|
|
environmentList[0].num = res.data.monitor.air_monitor_data.wind_speed
|
|
|
|
environmentList[1].num = res.data.monitor.air_monitor_data.wind_direction
|
|
|
|
environmentList[2].num = res.data.monitor.air_monitor_data.temperature
|
|
|
|
environmentList[3].num = res.data.monitor.air_monitor_data.moisture
|
|
|
|
environmentList[4].num = res.data.monitor.air_monitor_data.co2_content
|
|
|
|
environmentList[5].num = res.data.monitor.air_monitor_data.pressure
|
|
|
|
environmentList[6].num = res.data.monitor.air_monitor_data.rainfall
|
|
|
|
environmentList[7].num = res.data.monitor.air_monitor_data.light_intensity
|
|
|
|
|
|
|
|
}
|
2023-11-27 18:23:17 +08:00
|
|
|
}
|
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const getlist1 = () => {
|
|
|
|
landlist({
|
|
|
|
page_no: 1,
|
|
|
|
page_size: 99995,
|
|
|
|
keyword: ''
|
|
|
|
}).then((res) => {
|
|
|
|
if (res.code == 1) {
|
2023-11-27 18:23:17 +08:00
|
|
|
if (res.data.length > 0) {
|
|
|
|
columns.splice(0, columns.length, ...res.data.map((step, index) => {
|
|
|
|
return {
|
|
|
|
name: step.title,
|
|
|
|
id: step.id,
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
}
|
2023-11-25 16:18:54 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
const getlist2 = () => {
|
|
|
|
landproduct().then((res) => {
|
|
|
|
if (res.code == 1) {
|
2023-11-28 18:08:39 +08:00
|
|
|
range.splice(0, range.length, ...res.data.map((step, index) => {
|
|
|
|
return {
|
|
|
|
text: step.name,
|
|
|
|
value: step.product_id,
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
|
|
|
|
// console.log(res)
|
2023-11-27 18:23:17 +08:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
}
|
2023-11-29 18:11:21 +08:00
|
|
|
const getlist3 = (id) => {
|
|
|
|
plantlist({
|
|
|
|
land_id: id
|
|
|
|
}).then((res) => {
|
2023-11-30 17:51:39 +08:00
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
if (res.code == 1) {
|
2023-11-30 17:51:39 +08:00
|
|
|
columns2.splice(0)
|
2023-11-29 18:11:21 +08:00
|
|
|
let arr1 = []
|
|
|
|
arr1.splice(0, arr1.length, ...res.data.map((step, index) => {
|
|
|
|
return {
|
|
|
|
name: step.kind + '-' + step.id,
|
|
|
|
id: step.id,
|
2023-12-07 09:34:25 +08:00
|
|
|
status: step.status
|
2023-11-29 18:11:21 +08:00
|
|
|
};
|
|
|
|
}));
|
|
|
|
columns2.push(arr1)
|
2023-12-07 09:34:25 +08:00
|
|
|
|
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-11-28 18:08:39 +08:00
|
|
|
//关闭弹窗
|
|
|
|
const closeModal = () => {
|
|
|
|
showModal.value = false
|
|
|
|
equipmentId.value = ''
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
|
2023-11-28 18:08:39 +08:00
|
|
|
//绑定产品
|
2023-11-27 18:23:17 +08:00
|
|
|
const biproduct = () => {
|
2023-11-30 17:51:39 +08:00
|
|
|
if (equipmentId.value) {
|
|
|
|
bindproduct({
|
|
|
|
land_id: dataobj.id,
|
|
|
|
product_id: equipmentId.value
|
|
|
|
}).then((res) => {
|
|
|
|
if (res.code == 1) {
|
|
|
|
uni.$u.toast(res.msg);
|
|
|
|
// this.dataobj=res.data
|
|
|
|
equipmentId.value = ''
|
|
|
|
}
|
|
|
|
console.log(res)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.$u.toast('请选择产品编号');
|
|
|
|
}
|
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
}
|
2023-11-29 18:11:21 +08:00
|
|
|
const confirm2 = (e) => {
|
|
|
|
showPicker.value = false
|
2023-11-30 17:51:39 +08:00
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url: e.value[0].route + '?id=' + palntId.value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
const confirm1 = (e) => {
|
2023-12-09 17:07:42 +08:00
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
palntId.value = e.value[0].id
|
|
|
|
showPicker1.value = false
|
2023-12-07 09:34:25 +08:00
|
|
|
if (e.value[0].status == 2) {
|
|
|
|
uni.$u.toast('该土地已经收获,不能进行操作');
|
|
|
|
} else {
|
|
|
|
showPicker.value = true
|
|
|
|
}
|
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
}
|
2023-11-23 10:58:26 +08:00
|
|
|
const confirm = (e) => {
|
2023-11-27 18:23:17 +08:00
|
|
|
// console.log(e)
|
|
|
|
tdId.value = e.id
|
|
|
|
|
|
|
|
getlist()
|
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
show.value = false
|
|
|
|
showLoading.value = true
|
|
|
|
setTimeout(() => {
|
|
|
|
showLoading.value = false
|
|
|
|
}, 1000)
|
|
|
|
}
|
|
|
|
const getNowTimeFn = () => {
|
|
|
|
const now = new Date();
|
|
|
|
const hour = now.getHours();
|
|
|
|
const minute = now.getMinutes();
|
|
|
|
const formattedHour = hour < 10 ? '0' + hour : hour;
|
|
|
|
const formattedMinute = minute < 10 ? '0' + minute : minute;
|
|
|
|
const currentTime = formattedHour + ':' + formattedMinute;
|
|
|
|
return currentTime
|
|
|
|
}
|
2023-11-29 18:11:21 +08:00
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
const navgo = () => {
|
2023-11-27 18:23:17 +08:00
|
|
|
|
2023-11-25 16:18:54 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/landDetail/index?id=' + dataobj.id
|
|
|
|
})
|
|
|
|
}
|
2023-12-09 17:07:42 +08:00
|
|
|
const palnt = (id) => {
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pages/husbandryForm/sow?id=' + id
|
|
|
|
})
|
|
|
|
}
|
2023-11-23 10:58:26 +08:00
|
|
|
const navto = (url) => {
|
2023-11-21 18:54:33 +08:00
|
|
|
uni.navigateTo({
|
|
|
|
url
|
|
|
|
})
|
|
|
|
}
|
2023-11-23 10:58:26 +08:00
|
|
|
getNowTimeFn()
|
2023-11-21 18:54:33 +08:00
|
|
|
</script>
|
2023-11-29 18:11:21 +08:00
|
|
|
<style lang="scss">
|
2023-11-27 18:23:17 +08:00
|
|
|
page {
|
|
|
|
background-color: $theme-bg-color;
|
|
|
|
}
|
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.top {
|
|
|
|
background-color: #34D190;
|
|
|
|
position: fixed;
|
|
|
|
z-index: 999999;
|
|
|
|
width: 750rpx;
|
|
|
|
|
2023-11-21 18:54:33 +08:00
|
|
|
}
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
.coneng-detail {
|
|
|
|
width: 478rpx;
|
|
|
|
height: 341rpx;
|
|
|
|
background: #FFFFFF;
|
|
|
|
border-radius: 6px 6px 6px 6px;
|
|
|
|
opacity: 1;
|
|
|
|
font-size: 25rpx;
|
|
|
|
font-family: PingFang SC, PingFang SC;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #737373;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
text-align: center;
|
|
|
|
margin: 70rpx auto;
|
|
|
|
|
|
|
|
image {
|
|
|
|
width: 280rpx;
|
|
|
|
height: 142rpx;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-29 18:11:21 +08:00
|
|
|
.add-thing {
|
|
|
|
width: 266.36rpx;
|
|
|
|
height: 66.59rpx;
|
|
|
|
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
|
|
|
|
border: 1px solid $theme-main-color;
|
|
|
|
margin: 20rpx auto;
|
|
|
|
line-height: 66rpx;
|
|
|
|
text-align: center;
|
|
|
|
color: $theme-main-color;
|
|
|
|
}
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
.Modal {
|
|
|
|
padding: 60rpx 40rpx;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
text {
|
|
|
|
margin-top: 5rpx;
|
|
|
|
}
|
|
|
|
|
|
|
|
.Modal-btn {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
|
|
|
padding-bottom: 20rpx;
|
|
|
|
|
|
|
|
.Modal-btna {
|
|
|
|
width: 120rpx;
|
|
|
|
height: 60rpx;
|
|
|
|
line-height: 60rpx;
|
|
|
|
font-size: 25rpx;
|
|
|
|
background-color: #e5e0d8;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
.Modal-btnb {
|
|
|
|
width: 120rpx;
|
|
|
|
height: 60rpx;
|
|
|
|
line-height: 60rpx;
|
|
|
|
font-size: 25rpx;
|
|
|
|
background-color: #34D190;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.uni-select__selector {
|
|
|
|
z-index: 9999 !important;
|
|
|
|
}
|
|
|
|
|
2023-11-30 17:51:39 +08:00
|
|
|
.nav-con {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
padding-top: 20rpx;
|
|
|
|
padding-bottom: 10rpx;
|
|
|
|
}
|
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.nav {
|
|
|
|
display: flex;
|
2023-11-30 17:51:39 +08:00
|
|
|
padding-right: 20rpx;
|
|
|
|
padding-left: 10rpx;
|
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.card {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2023-11-21 18:54:33 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.changeLand {
|
|
|
|
width: 200rpx;
|
|
|
|
height: 70rpx;
|
|
|
|
line-height: 70rpx;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
background-color: $theme-main-color;
|
|
|
|
color: white;
|
2023-11-21 18:54:33 +08:00
|
|
|
}
|
2023-11-23 10:58:26 +08:00
|
|
|
}
|
2023-11-21 18:54:33 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.content {
|
2023-11-27 18:23:17 +08:00
|
|
|
// min-height: 92vh;
|
2023-11-23 10:58:26 +08:00
|
|
|
padding: 0 30rpx;
|
|
|
|
padding-top: 20rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2023-11-21 18:54:33 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.soil-monitor {
|
|
|
|
margin-top: 40rpx;
|
2023-11-21 18:54:33 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.head {
|
2023-11-21 18:54:33 +08:00
|
|
|
|
|
|
|
.tit {
|
|
|
|
font-size: 33.29rpx;
|
2023-11-23 10:58:26 +08:00
|
|
|
color: black;
|
|
|
|
}
|
|
|
|
|
|
|
|
.flushed-time {
|
|
|
|
display: flex;
|
|
|
|
font-size: 26.29rpx;
|
|
|
|
color: #737373;
|
|
|
|
margin-top: 10rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.monitor-content {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.monitor-card {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
background-color: white;
|
|
|
|
padding: 30rpx 20rpx;
|
|
|
|
border-radius: 30rpx;
|
|
|
|
width: 332.94rpx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
height: 212.03rpx;
|
|
|
|
|
|
|
|
.name {
|
|
|
|
font-size: 29.79rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.num {
|
|
|
|
margin-top: 30rpx;
|
|
|
|
color: $theme-main-color;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.video {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
width: 100%;
|
|
|
|
height: 300rpx;
|
|
|
|
}
|
2023-11-21 18:54:33 +08:00
|
|
|
|
2023-11-23 10:58:26 +08:00
|
|
|
.empty {
|
|
|
|
height: 100vh;
|
|
|
|
background-color: $theme-bg-color;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.addLand {
|
|
|
|
width: auto;
|
|
|
|
height: 100rpx;
|
|
|
|
color: grey;
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
|
|
|
.addBtn {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
width: 250rpx;
|
|
|
|
height: 70rpx;
|
|
|
|
border: 1px solid $theme-main-color;
|
|
|
|
line-height: 70rpx;
|
|
|
|
border-radius: 50rpx;
|
|
|
|
text-align: center;
|
2023-11-21 18:54:33 +08:00
|
|
|
}
|
2023-11-23 10:58:26 +08:00
|
|
|
|
2023-11-21 18:54:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|