mkm
/
yanzhiAPP
Template
2
0
Fork 0

页面完善

This commit is contained in:
zmj 2023-11-22 14:08:24 +08:00
parent 4b4ea2375e
commit 88ce2001f0
70 changed files with 10788 additions and 31966 deletions

View File

@ -1,216 +0,0 @@
<template>
<view class="card">
<!-- {{}} -->
<view class="card-li tit">
<view class="">
土地
</view>
<view style="color: #00A15E;font-weight: bold;">
未种植
</view>
</view>
<view class="card-li tit">
<view class="">
面积: 10
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
种植品牌
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.crop_name"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
具体品种
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.crop_variety"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
种子品牌
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.crop_brand"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
种子收购时间
</view>
<view class="">
<up-input placeholder="点击输入时间" border="surround" v-model="formData.crop_buy_time"
@focus="showDatePicker=true"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
上传播种图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.pic">
<u--image :src="formData.pic" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="up-img confim-btn">
+上传播种图片
</view> -->
<view class="today-btn confim-btn" @tap="sowFn">
今日播种
</view>
<!-- 组件 -->
<u-notify ref="uNotify" message="Hi uview-plus"></u-notify>
<view class="">
<up-calendar :closeOnClickOverlay='true' :show="showDatePicker" @confirm="confirm"
@close="showDatePicker=false"></up-calendar>
</view>
</template>
<script setup>
import {
AddlandInfoAPI
} from "@/api/plant.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
import {
userInfoStore
} from '@/store/userInfo'
const userInfo = userInfoStore()
const uNotify = ref()
const show = ref(false)
const showDatePicker = ref(false)
const formData = reactive({
user_id: userInfo.userInfo.id,
land_id: "",
crop_name: "",
crop_variety: "",
crop_brand: "",
crop_buy_time: "",
pic: ""
})
const confirm = (e) => {
console.log(e[0])
formData.crop_buy_time = e[0]
showDatePicker.value = false
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const updateImgFn = async () => {
let res = await uplodeImg()
formData.pic = res.data.image
// console.log(res.data)
}
const sowFn = async () => {
let res = await AddlandInfoAPI({
...formData
})
setTimeout(() => {
uni.navigateTo({
url: "/pages/index/index"
})
}, 2000)
// show.value = true
// uNotify.value.primary('Primary')
// navgo('/pages/detail/plant')
}
onLoad((options) => {
formData.land_id = options.land_id
})
</script>
<style lang='scss' scoped>
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
margin-bottom: 100rpx;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
</style>

View File

@ -1,196 +0,0 @@
<template>
<view class="" v-if="props.showImg">
<view class="" v-if="animal_detail?.pic_detail?.pic">
<imgCard :imgUrl='animal_detail.pic_detail.pic'></imgCard>
</view>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/sj.png')" style="margin: 0 5rpx;" width="28.04rpx"
height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
<view style="display: flex;" @click="navgo(`/pages/feedIng/histroyFeed?id=${props.id}`)">
查看历史条件 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
<view class="card">
<view class="tit">
<view class="">
溯源码: {{animal_detail.animal_code}}
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: {{animal_detail.animal_kind}}
</view>
<view class="">
年龄: {{animal_detail.animal_age}}
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{animal_detail.animal_breed}}
</view>
<view class="">
体重:{{animal_detail.animal_weight}}
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: #00A15E;" v-if='animal_detail.animal_status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='animal_detail.animal_status==2'>
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if='animal_detail.animal_status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='animal_detail.animal_status==3'>
生病隔离中
</view>
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
animalInfoAPI,
addAnimalPicAPI
} from "@/api/animal.js"
import {
ref,
reactive,
watch
} from "vue"
import {
onShow
} from "@dcloudio/uni-app"
onShow(() => {
if (props?.id) {
animalInfoAPI({
animal_id: Number(props.id)
}).then(res => {
objFn(res.data, animal_detail)
})
}
})
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
//
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
const animal_detail = reactive({})
const props = defineProps({
id: String,
showImg: Boolean
})
watch(props, (newValue, oldVlaue) => {
if (props?.id) {
animalInfoAPI({
animal_id: Number(props.id)
}).then(res => {
objFn(res.data, animal_detail)
})
}
}, {
//
immediate: true
})
const updateImgFn = () => {
uplodeImg().then(res => {
animal_detail.pic_detail.pic = res.data.image
// img.value = res.data.image
addAnimalPicAPI({
animal_id: Number(props.id),
pic: res.data.image
})
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,87 +0,0 @@
<template>
<view class="card" v-if="userInfo.animal_detail">
<!-- {{userInfo.animal_detail.total_count}} -->
<view class="tit">
<view class="">
农户名称: {{userInfo.name}}
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 养殖户
</view>
<view class="">
养殖头数: {{userInfo.animal_detail.total_count}}
</view>
</view>
<view class="card-li">
<view class="">
土地面积:{{userInfo.total_land_area}}
</view>
<view class="">
: {{userInfo.animal_detail.male_count}}
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: {{userInfo.animal_detail.kind[0]}},{{userInfo.animal_detail.kind[1]}}
</view>
<view class="">
: {{userInfo.animal_detail.maternal_count}}
</view>
</view>
<view class="card-li">
<view class="">
具体种类: {{userInfo.animal_detail.breed[0]}}
</view>
</view>
<view class="card-li">
<view class="">
地址: {{userInfo.area_name}}{{userInfo.street_name}}{{userInfo.village_name}}{{userInfo.brigade_name}}
</view>
</view>
</view>
</template>
<script setup>
import {
reactive,
watch
} from "vue";
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const userInfo = reactive({})
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
// userInfoAPI({
// user_id: 307
// }).then(res => {
// objFn(res.data, userInfo)
// })
objFn(userInfoStores.userInfo, userInfo)
</script>
<style lang="scss" scoped>
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
</style>

View File

@ -1,121 +0,0 @@
<template>
<view class="card">
<view class="tit">
<view class="">
农户名称: {{userInfo.userInfo.name}}
</view>
<view class="">
<!-- {{headData}} -->
溯源码: {{headData.source_code}}
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 养殖户
</view>
<view class="">
养殖数量: {{headData.total_num}}
</view>
</view>
<view class="card-li" v-if="headData.kind">
<view class="">
土地面积: 20
</view>
<view class="">
养殖种类: {{headData.kind[0]}},{{headData.kind[1]}},{{headData.kind[2]}}
</view>
<!-- <view class="">
草鱼鱼苗: 的划分等级
</view> -->
</view>
<!-- <view class="card-li" v-if="headData.kind">
<view class="">
鲫鱼鱼苗: 的划分等级
</view>
</view> -->
<view class="card-li" v-if="headData.breed">
<view class="">
<!-- {{}} -->
具体种类: {{headData.breed[0]}},{{headData.breed[1]}},{{headData.breed[2]}}
</view>
</view>
<view class="add-btn" v-if="props.showBtn" @click="navgo(`/pages/aquatic/addPond?pond_id=${props.id}`)">
添加水产养殖
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
watch
} from "vue"
import {
pondInfoAPI,
} from "@/api/aquatic.js"
import {
userInfoStore
} from '@/store/userInfo'
const userInfo = userInfoStore()
const props = defineProps({
id: String,
showBtn: Boolean
})
const headData = reactive({})
watch(props, (newValue, oldVlaue) => {
// console.log(newValue, oldVlaue)
if (props?.id) {
pondInfoAPI({
user_id: 307,
pond_id: props.id
}).then(res => {
// console.log(4557545)
for (let key in res.data) {
headData[key] = (res.data)[key]
}
})
}
}, {
immediate: true
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.add-btn {
margin: 0 auto;
width: 220.79rpx;
height: 57.83rpx;
color: #00A15E;
border: 1px solid #00A15E;
border-radius: 50rpx;
display: flex;
justify-content: center;
line-height: 57rpx;
font-size: 26rpx;
}
</style>

View File

@ -1,65 +0,0 @@
<template>
<view class="">
<view class="head-img">
<view class="">
<u--image :src="props.imgUrl" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
</view>
<view class="poisition">
<!-- {{props.text}} -->
{{address}}
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from 'vue'
import uplodeFn from "@/utils/uplodeImg.js"
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const address = ref("")
// userInfoAPI({
// user_id: 307
// }).then(res => {
// })
let userInfo = userInfoStores.userInfo
address.value = userInfo.area_name + userInfo.street_name + userInfo.village_name + userInfo.brigade_name
const props = defineProps({
imgUrl: String,
text: String
})
</script>
<style lang="scss" scoped>
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 28rpx auto;
position: relative;
overflow: hidden;
.poisition {
opacity: 0.7;
position: absolute;
width: 292.64rpx;
height: 45rpx;
background-color: #FFFFFF;
left: 21rpx;
bottom: 21rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 22.78rpx;
}
}
</style>

View File

@ -1,323 +0,0 @@
<template>
<view class="content">
<farmersCard></farmersCard>
<view class="circumstance">
<view class="card-tit">
<view class="">
养殖情况
</view>
</view>
<view class="card" v-for="(item,index) in animalList" :key="index"
@click="navgo(`/pages/poultry/feedDetail?id=${item.id}`)">
<view class="tit">
<view class="">
编号: {{item.code}}
</view>
<view class="" style="color: #00A15E;" v-if='item.status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='item.status==2'>
产蛋期
</view>
<view class="" style="color: #3274F9;" v-if='item.status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='item.status==3'>
生病隔离中
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{item.gender==1?"公":"母"}}
</view>
<view class="">
年龄: {{item.age}}
</view>
<view class="">
体重: {{item.weight}}kg
</view>
</view>
</view>
<view class="check" @click="navgo('/pages/poultry/feedList')">
查看全部养殖动物<u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="circumstance" v-for="(item,index) in actionList" :key="index">
<!-- {{item.action_record}} -->
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo(`/pages/growRecord/chick?type=2&title=${index}`)">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record"
:route='`/pages/poultry/allRecording?index=${index}`'>
</myTable>
</view>
<!-- <view class="circumstance">
<view class="card-tit">
<view class="">
消毒情况
</view>
<view class="updata-btn" @click="navgo('/pages/growRecord/index')">
更新消毒情况
</view>
</view>
<myTable tit='查看历史消毒记录' route='/pages/poultry/allRecording'></myTable>
</view> -->
<view class="data">
<view class="tit">
<view class="" style="display: flex;justify-content: space-between;font-size: 29.79rpx;">
<view class="">
环境监测数据
</view>
</view>
<view class="tit-b">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间: 2022-3-3</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#0095FF':''}">
<text style=" font-size: 70.09rpx;">
{{baseData[item.cont]}}
</text>{{item.dw}}
</view>
<view class="" style="display: flex;align-items: center;" v-if="item.flag">
<u--image :src="urlFn('D')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #0095FF;">5</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import myTable from "@/components/myTable/index.vue"
import farmersCard from "@/components/poultry/farmersCard.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
animalListAPI,
animalEnvDataAPI,
actionsAPI
} from "@/api/chick.js"
const props = defineProps({
userInfo: Object
})
const userInfo = reactive(props.userInfo)
const data = reactive([{
tit: "环境温度",
icon: 'WD',
dw: "℃",
cont: 'hj_temp',
flag: false,
}, {
tit: "环境湿度",
icon: 'JYL',
dw: "%RH",
cont: 'hj_humi',
}, {
tit: "氧气浓度",
icon: 'FX',
cont: 'o_content',
dw: "%",
}, {
tit: "二氧化碳含量",
icon: 'FS',
dw: "mg/L",
cont: 'c_content',
}, {
tit: "光照强度",
icon: 'JYL',
dw: "lux",
cont: 'light',
}, {
tit: "大气压强",
icon: 'GZ',
dw: "hpa",
cont: 'dqy',
}, {
tit: "有害气体",
icon: 'EYHT',
cont: 'yhqt',
},
])
const baseData = reactive({
})
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const animalList = reactive([])
animalListAPI({
user_id: 307,
page_no: 1,
page_size: 3,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
// console.log(animalList)
})
animalEnvDataAPI({
user_id: 307
}).then(res => {
for (let key in res.data) {
baseData[key] = (res.data)[key]
}
})
const actionList = reactive({})
actionsAPI({
type: 2
}).then(res => {
for (let key in res.data) {
actionList[key] = (res.data)[key]
}
})
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 30rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

View File

@ -1,343 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: {{userInfo.name}}
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 养殖户
</view>
<view class="">
养殖头数: {{userInfo.animal_detail.total_count}}
</view>
</view>
<view class="card-li">
<view class="">
土地面积:{{userInfo.total_land_area}}
</view>
<view class="">
: {{userInfo.animal_detail.male_count}}
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: {{userInfo.animal_detail.kind[0]}},{{userInfo.animal_detail.kind[1]}}
</view>
<view class="">
: {{userInfo.animal_detail.maternal_count}}
</view>
</view>
<view class="card-li">
<view class="">
具体种类: {{userInfo.animal_detail.breed[0]}}
</view>
</view>
</view> -->
<farmersCard></farmersCard>
<view class="circumstance">
<view class="card-tit">
<view class="">
养殖情况
</view>
</view>
<view class="card" v-for="(item,index) in animalList" :key="index"
@click="navgo(`/pages/feedIng/feedDetail?id=${item.id}`)">
<view class="tit">
<view class="">
编号: {{item.animal_code}}
</view>
<view class="" style="color: #00A15E;" v-if='item.animal_status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='item.animal_status==2'>
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if='item.animal_status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='item.animal_status==3'>
生病隔离中
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{item.animal_gender==1?'公':"母"}}
</view>
<view class="">
年龄: {{item.animal_age}}
</view>
<view class="">
体重: {{item.animal_weight}}kg
</view>
</view>
</view>
<view class="check" @click="navgo('/pages/feedIng/feedList')">
查看全部养殖动物<u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="circumstance" v-for="(item,index) in actionList" :key="index">
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo(`/pages/growRecord/feedIng?type=3&title=${index}`)">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record"
:route='`/pages/feedIng/allRecordTable?index=${index}`'>
</myTable>
</view>
<view class="data">
<view class="tit">
<view class="" style="display: flex;justify-content: space-between;font-size: 29.79rpx;">
<view class="">
环境监测数据
</view>
</view>
<view class="tit-b">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间: 2022-3-3</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#0095FF':''}">
<text style=" font-size: 70.09rpx;">
{{baseData[item.cont]}}
</text>{{item.dw}}
</view>
<view class="" style="display: flex;align-items: center;" v-if="item.flag">
<u--image :src="urlFn('D')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #0095FF;">5</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import myTable from "@/components/myTable/index.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
animalListAPI,
animalEnvDataAPI,
actionsAPI
} from "@/api/animal.js"
import farmersCard from "@/components/animal/farmersCard.vue"
const props = defineProps({
userInfo: Object
})
const userInfo = reactive(props.userInfo)
const data = reactive([{
tit: "环境温度",
icon: 'WD',
dw: "℃",
cont: 'hj_temp',
flag: false,
}, {
tit: "环境湿度",
icon: 'JYL',
dw: "%RH",
cont: 'hj_humi',
}, {
tit: "氧气浓度",
icon: 'FX',
cont: 'o_content',
dw: "%",
}, {
tit: "二氧化碳含量",
icon: 'FS',
dw: "mg/L",
cont: 'c_content',
}, {
tit: "光照强度",
icon: 'JYL',
dw: "lux",
cont: 'light',
}, {
tit: "大气压强",
icon: 'GZ',
dw: "hpa",
cont: 'dqy',
}, {
tit: "有害气体",
icon: 'EYHT',
cont: 'yhqt',
},
])
const baseData = reactive({
})
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const animalList = reactive([])
animalListAPI({
user_id: 307,
page_no: 1,
page_size: 3,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
})
animalEnvDataAPI({
user_id: 307
}).then(res => {
for (let key in res.data) {
baseData[key] = (res.data)[key]
}
})
const actionList = reactive({})
actionsAPI({
type: 3
}).then(res => {
for (let key in res.data) {
actionList[key] = (res.data)[key]
}
})
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 30rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
</style>

View File

@ -1,165 +0,0 @@
<template>
<view class="">
<view class="content">
<view class="border-bgc">
</view>
<view class="" style="height: 30rpx;">
</view>
<view class="card">
<view class="card-li">
农户名称: {{userInfo.name}}
</view>
<view class="card-li">
种养殖类型: 养殖户
</view>
<view class="card-li">
<!-- 养殖种类: {{userInfo.}} -->
</view>
<view class="card-li">
土地面积: {{userInfo.total_land_area}}
</view>
<view class="card-li">
地址: {{userInfo.area_name}}{{userInfo.street_name}}{{userInfo.village_name}}{{userInfo.brigade_name}}
</view>
</view>
<view class="card" v-for="(item,index) in userInfo.pond_detail" :key="index"
@click="navgoFn(item.is_culture,item.pond_id)">
<view class="tit card-li">
<view class="">
{{item.pond_notes}}
</view>
<view class="" style="color: #00A15E;" v-if="item.is_culture">
已养殖
</view>
<view class="" style="color: #00A15E;" v-else>
未养殖
</view>
</view>
<view class="card-li">
<view class="">
面积: {{item.pond_area}}
</view>
</view>
<view class="card-li" v-if="item.is_culture">
<view class="">
养殖品种: {{item.pond_area}}
</view>
</view>
<view class="card-li" v-if="item.is_culture">
<view class="">
养殖数量: {{item.total_num}}
</view>
</view>
</view>
<view style="height: 170rpx;">
</view>
</view>
<view class="bottom">
<view class="add-btn" @click="navgo('/pages/growRecord/index')">
批量处理
</view>
<!-- <view class="add-btn add" @click="navgo('/pages/InformationAdd/index')">
增加种植
</view> -->
</view>
</view>
</template>
<script setup>
import {
reactive
} from "vue"
const props = defineProps({
userInfo: Object
})
const userInfo = reactive(props.userInfo)
const navgo = (url) => {
uni.navigateTo({
url
})
}
const navgoFn = (is_cropped, pond_id) => {
if (!is_cropped) {
navgo(`/pages/aquatic/addPond?pond_id=${pond_id}`)
} else if (is_cropped) {
navgo(`/pages/aquatic/detail?pond_id=${pond_id}`)
}
}
</script>
<style lang="scss">
.content {
min-height: 90vh;
position: relative;
// padding: 0 20rpx;
// padding-top: 50rpx;
background-color: #EAF2EF;
padding: 0;
.border-bgc {
height: 200rpx;
background-color: #34D190;
border-radius: 0 0 40rpx 40rpx;
position: absolute;
width: 750rpx;
}
.card {
position: relative;
width: 693.93rpx;
margin: auto;
background-color: #fff;
box-sizing: border-box;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin-bottom: 40rpx;
.card-li {
// margin-bottom: 17rpx;
}
.tit {
display: flex;
font-size: 33.29rpx;
font-weight: bold;
// background-color: red;
justify-content: space-between;
}
}
}
.bottom {
width: 750rpx;
height: 150rpx;
background-color: #EAF2EF;
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
.add-btn {
width: 238.32rpx;
height: 84.11rpx;
border: #34D190 1px solid;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
color: #00A15E;
font-size: 33.29rpx;
font-weight: bold;
justify-content: center;
margin-right: 20rpx;
}
.add {
background-color: #00A15E;
color: white;
}
}
</style>

View File

@ -1,75 +0,0 @@
<template>
<view class="">
<view class="content">
</view>
</view>
</template>
<script setup>
import {
reactive
} from "vue"
const props = defineProps({
userInfo: Object
})
//
const getPositionFn = () => {
uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: true,
success: function(res) {
uni.request({
url: `https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=${res.longitude},${res.latitude}&key=b0c21bc6b220aa882bad8ffb6bce8829&radius=1000&extensions=all`,
success: (res) => {
console.log(res)
}
})
}
});
}
const userInfo = reactive(props.userInfo)
const navgo = (url) => {
uni.navigateTo({
url
})
}
const navgoFn = (is_cropped, land_id) => {
if (!is_cropped) {
navgo(`/pages/InformationAdd/index?land_id=${land_id}`)
} else if (is_cropped) {
navgo(`/pages/detail/plant?land_id=${land_id}`)
}
if (is_cropped == 2) {
navgo('/pages/detail/plant')
}
}
</script>
<style lang="scss">
.content {
min-height: 90vh;
position: relative;
// padding: 0 20rpx;
// padding-top: 50rpx;
background-color: #EAF2EF;
padding: 0;
.border-bgc {
height: 200rpx;
background-color: #34D190;
border-radius: 0 0 40rpx 40rpx;
position: absolute;
width: 750rpx;
}
}
</style>

View File

@ -87,6 +87,9 @@
<style lang="scss" scoped>
.card {
// width: 710rpx;
margin: 0 auto;
.tit {
display: flex;
justify-content: space-between;

View File

@ -1,197 +0,0 @@
<template>
<view class="" v-if="props.showImg">
<view class="" v-if="animal_detail?.pic_detail?.pic">
<imgCard :imgUrl='animal_detail.pic_detail.pic'></imgCard>
</view>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/sj.png')" style="margin: 0 5rpx;" width="28.04rpx"
height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
<view style="display: flex;" @click="navgo(`/pages/poultry/histroyFeed?id=${props.id}`)">
查看历史条件 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
<view class="card">
<view class="tit">
<view class="">
溯源码: {{animal_detail.code}}
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: {{animal_detail.kind}}
</view>
<view class="">
年龄: {{animal_detail.age}}
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{animal_detail.breed}}
</view>
<view class="">
体重:{{animal_detail.weight}}
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: #00A15E;" v-if='animal_detail.status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='animal_detail.status==2'>
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if='animal_detail.status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='animal_detail.status==3'>
生病隔离中
</view>
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
animalInfoAPI,
addAnimalPicAPI
} from "@/api/chick.js"
import {
ref,
reactive,
watch
} from "vue"
import {
onShow
} from "@dcloudio/uni-app"
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
//
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
const animal_detail = reactive({})
const props = defineProps({
id: String,
showImg: Boolean
})
watch(props, (newValue, oldVlaue) => {
// console.log("dfhsdfgsdjk")
if (props?.id) {
animalInfoAPI({
poultry_id: Number(props.id)
}).then(res => {
objFn(res.data, animal_detail)
})
}
}, {
//
immediate: true
})
onShow(() => {
if (props?.id) {
animalInfoAPI({
poultry_id: Number(props.id)
}).then(res => {
objFn(res.data, animal_detail)
})
}
})
const updateImgFn = () => {
uplodeImg().then(res => {
animal_detail.pic_detail.pic = res.data.image
// img.value = res.data.image
addAnimalPicAPI({
poultry_id: Number(props.id),
pic: res.data.image
})
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,88 +0,0 @@
<template>
<!-- {{userInfo.poultry_detail}} -->
<view class="card" v-if="userInfo.poultry_detail">
<!-- {{userInfo.animal_detail.total_count}} -->
<view class="tit">
<view class="">
农户名称: {{userInfo.name}}
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 养殖户
</view>
<view class="">
养殖头数: {{userInfo.poultry_detail.total_count}}
</view>
</view>
<view class="card-li">
<view class="">
土地面积:{{userInfo.total_land_area}}
</view>
<view class="">
: {{userInfo.poultry_detail.male_count}}
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: {{userInfo.poultry_detail.kind[0]}},{{userInfo.poultry_detail.kind[1]}}
</view>
<view class="">
: {{userInfo.poultry_detail.maternal_count}}
</view>
</view>
<view class="card-li">
<view class="">
具体种类: {{userInfo.poultry_detail.breed[0]}}
</view>
</view>
<view class="card-li">
<view class="">
地址: {{userInfo.area_name}}{{userInfo.street_name}}{{userInfo.village_name}}{{userInfo.brigade_name}}
</view>
</view>
</view>
</template>
<script setup>
import {
reactive,
watch
} from "vue";
// import {
// userInfoAPI
// } from "@/api/plant.js"
import {
userInfoStore
} from '@/store/userInfo'
const userInfoStores = userInfoStore()
const userInfo = reactive({})
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
// userInfoAPI({
// user_id: 307
// }).then(res => {
// objFn(res.data, userInfo)
// })
objFn(userInfoStores.userInfo, userInfo)
</script>
<style lang="scss" scoped>
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
</style>

View File

@ -1,223 +0,0 @@
<template>
<view class="">
<view class="tit">
<view class="">
监管详情
</view>
<view class="">
<view class="updata-btn">
查看全部监管记录<u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="28.04rpx"
height="28.04rpx"></u--image>
</view>
</view>
</view>
<view class="card">
<view class="card-tit">
<view class="">
1号土地
</view>
<view class="">
溯源码: 123148
</view>
</view>
<view class="card-li">
<view class="">
当前种植: 土豆
</view>
<view class="">
标志品种: 土豆大煞风景
</view>
</view>
<view class="card-li">
<view class="select">
监管状况: <up-input readonly placeholder="请选择" style="margin-top: 20rpx;width: 600rpx;"
border="surround" @click.capture="selectFoucsFn" @blur="selectAct=false" v-model="value">
</up-input>
<view class="JT" :class="{actJT:selectAct}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct">
<view class="select-li" v-for="(item,index) in selectList" :key="index"
@click="changSelectfn(index)" :style="{color:indexs==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="">
监管图片
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
reactive,
ref
} from "vue"
const selectList = reactive([
"正常", "未及时更新生产状况", "生产状况与实际不符"
])
const value = ref("")
const selectAct = ref(false)
const selectAct1 = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
}
const indexs = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
selectAct.value = false
}
const updateImgFn = () => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
console.log('chooseImage success, temp path is', res.tempFilePaths[0])
var imageSrc = res.tempFilePaths[0]
uni.showLoading({
title: '上传中'
})
this.task = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload', //
filePath: imageSrc,
name: 'file',
formData: {
'user': 'test'
},
success: (res) => {
if (this.pageVisible) {
console.log('uploadImage success, res is:', res)
uni.hideLoading();
uni.showToast({
title: '上传成功',
icon: 'success',
duration: 1000
})
this.imageSrc = imageSrc
}
},
fail: (err) => {
if (this.pageVisible) {
console.log('uploadImage fail', err);
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
},
});
},
fail: (err) => {
console.log('chooseImage fail', err)
}
})
}
</script>
<style lang='scss' scoped>
.tit {
display: flex;
justify-content: space-between;
margin: 20rpx;
}
.updata-btn {
display: flex;
align-items: center;
}
.card-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
}
.card-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
}
.select {
position: relative;
.JT {
position: absolute;
right: 20rpx;
top: 60%;
z-index: 9999;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 608.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 0rpx;
bottom: -200rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.code-img {
margin-top: 20rpx;
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
</style>

View File

@ -13,318 +13,10 @@
"style": {
"navigationStyle": "custom"
}
}, {
"path": "pages/InformationAdd/index",
"style": {
"navigationBarTitleText": "信息添加",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/growRecord/index",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/growRecord/feedIng",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/growRecord/chick",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/growRecord/fish",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/detail/plant",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/allPlant/index",
"style": {
"navigationBarTitleText": "全部种植",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/records/index",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/profile/index",
"style": {
"navigationBarTitleText": "生长概况",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/feedList",
"style": {
"navigationBarTitleText": "养殖列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
// live harvest
{
"path": "pages/feedIng/feedDetail",
"style": {
"navigationBarTitleText": "养殖详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/feedIng/histroyFeed",
"style": {
"navigationBarTitleText": "历史养殖记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/feedIng/updateFeed",
"style": {
"navigationBarTitleText": "更新饲养状态",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/feedIng/vaccineInfo",
"style": {
"navigationBarTitleText": "疫苗信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/addPoultry",
"style": {
"navigationBarTitleText": "添加饲养动物",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/allRecordTable",
"style": {
"navigationBarTitleText": "记录列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/allFeed",
"style": {
"navigationBarTitleText": "全部养殖记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/SingleDetail",
"style": {
"navigationBarTitleText": "单个详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/feedIng/allRecording",
"style": {
"navigationBarTitleText": "全部记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/poultry/feedList",
"style": {
"navigationBarTitleText": "养殖列表",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/poultry/feedDetail",
"style": {
"navigationBarTitleText": "养殖详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/poultry/histroyFeed",
"style": {
"navigationBarTitleText": "历史养殖记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/poultry/updateFeed",
"style": {
"navigationBarTitleText": "更新饲养状态",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/poultry/vaccineInfo",
"style": {
"navigationBarTitleText": "疫苗信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/poultry/addPoultry",
"style": {
"navigationBarTitleText": "添加饲养动物",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/poultry/allFeed",
"style": {
"navigationBarTitleText": "全部养殖记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/poultry/SingleDetail",
"style": {
"navigationBarTitleText": "单个详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/poultry/allRecording",
"style": {
"navigationBarTitleText": "全部记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/aquatic/addAquatic",
"style": {
"navigationBarTitleText": "添加养殖",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/aquatic/addPond",
"style": {
"navigationBarTitleText": "养殖信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/aquatic/updateGrow",
"style": {
"navigationBarTitleText": "更新生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/aquatic/allRecordTable",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/aquatic/imgList",
"style": {
"navigationBarTitleText": "生长记录",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/aquatic/detail",
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/supervision/group",
"style": {
"navigationBarTitleText": "小组公司监管",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/supervision/captain",
"style": {
"navigationBarTitleText": "生产队长监管",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/supervision/farmerDeatil",
"style": {
"navigationBarTitleText": "农户详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
}, {
"path": "pages/supervision/detail",
"path": "pages/landDetail/index",
"style": {
"navigationBarTitleText": "土地详情",
"enablePullDownRefresh": false,
@ -332,7 +24,69 @@
"navigationBarTextStyle": "black"
}
},
//
{
"path": "pages/husbandryForm/harvest",
"style": {
"navigationBarTitleText": "添加收获信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/husbandryForm/Pest",
"style": {
"navigationBarTitleText": "添加虫害防治信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/husbandryForm/irrigate",
"style": {
"navigationBarTitleText": "添加灌溉信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/husbandryForm/weeding",
"style": {
"navigationBarTitleText": "添加除草信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/husbandryForm/fertilize",
"style": {
"navigationBarTitleText": "添加施肥信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/husbandryForm/sow",
"style": {
"navigationBarTitleText": "添加种植信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/live/live",
"style": {
"navigationBarTitleText": "苗情监测",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F4F4",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/addLand/addLand",
"style": {

View File

@ -1,20 +0,0 @@
<template>
<view class="content">
<plantadd></plantadd>
</view>
</template>
<script setup>
import plantadd from "@/components/InformationAdd/plant.vue"
</script>
<style scoped lang="scss">
.content {
background-color: #F4F4F4;
padding: 20rpx;
min-height: 100vh;
}
</style>

View File

@ -1,187 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
1号土地
</view>
<view class="">
溯源码: 12302
</view>
</view>
<view class="card-li">
<view class="">
当前种植: 土豆
</view>
<view class="">
种植品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
种子品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
预计产量: 20
</view>
<view class="">
已出售: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
播种时间: 2020.12.01
</view>
</view>
</view> -->
<landInfo :land_id='land_id'></landInfo>
<!-- <view class="status">
<view class="" style="margin-bottom: 30rpx;">
今日种植状态
</view>
<imgCard text="地址"
imgUrl='http://ceshi-suyuan.lihaink.cn/uploads/20231025/3048b734cff7d9adfb00aaf6ab7290e5.jpeg'>
</imgCard>
</view>
<view class="status">
<view class="" style="margin-bottom: 30rpx;">
播种图片
</view>
<imgCard text="地址"
imgUrl='http://ceshi-suyuan.lihaink.cn/uploads/20231025/3048b734cff7d9adfb00aaf6ab7290e5.jpeg'>
</imgCard>
</view> -->
<view class="status">
<view class="" style="margin-bottom: 30rpx;">
生长情况
</view>
<imgCard text="地址" :imgUrl="item" v-for="(item,index) in imgList" :key="index" @tap='previewImage(index)'>
</imgCard>
</view>
<view class="up-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
</template>
<script setup>
import landInfo from "@/components/plant/landInfo.vue"
import imgCard from "@/components/imgCard.vue"
import {
landCropPicListAPI,
addLandCropPicAPI
} from "@/api/plant.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
ref,
reactive
} from "vue"
import uplodeImg from "@/utils/uplodeImg.js"
const imgList = reactive([])
const crop_id = ref(0)
const land_id = ref(0)
onLoad((options) => {
crop_id.value = options.crop_id
land_id.value = options.land_id
landCropPicListAPI({
crop_id: options.crop_id
}).then(res => {
res.data.forEach(item => {
imgList.push(item.pic)
})
})
})
const updateImgFn = () => {
let image = ""
uplodeImg().then(res => {
image = res.data.image
addLandCropPicAPI({
crop_id: crop_id.value,
pic: image
}).then(res2 => {
imgList.unshift(image)
})
})
}
const previewImage = (index) => {
uni.previewImage({
urls: imgList,
current: index,
})
}
</script>
<style lang="scss" scoped>
.content {
padding: 20rpx;
background-color: #F4F4F4;
min-height: 100vh;
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.status {
margin-bottom: 40rpx;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 20rpx auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 360.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 20rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
padding-left: 20rpx;
}
}
}
.up-btn {
width: 371.5rpx;
height: 66.59rpx;
border: 1px solid #00A15E;
color: #00A15E;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 66rpx;
margin: 40rpx auto;
}
</style>

View File

@ -1,207 +0,0 @@
<template>
<view class="content" @click.capture="off">
<view class="card">
<view class="" style="margin-bottom: 20rpx;">
养殖品种: 白鲢
</view>
<view class="" style="margin-bottom: 20rpx;">
养殖数量: 白鲢
</view>
<view class="" style="margin-bottom: 20rpx;">
鱼苗购入点: 白鲢
</view>
<view class="" style="margin-bottom: 20rpx;">
购入凭证
</view>
<view class="code-img">
<view class="carime-icon">
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
养殖品种
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
鱼苗数量
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
鱼苗购入点
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li-tit">
购入凭证
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
<view class="next-btn">
下一个
</view>
<view class="ripe-btn" @click="navgo('/pages/index/index')">
完成添加
</view>
</view>
</template>
<script setup>
import {
reactive,
ref
} from "vue"
const navgo = (url) => {
uni.navigateTo({
url
})
}
const updateImgFn = () => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
console.log('chooseImage success, temp path is', res.tempFilePaths[0])
var imageSrc = res.tempFilePaths[0]
uni.showLoading({
title: '上传中'
})
this.task = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload', //
filePath: imageSrc,
name: 'file',
formData: {
'user': 'test'
},
success: (res) => {
if (this.pageVisible) {
console.log('uploadImage success, res is:', res)
uni.hideLoading();
uni.showToast({
title: '上传成功',
icon: 'success',
duration: 1000
})
this.imageSrc = imageSrc
}
},
fail: (err) => {
if (this.pageVisible) {
console.log('uploadImage fail', err);
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
},
});
},
fail: (err) => {
console.log('chooseImage fail', err)
}
})
}
</script>
<style lang="scss">
.card-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.card-cont {
display: flex;
justify-content: space-between;
.card-l {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.card-r {
overflow: hidden;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 353.97rpx;
height: 210.28rpx;
}
}
.card-li-tit {
margin-bottom: 20rpx;
}
.uplode {
height: 350.47rpx;
background-color: red;
}
.next-btn {
width: 196.26rpx;
height: 66.59rpx;
border: 1px solid #00A15E;
color: #00A15E;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
margin: 0 auto;
text-align: center;
line-height: 66rpx;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
</style>

View File

@ -1,228 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="card-li">
<view class="card-li-tit">
养殖种类
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.kind"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
具体品种
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.breed"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
具体数量
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.number"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
鱼苗购入时间
</view>
<view class="">
<up-input placeholder="点击选择时间" @focus="choseDateFn" border="surround"
v-model="formData.buy_info"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
导入凭证
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="up-img confim-btn">
+上传播种图片
</view> -->
<view class="confirm">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
<view class="confirm-btn" style="color: #0AA565;" @click="nextFn">
下一个
</view>
</view>
<!-- <view class="today-btn confim-btn" @tap="sowFn">
今日播种
</view> -->
<!-- 组件 -->
<uni-calendar :insert="false" ref="calendar" :lunar="true" @confirm="confirm" />
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
import {
userInfoStore
} from '@/store/userInfo'
const userInfo = userInfoStore()
// console.log()
const formData = reactive({})
const baseData = reactive({
user_id: userInfo.userInfo.id,
pond_id: "",
kind: "",
breed: "",
number: "",
buy_info: "",
buy_cert: ""
})
const objFn = (res, obj) => {
for (let key in res) {
obj[key] = res[key]
}
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
if (formData.kind) {
nextFn()
}
navgo('/pages/index/index')
}
const nextFn = async () => {
let res = await addFishAPI({
...formData
})
uni.showToast({
title: res.msg,
icon: 'none'
})
objFn(baseData, formData)
}
const updateImgFn = async () => {
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
onLoad((options) => {
baseData.pond_id = options.pond_id
objFn(baseData, formData)
})
const calendar = ref()
const choseDateFn = () => {
calendar.value.open()
}
const confirm = (e) => {
formData.buy_info = e.fulldate
}
</script>
<style lang='scss' scoped>
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
margin-bottom: 100rpx;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
margin: 0 auto;
display: flex;
bottom: 80rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin-right: 20rpx;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -1,87 +0,0 @@
<template>
<view class="content">
<pondCard :id='pond_id'></pondCard>
<view class="histroy">
<view class="tit" style="margin-bottom: 40rpx;">
历史操作记录
</view>
<myTable :dataList='dataList'></myTable>
</view>
</view>
</template>
<script setup>
import pondCard from "@/components/aquatic/pondCard.vue"
import {
ref,
reactive
} from "vue"
import myTable from "@/components/myTable/index.vue"
import {
actionsAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
const dataList = reactive({})
const pond_id = ref('')
onLoad((option) => {
pond_id.value = option.pond_id
actionsAPI({
type: 4,
pond_id: pond_id.value
}).then(res => {
for (let key in res.data[option.index].action_record) {
dataList[key] = res.data[option.index].action_record[key]
}
})
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 30rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,351 +0,0 @@
<template>
<view class="content">
{{actionsList}}
<imgCard :imgUrl='headData?.pic_detail?.pic'></imgCard>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
<view style="display: flex;" @click="navgo(`/pages/aquatic/imgList?pond_id=${pond_id}`)">
查看历史条件 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
<pondCard :id='pond_id' :showBtn="true"></pondCard>
<view class="circumstance" v-for="(item,index) in actionList" :key="index">
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn"
@click="navgo(`/pages/growRecord/fish?type=4&pond_id=${pond_id}&title=${index}`)">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record"
:route='`/pages/aquatic/allRecordTable?pond_id=${pond_id}&index=${index}`'>
</myTable>
</view>
<view class="data">
<view class="tit">
<view class="" style="display: flex;justify-content: space-between;font-size: 29.79rpx;">
<view class="">
环境监测数据
</view>
</view>
<view class="tit-b">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间: {{dateFn()}}</text>
</view>
</view>
<view class="data-cont">
<view class="data-cont-li center" v-for="(item,index) in data " :key="index">
<view style="margin:0 20rpx">
<view class="center">
<u--image :src="urlFn(item.icon)" style="margin: 0 5rpx;" width="38.55rpx"
height="38.54rpx"></u--image>
{{item.tit}}
</view>
<view class="b-cls">
<view class="" :style="{color:item.flag?'#0095FF':''}">
<text style=" font-size: 70.09rpx;">
{{baseData[item.cont]}}
</text>{{item.dw}}
</view>
<view class="" style="display: flex;align-items: center;" v-if="item.flag">
<u--image :src="urlFn('D')" style="margin: 0 5rpx;" width="31.54rpx" height="31.54rpx">
</u--image>
<text style="color: #0095FF;">5</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import {
actionsAPI
} from "@/api/animal.js"
import {
pondInfoAPI,
addFishPicAPI,
pondEnvDataAPI
} from "@/api/aquatic.js"
import myTable from "@/components/myTable/index.vue"
import imgCard from "@/components/imgCard.vue"
import pondCard from "@/components/aquatic/pondCard.vue"
import {
onLoad,
onShow
} from "@dcloudio/uni-app"
import uplodeImg from "@/utils/uplodeImg.js"
const data = reactive([{
tit: "水温",
icon: 'TRWD',
dw: "℃",
cont: 'water_temp',
flag: false,
}, {
tit: "PH值",
icon: 'TRSD',
cont: 'ph_content',
}, {
tit: "溶解氧",
icon: 'FX',
cont: 'dissolved_oxygen',
dw: "%",
}, {
tit: "电导率",
icon: 'FS',
dw: "mg/l",
cont: 'electric_conductivity',
}, {
tit: "TDS",
icon: 'JYL',
dw: "lux",
cont: 'tds',
},
])
const baseData = reactive({})
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const updateImgFn = () => {
let image = ""
uplodeImg().then(res => {
image = res.data.image
headData.pic_detail.pic = image
addFishPicAPI({
pond_id: pond_id.value,
pic: image
})
})
}
const pond_id = ref(0)
const actionList = reactive({})
const headData = reactive({})
onShow(() => {
pondInfoAPI({
user_id: 307,
pond_id: pond_id.value
}).then(res => {
for (let key in res.data) {
headData[key] = (res.data)[key]
}
})
})
onLoad(async (option) => {
pond_id.value = option.pond_id
actionsAPI({
type: 4,
pond_id: option.pond_id
}).then(res2 => {
for (let key in res2.data) {
actionList[key] = (res2.data)[key]
}
console.log(actionList)
})
let res1 = await pondEnvDataAPI({
user_id: 307
})
for (let key in res1.data) {
baseData[key] = (res1.data)[key]
}
let res = await pondInfoAPI({
user_id: 307,
pond_id: pond_id.value
})
for (let key in res.data) {
headData[key] = (res.data)[key]
}
})
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
width: 192.76rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
.add-btn {
margin: 0 auto;
width: 220.79rpx;
height: 57.83rpx;
color: #00A15E;
border: 1px solid #00A15E;
border-radius: 50rpx;
display: flex;
justify-content: center;
line-height: 57rpx;
font-size: 26rpx;
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,186 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
1号土地
</view>
<view class="">
溯源码: 12302
</view>
</view>
<view class="card-li">
<view class="">
当前种植: 土豆
</view>
<view class="">
种植品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
种子品牌: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
预计产量: 20
</view>
<view class="">
已出售: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
播种时间: 2020.12.01
</view>
</view>
</view> -->
<!-- <landInfo :pond_id='pond_id'></landInfo> -->
<pondCard :id='pond_id'></pondCard>
<!-- <view class="status">
<view class="" style="margin-bottom: 30rpx;">
今日种植状态
</view>
<imgCard text="地址"
imgUrl='http://ceshi-suyuan.lihaink.cn/uploads/20231025/3048b734cff7d9adfb00aaf6ab7290e5.jpeg'>
</imgCard>
</view>
<view class="status">
<view class="" style="margin-bottom: 30rpx;">
播种图片
</view>
<imgCard text="地址"
imgUrl='http://ceshi-suyuan.lihaink.cn/uploads/20231025/3048b734cff7d9adfb00aaf6ab7290e5.jpeg'>
</imgCard>
</view> -->
<view class="status">
<view class="" style="margin-bottom: 30rpx;">
生长情况
</view>
<imgCard text="地址" :imgUrl="item" v-for="(item,index) in imgList" :key="index" @tap='previewImage(index)'>
</imgCard>
</view>
<view class="up-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
</template>
<script setup>
// import landInfo from "@/components/plant/landInfo.vue"
import imgCard from "@/components/imgCard.vue"
import pondCard from "@/components/aquatic/pondCard.vue"
import {
fishPicListAPI,
addFishPicAPI
} from "@/api/aquatic.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
ref,
reactive
} from "vue"
import uplodeImg from "@/utils/uplodeImg.js"
const imgList = reactive([])
const pond_id = ref(0)
onLoad((options) => {
pond_id.value = options.pond_id
fishPicListAPI({
pond_id: options.pond_id
}).then(res => {
res.data.forEach(item => {
imgList.push(item.pic)
})
})
})
const updateImgFn = () => {
let image = ""
uplodeImg().then(res => {
image = res.data.image
addFishPicAPI({
pond_id: pond_id.value,
pic: image
}).then(res2 => {
imgList.unshift(image)
})
})
}
const previewImage = (index) => {
uni.previewImage({
urls: imgList,
current: index,
})
}
</script>
<style lang="scss" scoped>
.content {
padding: 20rpx;
background-color: #F4F4F4;
min-height: 100vh;
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.status {
margin-bottom: 40rpx;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 20rpx auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 360.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 20rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
padding-left: 20rpx;
}
}
}
.up-btn {
width: 371.5rpx;
height: 66.59rpx;
border: 1px solid #00A15E;
color: #00A15E;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 66rpx;
margin: 40rpx auto;
}
</style>

View File

@ -1,126 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
<view class="">
溯源码: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖数量: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
草鱼鱼苗: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
鲫鱼鱼苗: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
</view>
</view>
<view class="">
<view class="" style="margin-bottom: 20rpx;">
网兜计数
</view>
<view class="card">
<view class="card-tit">
网兜面积
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
<view class="card-tit">
网兜内数量
</view>
<view class="" style="display: flex; align-items: center;margin-bottom: 20rpx;">
草鱼数量 <up-input style="margin-left: 20rpx;" placeholder="请输入品种" border="surround" v-model="value"
@change="change"></up-input>
</view>
<view class="" style="display: flex; align-items: center;">
鲫鱼数量 <up-input style="margin-left: 20rpx;" placeholder="请输入品种" border="surround" v-model="value"
@change="change"></up-input>
</view>
<view class="card-tit">
平均重量
</view>
<view class="" style="display: flex; align-items: center;margin-bottom: 20rpx;">
草鱼重量 <up-input style="margin-left: 20rpx;" placeholder="请输入品种" border="surround" v-model="value"
@change="change"></up-input>
</view>
<view class="" style="display: flex; align-items: center;">
鲫鱼重量 <up-input style="margin-left: 20rpx;" placeholder="请输入品种" border="surround" v-model="value"
@change="change"></up-input>
</view>
</view>
</view>
<view class="ripe-btn">
确认
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const value = ref("")
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
font-size: 26.29rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-tit {
margin: 20rpx 0;
font-size: 29.79rpx;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
</style>

View File

@ -1,405 +0,0 @@
<template>
<view class="content">
</view>
</template>
<script setup>
import {
landInfoAPI,
addLandCropPicAPI,
landCropRecordListAPI,
landEnvDataCurrAPI,
setLandCropRipeAPI,
ediLandCropRecordAPI,
landCropAllRipeAPI
} from "@/api/plant.js"
import myTable from "@/components/myTable/index.vue"
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import landInfo from "@/components/plant/landInfo.vue"
import {
actionsAPI
} from "@/api/animal.js"
import {
ref,
reactive
} from "vue"
import {
onLoad,
onShow
} from "@dcloudio/uni-app"
const crop_yield = ref("")
const showPop = ref(false)
const tableDate = reactive({})
const landDeatil = reactive({})
const data = reactive([{
tit: "土壤温度",
icon: 'TRWD',
dw: "℃",
cont: 'soil_temp',
flag: false,
}, {
tit: "土壤湿度",
icon: 'TRSD',
dw: "%RH",
cont: 'soil_mois',
}, {
tit: "磷含量",
icon: 'FX',
cont: 'k_content',
dw: "%",
}, {
tit: "氮含量",
icon: 'FS',
dw: "mg/l",
cont: 'n_content',
}, {
tit: "钾含量",
icon: 'JYL',
dw: "%",
cont: 'p_content',
},
], )
const baseData = reactive({})
const crop_id = ref(0)
const getcropidFn = (e) => {
crop_id.value = e.cropid
}
onShow(async () => {
let res = await landInfoAPI({
user_id: 307,
land_id: land_id.value
})
objFn(res.data, landDeatil)
})
const land_id = ref(0)
onLoad(async (options) => {
land_id.value = options.land_id
let res = await landInfoAPI({
user_id: 307,
land_id: options.land_id
})
objFn(res.data, landDeatil)
// let res2 = await landCropRecordListAPI({
// crop_id: landDeatil.crop_id
// })
let res2 = await actionsAPI({
type: 1,
crop_id: landDeatil.crop_id
})
objFn(res2.data, tableDate)
let res3 = await landEnvDataCurrAPI({
user_id: 307,
})
objFn(res3.data, baseData)
}, )
const updateImgFn = () => {
let image = ""
uplodeImg().then(res => {
image = res.data.image
landDeatil.pic = image
addLandCropPicAPI({
crop_id: landDeatil.crop_id,
pic: image
}).then(res2 => {
console.log(res2)
})
})
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const backFn = () => {
uni.navigateBack()
}
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const markFn = () => {
setLandCropRipeAPI({
crop_id: landDeatil.crop_id,
crop_yield: Number(crop_yield.value)
}).then(res => {
showPop.value = false
})
}
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
const allripeFn = () => {
landCropAllRipeAPI({
crop_id: crop_id.value
})
uni.navigateTo({
url: '/pages/index/index'
})
}
// actionsAPI({
// type: 1
// }).then(res => {
// for (let key in res.data) {
// actionList[key] = (res.data)[key]
// }
// })
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
// background-color: grey;
background-color: #EBF1EF;
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 43rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
.data {
.tit {
.tit-b {
color: #B3B3B3;
font-size: 26.29rpx;
display: flex;
align-items: center;
}
}
.data-alanys {
// background-color: blue;
float: right;
color: white;
}
.data-cont {
// margin: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: 30rpx;
box-sizing: border-box;
// padding: 70rpx;
.data-cont-li {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 310.94rpx;
height: 212.03rpx;
background-color: white;
margin-bottom: 20rpx;
}
}
}
.center {
display: flex;
align-items: center;
}
.b-cls {
display: flex;
align-items: flex-end;
width: 250rpx;
justify-content: space-between;
color: #4CC593;
}
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.grow-record-tit {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
align-items: center;
font-size: 26.29rpx;
.updata-btn {
width: 192.76rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.mark {
// padding: 30rpx;
padding: 30rpx;
.head {
display: flex;
justify-content: space-between;
align-items: center;
}
.mark-li {
display: flex;
justify-content: space-between;
margin: 40rpx;
border-bottom: 1px solid #EBF1EF;
padding-bottom: 20rpx;
}
}
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
width: 192.76rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,162 +0,0 @@
<template>
<view class="content">
<!-- <imgCard></imgCard>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
<view style="display: flex;" @click="navgo(`/pages/feedIng/histroyFeed?id=${animal_id}`)">
查看历史条件 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view> -->
<!-- <view class="card">
<view class="tit">
<view class="">
编号: 52656
</view>
<view class="">
溯源码: 52656
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: 土豆
</view>
<view class="">
年龄: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: 20
</view>
<view class="">
体重: 45kg
</view>
</view>
</view> -->
<!-- <view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: green;">
健康
</view>
</view>
</view> -->
<detailCard :id="animal_id" :showImg='true'></detailCard>
<view class="">
<view class="" style="margin-bottom: 20rpx;">
饲养记录
</view>
<myTable></myTable>
</view>
</view>
</template>
<script setup>
import myTable from "@/components/myTable/index.vue"
import imgCard from "@/components/imgCard.vue"
import detailCard from "@/components/animal/detailCard.vue"
import {
ref
} from "vue"
import {
onLoad
} from "@dcloudio/uni-app"
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const animal_id = ref(0)
onLoad((option) => {
animal_id.value = option.id
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.table {
margin-top: 20rpx;
height: 500rpx;
background-color: red;
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,335 +0,0 @@
<template>
<view class="content">
<view class="head" v-if="addList.length">
已添加{{addList.length}}条畜生
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
养殖品种
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.kind"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
动物编码
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.code"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
具体品类
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.breed"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
年龄
</view>
<view class="">
<up-input placeholder="请输入年龄" border="surround" v-model="formData.age"></up-input>
</view>
</view>
<view class="card-li">
<view class="select">
养殖类型: <up-input @click="selectFoucsFn" placeholder="请选择" style="margin-top: 20rpx;"
border="surround" v-model="gender">
</up-input>
<view class="JT" :class="{actJT:selectAct}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct">
<view class="select-li" v-for="(item,index) in selectList" :key="index"
@click="changSelectfn(index)" :style="{color:indexs==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="select">
状态: <up-input placeholder="请选择" style="margin-top: 20rpx;" border="surround" @click="selectFoucsFn1"
v-model="status">
</up-input>
<view class="JT" :class="{actJT:selectAct1}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct1" style="bottom:-250rpx">
<view class="select-li" v-for="(item,index) in selectList1" :key="index"
@click="changSelectfn1(index)" :style="{color:indexs1==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs1==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
体重
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.weight"></up-input>
</view>
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<view class="" v-if="formData.pic">
<u--image :src="formData.pic" width="637.85rpx" height='196.26rpx'></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
上传
</view>
</view>
</view>
</view>
</view>
<view class="next-btn" @click="nextFn">
下一个
</view>
<view class="ripe-btn" @click='navgo'>
完成添加
</view>
</view>
</template>
<script setup>
import {
reactive,
ref
} from "vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
addAnimalAPI,
} from "@/api/animal.js"
const navgo = () => {
uni.navigateTo({
url: "/pages/index/index"
})
}
const updateImgFn = () => {
uplodeImg().then(res => {
formData.pic = res.data.image
})
}
const off = () => {
selectAct.value = false
selectAct1.value = false
}
const selectList = reactive([
"公猪", "母猪"
])
const gender = ref("")
const status = ref("")
const selectList1 = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
])
const value = ref("")
const value1 = ref("")
const selectAct = ref(false)
const selectAct1 = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
selectAct1.value = false
}
const selectFoucsFn1 = (e) => {
selectAct1.value = true
selectAct.value = false
}
const indexs = ref(0)
const indexs1 = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
formData.gender = index + 1
gender.value = selectList[index]
selectAct.value = false
selectAct1.value = false
}
const changSelectfn1 = (index) => {
indexs1.value = index
value1.value = selectList[index]
formData.status = index + 1
status.value = selectList1[index]
selectAct.value = false
selectAct1.value = false
}
const baseFormData = reactive({
user_id: 307,
kind: "",
breed: "",
gender: 1,
age: "",
status: 1,
weight: "",
pic: "",
code: ""
})
const objFn = (res, obj) => {
for (let key in res) {
obj[key] = res[key]
}
}
const formData = reactive({})
objFn(baseFormData, formData)
const nextFn = () => {
addAnimalAPI({
...formData
}).then(res => {
status.value = ''
gender.value = ''
addList.push(1)
objFn(baseFormData, formData)
uni.showToast({
title: '添加成功',
icon: 'success',
duration: 1000,
})
})
}
const addList = reactive([])
</script>
<style lang="scss">
.card-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.card-cont {
display: flex;
justify-content: space-between;
.card-l {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.card-r {
overflow: hidden;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 353.97rpx;
height: 210.28rpx;
}
}
.card-li-tit {
margin-bottom: 20rpx;
}
.uplode {
height: 350.47rpx;
background-color: red;
}
.next-btn {
width: 196.26rpx;
height: 66.59rpx;
border: 1px solid #00A15E;
color: #00A15E;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
margin: 0 auto;
text-align: center;
line-height: 66rpx;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.select {
position: relative;
.JT {
position: absolute;
right: 20rpx;
top: 60%;
z-index: 9;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 608.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 0rpx;
bottom: -130rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.head {
text-align: center;
margin-bottom: 10rpx;
}
</style>

View File

@ -1,79 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="tit">
<view class="">
编号: 52656
</view>
<view class="">
溯源码: 52656
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: 土豆
</view>
<view class="">
年龄: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: 20
</view>
<view class="">
体重: 45kg
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: green;">
健康
</view>
</view>
</view>
<view class="">
<view class="" style="margin-bottom: 20rpx;">
饲养记录
</view>
<myTable></myTable>
</view>
</view>
</template>
<script setup>
import myTable from "@/components/myTable/index.vue"
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.table {
margin-top: 20rpx;
height: 500rpx;
background-color: red;
}
</style>

View File

@ -1,84 +0,0 @@
<template>
<view class="content">
<farmersCard></farmersCard>
<view class="histroy">
<view class="tit" style="margin-bottom: 40rpx;">
历史操作记录
</view>
<myTable :dataList='dataList'></myTable>
</view>
</view>
</template>
<script setup>
import farmersCard from "@/components/animal/farmersCard.vue"
import {
ref,
reactive
} from "vue"
import myTable from "@/components/myTable/index.vue"
import {
actionsAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
const dataList = reactive({})
onLoad((option) => {
actionsAPI({
type: 3
}).then(res => {
for (let key in res.data[option.index].action_record) {
dataList[key] = res.data[option.index].action_record[key]
}
})
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 30rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,89 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view> -->
<detailCard :id='id'></detailCard>
<view class="" style="margin-bottom: 20rpx;">
饲养记录
</view>
<myTable></myTable>
</view>
</template>
<script setup>
import myTable from "@/components/myTable/index.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import detailCard from "@/components/animal/detailCard.vue"
import {
ref
} from "vue"
const id = ref(0)
onLoad((option) => {
id.value = option.id
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.table {
margin-top: 20rpx;
height: 500rpx;
background-color: red;
}
</style>

View File

@ -1,445 +0,0 @@
<template>
<view class="content" @click.capture="selectAct=false">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view> -->
<farmersCard></farmersCard>
<!-- <view class="serch">
<u-search bgColor='white' height='63.08rpx' :show-action="false" actionText="搜索"
:animation="true"></u-search>
<view class="serch-btn">
搜索
</view>
</view> -->
<view class="title">
<view class="">
编号: {{baseData.animal_code}}
</view>
<view class="more-jt" @click="navgo(`/pages/feedIng/SingleDetail?id=${animal_id}`)">
查看养殖详情 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" @click.capture="selectFoucsFn">
养殖品种: {{baseData.animal_kind}}
</view>
<view class="" style="display: flex;align-items: center;">
具体种类: {{baseData.animal_breed}}
</view>
</view>
<view class="card-li">
<view class="" @click.capture="selectFoucsFn">
养殖类型: {{baseData.animal_gender==1?'公':"母"}}
</view>
<view class="" style="display: flex;align-items: center;">
体重: <up-input style="height: 49.07rpx;width: 215.54rpx;margin-left: 20rpx;" placeholder="请输入内容"
border="surround" v-model="formData.animal_weight"></up-input>
</view>
</view>
<view class="card-li" style="align-items: center;">
<view class="">
年龄: {{baseData.animal_age}}
</view>
<view class="select">
状态: <up-input readonly style="height: 49.07rpx;width: 215.54rpx;margin-left: 20rpx;"
placeholder="请选择" border="surround" @click.capture="selectFoucsFn" v-model="value">
</up-input>
<view class="JT" :class="{actJT:selectAct}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct">
<view class="select-li" v-for="(item,index) in selectList" :key="index"
@click="changSelectfn(index)" :style="{color:indexs==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view class="up-plant-btn" @tap="updataStatusFn">
确认更新
</view>
<imgCard :imgUrl='baseData?.pic_detail?.pic' @click="uplodeImgFn"></imgCard>
</view>
<view class="circumstance" v-for="(item,index) in actionList" :key="index">
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo('/pages/growRecord/index')">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record"
:route='`/pages/feedIng/allRecording?id=${animal_id}`'>
</myTable>
</view>
<view class="ripe-btn" @tap="outBar">
标记状态为出栏
</view>
</view>
<!-- 组件 -->
<u-modal :show="showModel" :showCancelButton="true" @confirm="confirmFn" @cancel="cancelFn" title="提示"
content='确认出栏吗?'></u-modal>
</template>
<script setup>
import farmersCard from "@/components/animal/farmersCard.vue"
import imgCard from "@/components/imgCard.vue"
import myTable from "@/components/myTable/index.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
ref,
reactive
} from "vue"
import {
animalInfoAPI,
animalStatusAPI,
animalChangeListAPI,
animalSellAPI,
addAnimalPicAPI
} from "@/api/animal.js"
// import
import {
actionsAPI
} from "@/api/animal.js"
const showModel = ref(false)
const selectList = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
])
const actionList = reactive({})
const value = ref("")
const selectAct = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
}
const indexs = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
formData.status = index + 1
}
const animal_id = ref(0)
const baseData = reactive({})
onLoad((options) => {
animal_id.value = options.id
formData.animal_id = options.id
animalInfoAPI({
animal_id: options.id
}).then(res => {
for (let key in res.data) {
baseData[key] = res.data[key]
}
formData.animal_weight = baseData.animal_weight
value.value = selectList[baseData.animal_status - 1]
indexs.value = baseData.animal_status - 1
})
animalChangeListAPI({
animal_id: animal_id.value
}).then(res => {
console.log(res.data)
return
for (let key in res.data) {
actionList[key] = (res.data)[key]
}
})
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
const formData = reactive({
status: '',
animal_id: '',
animal_weight: ""
})
const updataStatusFn = () => {
animalStatusAPI({
...formData
}).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
})
}
const uplodeImgFn = () => {
uplodeImg().then(res => {
// console.log(res.data.image)
baseData.pic_detail.pic = res.data.image
addAnimalPicAPI({
animal_id: animal_id.value,
pic: res.data.image
})
})
}
const cancelFn = () => {
showModel.value = false
}
const confirmFn = () => {
animalSellAPI({
animal_id: animal_id.value,
}).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
})
}, 2000)
})
}
const outBar = () => {
showModel.value = true
}
// animalChangeListAPI({
// animal_id: animal_id
// }).then(res => {
// for (let key in res.data) {
// actionList[key] = (res.data)[key]
// }
// })
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.title {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
margin-top: 42rpx;
.updata-btn {
width: 192.76rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
font-size: 26.29rpx;
}
}
.serch {
position: relative;
margin-bottom: 20rpx;
.serch-btn {
color: white;
width: 115.65rpx;
height: 63.08rpx;
background-color: #1BAB6F;
text-align: center;
line-height: 63.08rpx;
border-radius: 50rpx;
position: absolute;
top: 0;
right: 0;
}
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 20rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.select {
display: flex;
align-items: center;
position: relative;
.JT {
position: absolute;
right: 20rpx;
z-index: 9999;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 208.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 90rpx;
bottom: -250rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 20rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,183 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view> -->
<farmersCard></farmersCard>
<view class="serch">
<u-search bgColor='white' v-model="query" height='63.08rpx' :show-action="false" actionText="搜索"
:animation="true"></u-search>
<view class="serch-btn" @tap="queryFn">
搜索
</view>
</view>
<view class="card" v-for="(item,index) in animalList" :key="index"
@click="navgo(`/pages/feedIng/feedDetail?id=${item.id}`)">
<view class="tit">
<view class="">
编号: {{item.animal_code}}
</view>
<view class="" style="color: #00A15E;" v-if='item.animal_status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='item.animal_status==2'>
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if='item.animal_status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='item.animal_status==3'>
生病隔离中
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{item.animal_kind}}
</view>
<view class="">
年龄: {{item.animal_age}}
</view>
<view class="">
体重: {{item.animal_weight}}kg
</view>
</view>
</view>
<view class="ripe-btn" @click="navgo('/pages/feedIng/addPoultry')">
添加新动物
</view>
</view>
</template>
<script setup>
import {
animalListAPI,
} from "@/api/animal.js"
import farmersCard from "@/components/animal/farmersCard.vue"
import {
reactive,
ref
} from "vue";
const navgo = (url) => {
uni.navigateTo({
url
})
}
const animalList = reactive([])
animalListAPI({
user_id: 307,
page_no: 1,
page_size: 3000000,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
})
const query = ref("")
const queryFn = () => {
animalList.splice(0, 999999999)
animalListAPI({
user_id: 307,
keyword: query.value,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.serch {
position: relative;
margin-bottom: 20rpx;
.serch-btn {
color: white;
width: 115.65rpx;
height: 63.08rpx;
background-color: #1BAB6F;
text-align: center;
line-height: 63.08rpx;
border-radius: 50rpx;
position: absolute;
top: 0;
right: 0;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
margin-top: 64rpx;
}
.showmore {
font-size: 29.79rpx;
justify-content: center;
display: flex;
align-items: center;
}
</style>

View File

@ -1,148 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
溯源码: {{animal_detail.animal_code}}
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: {{animal_detail.animal_kind}}
</view>
<view class="">
年龄: {{animal_detail.animal_age}}
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{animal_detail.animal_breed}}
</view>
<view class="">
体重:{{animal_detail.animal_weight}}
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: #00A15E;" v-if='animal_detail.animal_status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='animal_detail.animal_status==2'>
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if='animal_detail.animal_status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='animal_detail.animal_status==3'>
生病隔离中
</view>
</view>
</view> -->
<detailCard :id='animal_id'></detailCard>
<view class="">
<view class="">
养殖情况
</view>
<imgCard v-for="(item,index) in imgList" :imgUrl='item' :key="index" @tap='previewImage(index)'></imgCard>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
animalPicListAPI,
addAnimalPicAPI,
animalInfoAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
reactive,
ref
} from "vue";
import detailCard from "@/components/animal/detailCard.vue"
const img = ref("")
const updateImgFn = () => {
uplodeImg().then(res => {
img.value = res.data.image
addAnimalPicAPI({
animal_id: Number(animal_id.value),
pic: res.data.image
}).then(res => {
imgList.unshift(img.value)
})
})
}
const imgList = reactive([])
const animal_id = ref("")
onLoad((option) => {
animal_id.value = option.id
animalPicListAPI({
animal_id: option.id
}).then(res => {
res.data.forEach(item => {
imgList.push(item.pic)
})
})
})
const previewImage = (index) => {
uni.previewImage({
urls: imgList,
current: index,
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,11 +0,0 @@
<template>
<view class="">
dsfsd
</view>
</template>
<script>
</script>
<style>
</style>

View File

@ -1,250 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view>
<view class="">
<view style="margin-bottom: 20rpx;">
今日操作
</view>
<view class="card">
<view class="card-li">
<view class="">
喂食
</view>
<view class="" style="color: #00A15E;" @click="showPop=true">
+添加喂食记录
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="">
注射疫苗
</view>
<view class="" style="color: #00A15E;">
+添加喂食记录
</view>
</view>
</view>
</view>
<view style="margin-bottom: 20rpx;">
具体操作内容
</view>
<view class="card">
<view class="tit">
<view class="">
喂食
</view>
<view class="" style="display: flex;">
<view class="" style="margin-right: 40rpx;">
删除
</view>
<view class="" style="color: #00A15E;">
编辑
</view>
</view>
</view>
<view class="card-li">
<view class="">
饲料类型: 无机盐饲料
</view>
<view class="">
饲料品牌: 双胞胎
</view>
</view>
<view class="card-li">
<view class="">
喂食记录: 200kg
</view>
<view class="">
备注: 双胞胎
</view>
</view>
</view>
<view class="card">
<view class="tit">
<view class="">
疫苗注射对象
</view>
<view class="" style="display: flex;">
<view class="" style="margin-right: 40rpx;">
删除
</view>
<view class="" style="color: #00A15E;">
编辑
</view>
</view>
</view>
<view class="card-li">
<view class="">
疫苗名称: 无机盐饲料
</view>
<view class="">
疫苗品牌: 双胞胎
</view>
</view>
<view class="card-li">
<view class="">
操作人员: 200kg
</view>
<view class="">
注射数量: 双胞胎
</view>
</view>
<view class="">
疫苗条形码
<view class="code-img">
</view>
</view>
</view>
<view class="ripe-btn">
完成今日统计
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="showPop=false" @open="showPop=true">
<view class="pop-content">
<view class="pop-tit">
添加喂食记录
</view>
<view class="">
饲料类型
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData.value"
@change="change"></up-input>
</view>
<view class="">
饲料品牌
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData.value"
@change="change"></up-input>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const showPop = ref(false)
const formData = reactive({
value: ""
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.pop-content {
padding: 20rpx;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
margin-bottom: 40rpx;
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.code-img {
background-color: red;
height: 196.26rpx;
margin-top: 30rpx;
}
</style>

View File

@ -1,218 +0,0 @@
<template>
<view class="content">
<view class="title">
疫苗相关信息
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
疫苗名称
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
疫苗品牌
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
操作人员
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
疫苗条形码
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
注射对象
</view>
<view class="scan">
扫描动物耳标/脚标
</view>
</view>
</view>
<view style="margin-bottom: 20rpx;" v-for="item in [1,1,1,1,1]">
<u-swipe-action>
<u-swipe-action-item :options="options1" style="border-radius: 20rpx;">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: 123456
</view>
<view class="" style="color: #00A15E;" v-if="true">
健康
</view>
<view class="" style="color: #FFD736;" v-if="0">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="0">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:黑山猪
</view>
<view class="">
年龄: 5
</view>
<view class="">
体重: 150kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
<view class="ripe-btn">
确认
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const options1 = reactive([{
text: '删除'
}])
const updateImgFn = () => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
console.log('chooseImage success, temp path is', res.tempFilePaths[0])
var imageSrc = res.tempFilePaths[0]
uni.showLoading({
title: '上传中'
})
this.task = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload', //
filePath: imageSrc,
name: 'file',
formData: {
'user': 'test'
},
success: (res) => {
if (this.pageVisible) {
console.log('uploadImage success, res is:', res)
uni.hideLoading();
uni.showToast({
title: '上传成功',
icon: 'success',
duration: 1000
})
this.imageSrc = imageSrc
}
},
fail: (err) => {
if (this.pageVisible) {
console.log('uploadImage fail', err);
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
},
});
},
fail: (err) => {
console.log('chooseImage fail', err)
}
})
}
</script>
<style lang="scss" scoped>
.card-li-tit {
margin-bottom: 20rpx;
}
.title {
margin: 20rpx 0;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.scan {
// width: 623.83rpx;
height: 80.61rpx;
border: 2px solid #00A15E;
border-radius: 50rpx;
color: #00A15E;
text-align: center;
line-height: 80rpx;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
</style>

View File

@ -1,652 +0,0 @@
<template>
<view :class="{popupShow:showPop}">
<view class="cont">
<!-- <landInfo :land_id='land_id'></landInfo> -->
<farmersCard></farmersCard>
<view class="operate" v-for="(item,index) in actionData" :key="index" v-show="title==index">
<view class="tit">
{{index}}
</view>
<view class="card">
<view class="operate-li" style="margin: 20rpx 0;margin-right: 20rpx;" @click="showPopFn(items.id)"
v-for="items,indexs in item.actions" :key='indexs'>
{{items.name}}
</view>
</view>
</view>
<view class="fertilize" v-for="(item,index) in actionList" :key="index">
<view class="card" style="padding-bottom: 0;">
<view class="fertilize-tit">
<view class="">
{{item.action_name}}
</view>
<view class="fertilize-tit-r">
<view class="" style="color: red;" @tap="del(item.id)">
删除
</view>
<view style="margin-left: 40rpx;color: #00A15E;" @tap='editFn(item)'>
编辑
</view>
</view>
</view>
<view class="fertilize-li">
<view class="fertilize-li-a" v-for="(items,indexs) in item.action_content" :key="indexs"
v-show="items[0]?.tit">
<!-- {{indexs}} -->
<view class="" v-for="item2 in items" :key="item2" v-show="item2.tit">
<view class="" v-if="indexs=='text'||indexs=='select'">
{{item2.tit}}: {{item2.value}}
</view>
<view v-if="indexs=='pic'">
{{item2.tit}}: <text style="color: #3274F9;"
@click="previewImage(item2.value)">图片</text>
</view>
<view v-if="indexs=='serch'">
注射疫苗{{item2.list?.length}}
</view>
</view>
</view>
</view>
</view>
</view>
<view class="" style="height: 100px">
</view>
</view>
<view class="ripe-btn" @click="finshFn">
完成今日操作
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="popCloseFn" @open="showPop=true">
<scroll-view scroll-y style="max-height: 90vh;">
<!-- 滚动内容 -->
<!-- 文本 -->
<view class="pop-content" v-for="item,index in popList.text" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入" border="surround" v-model="formData1.text[index].value"
@change="change1(item.title,index)"></up-input>
</view>
</view>
<!-- 下拉 -->
<view class="pop-content" v-for="item,index in popList.select" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="点击选择" @change="change2(item.title,index)" border="surround"
v-model="formData1.select[index].value" @tap="choseSelect(item,index)"></up-input>
</view>
</view>
<!-- 图片 -->
<view class="pop-content" v-for="item,index in popList.pic" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li" @click="updateImgFn(item.title,index)">
<view v-if="formData1.pic[index]?.value">
<u--image :src="formData1.pic[index]?.value" width="100%" height="196.26rpx"></u--image>
</view>
<view class="code-img" v-else>
<view class="carime-icon">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<!-- 搜素 -->
<view class="pop-content" v-for="item,index in popList.serch" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData1.serch[index].value"
@change="change4(item.title,index)"></up-input>
</view>
<view style="margin-bottom: 20rpx;" v-for="(item,index) in serchList" :key="item">
<u-swipe-action>
<u-swipe-action-item :options="options1"
style="border-radius: 20rpx;border: 1px solid #C7C6CD;"
@click="swipeDel(indexs,index)">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: {{item.code}}
</view>
<view class="" style="color: #00A15E;" v-if="item.status==1">
健康
</view>
<view class="" style="color: #FFD736;" v-if="item.status==2">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="item.status==3">
可出栏
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==5">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:{{item.kind}}
</view>
<view class="">
年龄: {{item.age}}个月
</view>
<view class="">
体重: {{item.weight}}kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</scroll-view>
</u-popup>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn" @close="showPicker=false"
@cancel="showModal=false"></u-picker>
<u-modal :show="showModal" :showCancelButton='true' :closeOnClickOverlay="true" @close="showModal=false"
content='确认删除吗?' @confirm="delFn" @cancel="showModal=false"></u-modal>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import farmersCard from "@/components/poultry/farmersCard.vue"
import {
actionsListAPI,
actionsDetailAPI,
addLandCropRecordAPI,
landCropRecordListAPI,
delLandCropRecordAPI,
ediLandCropRecordAPI,
animalSearchByCodeAPI
} from "@/api/chick.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
addFishRecordAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
const serchList = reactive([])
const actionList = reactive([])
const options1 = reactive([{
text: '删除'
}])
const showPicker = ref(false)
const columns = reactive([
['中国', '美国', '日本']
], )
const confirmFn = (e) => {
showPicker.value = false
formData1.select[selectIndex.value].value = e.value[0]
}
const type = ref(0)
const actionData = reactive({})
const delIndex = ref(0)
const title = ref('')
onLoad((options) => {
type.value = options.type
title.value = options.title
getAcyionListFn(options.type)
})
const getAcyionListFn = (type) => {
actionList.splice(0, actionList.length)
actionsListAPI({
type: type,
}).then(res => {
for (let key in res.data) {
if (key == title.value) {
actionData[key] = res.data[key]
actionData[key].action_record.forEach(item => {
item.action_content = JSON.parse(item.action_content)
})
actionList.push(...(res.data[key].action_record))
}
}
console.log(actionList)
})
}
const showPop = ref(false)
const baseData = reactive({
text: {
value: "",
tit: ""
},
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData = reactive({
text: [{
value: "",
tit: ""
}],
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData1 = reactive({
text: [],
select: [],
pic: [],
serch: []
})
// ,true,false
const actionType = ref(false)
const confirm = () => {
showPop.value = false
if (actionType.value) {
addLandCropRecordAPI({
user_id: 307,
action_id: action_id.value,
action_content: JSON.stringify(formData1)
}).then(res => {
setPropertiesToNull(formData1)
})
} else {
ediLandCropRecordAPI({
record_id: delIndex.value,
action_content: JSON.stringify(formData1)
})
}
objClear(popList)
getAcyionListFn(type.value)
serchList.splice(0, serchList.length)
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const del = (index) => {
showModal.value = true
delIndex.value = index
}
const showModal = ref(false)
const delFn = () => {
showModal.value = false
delLandCropRecordAPI({
record_id: delIndex.value
}).then(res => {
getAcyionListFn(type.value)
})
}
const editFn = (item) => {
delIndex.value = item.id
showPopFn(item.action_id)
formData1 = reactive(deepCopy(item.action_content))
if (item.action_content.serch[0]?.list?.length) {
item.action_content.serch.forEach(item => {
item.list.forEach(items => {
animalSearchByCodeAPI({
code: items
}).then(res => {
serchList.push(res.data)
})
})
})
}
console.log(serchList)
actionType.value = false
}
const popList = reactive({
text: [],
serch: [],
select: [],
pic: []
})
const action_id = ref("")
const showPopFn = (id) => {
actionType.value = true
// popList,
objClear(formData1)
objClear(popList)
action_id.value = id
actionsDetailAPI({
action_id: id
}).then(res => {
res.data.forEach(item => {
if (item.type == 1) {
formData1.text.push({
tit: "",
value: ""
})
popList.text.push(item)
}
if (item.type == 2) {
formData1.pic.push({
tit: "",
value: ""
})
popList.pic.push(item)
}
if (item.type == 4) {
formData1.select.push({
tit: "",
value: ""
})
popList.select.push(item)
}
if (item.type == 3) {
formData1.serch.push({
value: "",
tit: "",
list: [],
})
popList.serch.push(item)
}
if (item.type == 4) {
}
})
showPop.value = true
})
}
const updateImgFn = (tit, index) => {
change3(tit, index)
uplodeImg().then(res => {
formData1.pic[index].value = res.data.image
})
}
const previewImage = (src) => {
uni.previewImage({
urls: [src],
})
}
const selectIndex = ref('')
const choseSelect = (item, index) => {
formData1.select[index].tit = item.title
selectIndex.value = index
columns[0] = item.options.split(',')
showPicker.value = true
}
const change1 = (tit, index) => {
formData1.text[index].tit = tit
}
const change2 = (tit) => {
formData.select.tit = tit
}
const change3 = (tit, index) => {
formData1.pic[index].tit = tit
}
const change4 = (tit, index) => {
formData1.serch[index].tit = tit
if (formData1.serch[index].value) {
animalSearchByCodeAPI({
code: formData1.serch[index].value
}).then(res => {
if (res.data.id) {
serchList.push(res.data)
formData1.serch[index].list.push(formData1.serch[index].value)
}
formData1.serch[index].value = ''
})
console.log(serchList)
}
}
function deepCopy(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var newObj = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
newObj[key] = deepCopy(obj[key]);
}
}
return newObj;
}
const objFn = (res, data) => {
for (let key in res) {
if (typeof res[key] === 'object') {
objFn(res[key], data[key]);
} else {
data[key] = res[key]
}
}
}
const setPropertiesToNull = (obj) => {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (typeof obj[prop] === 'object') {
setPropertiesToNull(obj[prop]);
} else {
obj[prop] = null;
}
}
}
}
const objClear = (obj) => {
for (let key in obj) {
obj[key].splice(0, obj[key].length)
}
}
const popCloseFn = () => {
showPop.value = false
serchList.splice(0, serchList.length)
objClear(popList)
objClear(formData1)
}
const swipeDel = (e, index) => {
serchList.splice(e, 1);
formData1.serch[index].list.splice(e, 1)
}
const finshFn = () => {
uni.navigateTo({
url: "/pages/index/index"
})
}
</script>
<style lang="scss" scoped>
.cont {
padding-top: 30rpx;
background-color: #F4F4F4;
min-height: 100vh;
}
.card {
.tit {
display: flex;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
}
}
.operate {
width: 693.93rpx;
margin: auto;
.tit {
margin: 20rpx 0;
}
.card {
display: flex;
flex-wrap: wrap;
.operate-li {
font-size: 29.79rpx;
padding: 0 60rpx;
background-color: #F4F4F4;
margin-bottom: 28rpx;
height: 63.08rpx;
line-height: 63rpx;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
}
}
.ripe-btn {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.fertilize {
.fertilize-tit {
display: flex;
// justify-self: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #F4F4F4;
margin-bottom: 20rpx;
.fertilize-tit-r {
display: flex;
}
}
.fertilize-li {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
flex-wrap: wrap;
.fertilize-li-a {
margin-bottom: 20rpx;
min-width: 40vw;
}
}
}
.pop-content {
padding: 20rpx;
padding-bottom: 0;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
// margin-bottom: 40rpx;
}
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
margin: 0 auto;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
.popupShow {
// overflow: hidden;
position: fixed;
left: 30rpx;
}
</style>

View File

@ -1,653 +0,0 @@
<template>
<view :class="{popupShow:showPop}">
<view class="cont">
<!-- <landInfo :land_id='land_id'></landInfo> -->
<farmersCard></farmersCard>
<view class="operate" v-for="(item,index) in actionData" :key="index" v-show="title==index">
<view class="tit">
{{index}}
</view>
<view class="card">
<view class="operate-li" style="margin: 20rpx 0;margin-right: 20rpx;" @click="showPopFn(items.id)"
v-for="items,indexs in item.actions" :key='indexs'>
{{items.name}}
</view>
</view>
</view>
<view class="fertilize" v-for="(item,index) in actionList" :key="index">
<view class="card" style="padding-bottom: 0;">
<view class="fertilize-tit">
<view class="">
{{item.action_name}}
</view>
<view class="fertilize-tit-r">
<view class="" style="color: red;" @tap="del(item.id)">
删除
</view>
<view style="margin-left: 40rpx;color: #00A15E;" @tap='editFn(item)'>
编辑
</view>
</view>
</view>
<view class="fertilize-li">
<view class="fertilize-li-a" v-for="(items,indexs) in item.action_content" :key="indexs"
v-show="items[0]?.tit">
<!-- {{indexs}} -->
<view class="" v-for="item2 in items" :key="item2" v-show="item2.tit">
<view class="" v-if="indexs=='text'||indexs=='select'">
{{item2.tit}}: {{item2.value}}
</view>
<view v-if="indexs=='pic'">
{{item2.tit}}: <text style="color: #3274F9;"
@click="previewImage(item2.value)">图片</text>
</view>
<view v-if="indexs=='serch'">
什么鸡蛋{{item2.list?.length}}
</view>
</view>
</view>
</view>
</view>
</view>
<view class="" style="height: 100px">
</view>
</view>
<view class="ripe-btn" @click="finshFn">
完成今日操作
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="popCloseFn" @open="showPop=true">
<scroll-view scroll-y style="max-height: 90vh;">
<!-- 滚动内容 -->
<!-- 文本 -->
<view class="pop-content" v-for="item,index in popList.text" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入" border="surround" v-model="formData1.text[index].value"
@change="change1(item.title,index)"></up-input>
</view>
</view>
<!-- 下拉 -->
<view class="pop-content" v-for="item,index in popList.select" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="点击选择" @change="change2(item.title,index)" border="surround"
v-model="formData1.select[index].value" @tap="choseSelect(item,index)"></up-input>
</view>
</view>
<!-- 图片 -->
<view class="pop-content" v-for="item,index in popList.pic" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li" @click="updateImgFn(item.title,index)">
<view v-if="formData1.pic[index]?.value">
<u--image :src="formData1.pic[index]?.value" width="100%" height="196.26rpx"></u--image>
</view>
<view class="code-img" v-else>
<view class="carime-icon">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<!-- 搜素 -->
<view class="pop-content" v-for="item,index in popList.serch" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData1.serch[index].value"
@change="change4(item.title,index)"></up-input>
</view>
<view style="margin-bottom: 20rpx;" v-for="(item,index) in serchList" :key="item">
<u-swipe-action>
<u-swipe-action-item :options="options1"
style="border-radius: 20rpx;border: 1px solid #C7C6CD;"
@click="swipeDel(indexs,index)">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: {{item.animal_code}}
</view>
<view class="" style="color: #00A15E;" v-if="item.animal_status==1">
健康
</view>
<view class="" style="color: #FFD736;" v-if="item.animal_status==2">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==3">
可出栏
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==5">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:{{item.animal_kind}}
</view>
<view class="">
年龄: {{item.animal_age}}个月
</view>
<view class="">
体重: {{item.animal_weight}}kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</scroll-view>
</u-popup>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn" @close="showPicker=false"
@cancel="showModal=false"></u-picker>
<u-modal :show="showModal" :showCancelButton='true' :closeOnClickOverlay="true" @close="showModal=false"
content='确认删除吗?' @confirm="delFn" @cancel="showModal=false"></u-modal>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import farmersCard from "@/components/animal/farmersCard.vue"
import {
actionsListAPI,
actionsDetailAPI,
addLandCropRecordAPI,
landCropRecordListAPI,
delLandCropRecordAPI,
ediLandCropRecordAPI,
animalSearchByCodeAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
addFishRecordAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
const serchList = reactive([])
const actionList = reactive([])
const options1 = reactive([{
text: '删除'
}])
const showPicker = ref(false)
const columns = reactive([
['中国', '美国', '日本']
], )
const confirmFn = (e) => {
showPicker.value = false
formData1.select[selectIndex.value].value = e.value[0]
}
const crop_id = ref(0)
const land_id = ref(0)
const type = ref(0)
const actionData = reactive({})
const delIndex = ref(0)
const title = ref('')
onLoad((options) => {
type.value = options.type
title.value = options.title
getAcyionListFn(options.type)
})
const getAcyionListFn = (type) => {
actionList.splice(0, actionList.length)
actionsListAPI({
type: type,
}).then(res => {
for (let key in res.data) {
if (key == title.value) {
actionData[key] = res.data[key]
actionData[key].action_record.forEach(item => {
item.action_content = JSON.parse(item.action_content)
})
actionList.push(...(res.data[key].action_record))
}
}
console.log(actionList)
})
}
const showPop = ref(false)
const baseData = reactive({
text: {
value: "",
tit: ""
},
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData = reactive({
text: [{
value: "",
tit: ""
}],
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData1 = reactive({
text: [],
select: [],
pic: [],
serch: []
})
// ,true,false
const actionType = ref(false)
const confirm = () => {
showPop.value = false
if (actionType.value) {
addLandCropRecordAPI({
user_id: 307,
action_id: action_id.value,
action_content: JSON.stringify(formData1)
}).then(res => {
setPropertiesToNull(formData1)
})
} else {
ediLandCropRecordAPI({
record_id: delIndex.value,
action_content: JSON.stringify(formData1)
})
}
objClear(popList)
getAcyionListFn(type.value)
serchList.splice(0, serchList.length)
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const del = (index) => {
showModal.value = true
delIndex.value = index
}
const showModal = ref(false)
const delFn = () => {
showModal.value = false
delLandCropRecordAPI({
record_id: delIndex.value
}).then(res => {
getAcyionListFn(type.value)
})
}
const editFn = (item) => {
delIndex.value = item.id
showPopFn(item.action_id)
formData1 = reactive(deepCopy(item.action_content))
if (item.action_content.serch[0]?.list?.length) {
item.action_content.serch.forEach(item => {
item.list.forEach(items => {
animalSearchByCodeAPI({
code: items
}).then(res => {
serchList.push(res.data)
})
})
})
}
console.log(serchList)
actionType.value = false
}
const popList = reactive({
text: [],
serch: [],
select: [],
pic: []
})
const action_id = ref("")
const showPopFn = (id) => {
actionType.value = true
// popList,
objClear(formData1)
objClear(popList)
action_id.value = id
actionsDetailAPI({
action_id: id
}).then(res => {
res.data.forEach(item => {
if (item.type == 1) {
formData1.text.push({
tit: "",
value: ""
})
popList.text.push(item)
}
if (item.type == 2) {
formData1.pic.push({
tit: "",
value: ""
})
popList.pic.push(item)
}
if (item.type == 4) {
formData1.select.push({
tit: "",
value: ""
})
popList.select.push(item)
}
if (item.type == 3) {
formData1.serch.push({
value: "",
tit: "",
list: [],
})
popList.serch.push(item)
}
if (item.type == 4) {
}
})
showPop.value = true
})
}
const updateImgFn = (tit, index) => {
change3(tit, index)
uplodeImg().then(res => {
formData1.pic[index].value = res.data.image
})
}
const previewImage = (src) => {
uni.previewImage({
urls: [src],
})
}
const selectIndex = ref('')
const choseSelect = (item, index) => {
formData1.select[index].tit = item.title
selectIndex.value = index
columns[0] = item.options.split(',')
showPicker.value = true
}
const change1 = (tit, index) => {
formData1.text[index].tit = tit
}
const change2 = (tit) => {
formData.select.tit = tit
}
const change3 = (tit, index) => {
formData1.pic[index].tit = tit
}
const change4 = (tit, index) => {
formData1.serch[index].tit = tit
if (formData1.serch[index].value) {
animalSearchByCodeAPI({
code: formData1.serch[index].value
}).then(res => {
if (res.data.id) {
serchList.push(res.data)
formData1.serch[index].list.push(formData1.serch[index].value)
}
formData1.serch[index].value = ''
})
}
}
function deepCopy(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var newObj = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
newObj[key] = deepCopy(obj[key]);
}
}
return newObj;
}
const objFn = (res, data) => {
for (let key in res) {
if (typeof res[key] === 'object') {
objFn(res[key], data[key]);
} else {
data[key] = res[key]
}
}
}
const setPropertiesToNull = (obj) => {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (typeof obj[prop] === 'object') {
setPropertiesToNull(obj[prop]);
} else {
obj[prop] = null;
}
}
}
}
const objClear = (obj) => {
for (let key in obj) {
obj[key].splice(0, obj[key].length)
}
}
const popCloseFn = () => {
showPop.value = false
serchList.splice(0, serchList.length)
objClear(popList)
objClear(formData1)
}
const swipeDel = (e, index) => {
serchList.splice(e, 1);
formData1.serch[index].list.splice(e, 1)
}
const finshFn = () => {
uni.navigateTo({
url: "/pages/index/index"
})
}
</script>
<style lang="scss" scoped>
.cont {
padding-top: 30rpx;
background-color: #F4F4F4;
min-height: 100vh;
}
.card {
.tit {
display: flex;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
}
}
.operate {
width: 693.93rpx;
margin: auto;
.tit {
margin: 20rpx 0;
}
.card {
display: flex;
flex-wrap: wrap;
.operate-li {
font-size: 29.79rpx;
padding: 0 60rpx;
background-color: #F4F4F4;
margin-bottom: 28rpx;
height: 63.08rpx;
line-height: 63rpx;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
}
}
.ripe-btn {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.fertilize {
.fertilize-tit {
display: flex;
// justify-self: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #F4F4F4;
margin-bottom: 20rpx;
.fertilize-tit-r {
display: flex;
}
}
.fertilize-li {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
flex-wrap: wrap;
.fertilize-li-a {
margin-bottom: 20rpx;
min-width: 40vw;
}
}
}
.pop-content {
padding: 20rpx;
padding-bottom: 0;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
// margin-bottom: 40rpx;
}
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
margin: 0 auto;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
.popupShow {
// overflow: hidden;
position: fixed;
left: 30rpx;
}
</style>

View File

@ -1,649 +0,0 @@
<template>
<view :class="{popupShow:showPop}">
<view class="cont">
<!-- <landInfo :land_id='land_id'></landInfo> -->
<pondCard :id='pond_id'></pondCard>
<view class="operate" v-for="(item,index) in actionData" :key="index" v-show="title==index">
<view class="tit">
{{index}}
</view>
<view class="card">
<view class="operate-li" style="margin: 20rpx 0;margin-right: 20rpx;" @click="showPopFn(items.id)"
v-for="items,indexs in item.actions" :key='indexs'>
{{items.name}}
</view>
</view>
</view>
<view class="fertilize" v-for="(item,index) in actionList" :key="index">
<view class="card" style="padding-bottom: 0;">
<view class="fertilize-tit">
<view class="">
{{item.action_name}}
</view>
<view class="fertilize-tit-r">
<view class="" style="color: red;" @tap="del(item.id)">
删除
</view>
<view style="margin-left: 40rpx;color: #00A15E;" @tap='editFn(item)'>
编辑
</view>
</view>
</view>
<view class="fertilize-li">
<view class="fertilize-li-a" v-for="(items,indexs) in item.action_content" :key="indexs"
v-show="items[0]?.tit">
<view class="" v-for="item2 in items" :key="item2" v-show="item2.tit">
<view class="" v-if="indexs=='text'||indexs=='select'">
{{item2.tit}}: {{item2.value}}
</view>
<view v-if="indexs=='pic'">
{{item2.tit}}: <text style="color: #3274F9;"
@click="previewImage(item2.value)">图片</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="" style="height: 100px">
</view>
</view>
<view class="ripe-btn" @click="finshFn">
完成今日操作
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="popCloseFn" @open="showPop=true">
<scroll-view scroll-y style="max-height: 90vh;">
<!-- 滚动内容 -->
<!-- 文本 -->
<view class="pop-content" v-for="item,index in popList.text" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入" border="surround" v-model="formData1.text[index].value"
@change="change1(item.title,index)"></up-input>
</view>
</view>
<!-- 下拉 -->
<view class="pop-content" v-for="item,index in popList.select" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="点击选择" @change="change2(item.title,index)" border="surround"
v-model="formData1.select[index].value" @tap="choseSelect(item,index)"></up-input>
</view>
</view>
<!-- 图片 -->
<view class="pop-content" v-for="item,index in popList.pic" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li" @click="updateImgFn(item.title,index)">
<view v-if="formData1.pic[index]?.value">
<u--image :src="formData1.pic[index]?.value" width="100%" height="196.26rpx"></u--image>
</view>
<view class="code-img" v-else>
<view class="carime-icon">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<!-- 搜素 -->
<view class="pop-content" v-for="item,index in popList.serch" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData1.serch[index].value"
@change="change4(item.title,index)"></up-input>
</view>
<view style="margin-bottom: 20rpx;" v-for="(item,index) in serchList" :key="item">
<u-swipe-action>
<u-swipe-action-item :options="options1"
style="border-radius: 20rpx;border: 1px solid #C7C6CD;" @click="swipeDel(index)">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: {{item.animal_code}}
</view>
<view class="" style="color: #00A15E;" v-if="item.animal_status==1">
健康
</view>
<view class="" style="color: #FFD736;" v-if="item.animal_status==2">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==3">
可出栏
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==5">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:{{item.animal_kind}}
</view>
<view class="">
年龄: {{item.animal_age}}个月
</view>
<view class="">
体重: {{item.animal_weight}}kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</scroll-view>
</u-popup>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn" @close="showPicker=false"
@cancel="showModal=false"></u-picker>
<u-modal :show="showModal" :showCancelButton='true' :closeOnClickOverlay="true" @close="showModal=false"
content='确认删除吗?' @confirm="delFn" @cancel="showModal=false"></u-modal>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
// import landInfo from "@/components/plant/landInfo.vue"
import pondCard from "@/components/aquatic/pondCard.vue"
import {
actionsListAPI,
actionsDetailAPI,
addLandCropRecordAPI,
landCropRecordListAPI,
delLandCropRecordAPI,
ediLandCropRecordAPI
} from "@/api/aquatic.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
addFishRecordAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
const serchList = reactive([])
const actionList = reactive([])
const options1 = reactive([{
text: '删除'
}])
const showPicker = ref(false)
const columns = reactive([
['中国', '美国', '日本']
], )
const confirmFn = (e) => {
showPicker.value = false
formData1.select[selectIndex.value].value = e.value[0]
}
const pond_id = ref(0)
const type = ref(0)
const title = ref('')
const actionData = reactive({})
const delIndex = ref(0)
onLoad((options) => {
pond_id.value = options.pond_id
title.value = options.title
getAcyionListFn()
})
const getAcyionListFn = (type) => {
actionList.splice(0, actionList.length)
actionsListAPI({
type: 4,
pond_id: pond_id.value
}).then(res => {
for (let key in res.data) {
if (key == title.value) {
actionData[key] = res.data[key]
actionData[key].action_record.forEach(item => {
item.action_content = JSON.parse(item.action_content)
})
actionList.push(...(res.data[key].action_record))
}
}
})
}
const showPop = ref(false)
const baseData = reactive({
text: {
value: "",
tit: ""
},
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData = reactive({
text: [{
value: "",
tit: ""
}],
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData1 = reactive({
text: [],
select: [],
pic: [],
serch: []
})
// ,true,false
const actionType = ref(false)
const confirm = () => {
showPop.value = false
if (actionType.value) {
console.log(544)
addLandCropRecordAPI({
pond_id: Number(pond_id.value),
action_id: action_id.value,
action_content: JSON.stringify(formData1)
}).then(res => {
setPropertiesToNull(formData1)
})
} else {
ediLandCropRecordAPI({
record_id: delIndex.value,
action_content: JSON.stringify(formData1)
})
}
objClear(popList)
getAcyionListFn(type.value)
serchList.splice(0, serchList.length)
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const del = (index) => {
showModal.value = true
delIndex.value = index
}
const showModal = ref(false)
const delFn = () => {
showModal.value = false
delLandCropRecordAPI({
record_id: delIndex.value
}).then(res => {
getAcyionListFn(type.value)
})
}
const editFn = (item) => {
delIndex.value = item.id
showPopFn(item.action_id)
formData1 = reactive(deepCopy(item.action_content))
if (item.action_content.serch?.list?.length) {
item.action_content.serch.list.forEach(item => {
animalSearchByCodeAPI({
code: item
}).then(res => {
serchList.push(res.data)
})
})
}
actionType.value = false
}
const popList = reactive({
text: [],
serch: [],
select: [],
pic: []
})
const action_id = ref("")
const showPopFn = (id) => {
actionType.value = true
// popList,
objClear(formData1)
objClear(popList)
action_id.value = id
actionsDetailAPI({
action_id: id
}).then(res => {
res.data.forEach(item => {
if (item.type == 1) {
formData1.text.push({
tit: "",
value: ""
})
popList.text.push(item)
}
if (item.type == 2) {
formData1.pic.push({
tit: "",
value: ""
})
popList.pic.push(item)
}
if (item.type == 4) {
formData1.select.push({
tit: "",
value: ""
})
popList.select.push(item)
}
if (item.type == 3) {
formData1.serch.push({
value: "",
tit: "",
list: [],
})
popList.serch.push(item)
}
if (item.type == 4) {
}
})
showPop.value = true
})
}
const updateImgFn = (tit, index) => {
change3(tit, index)
uplodeImg().then(res => {
formData1.pic[index].value = res.data.image
})
}
const previewImage = (src) => {
uni.previewImage({
urls: [src],
})
}
const selectIndex = ref('')
const choseSelect = (item, index) => {
formData1.select[index].tit = item.title
selectIndex.value = index
columns[0] = item.options.split(',')
showPicker.value = true
}
const change1 = (tit, index) => {
formData1.text[index].tit = tit
}
const change2 = (tit) => {
formData.select.tit = tit
}
const change3 = (tit, index) => {
formData1.pic[index].tit = tit
}
const change4 = (tit) => {
formData.serch.tit = tit
if (formData.serch.value) {
animalSearchByCodeAPI({
code: formData.serch.value
}).then(res => {
if (res.data.id) {
serchList.push(res.data)
console.log(formData.serch, 54554)
formData.serch.list.push(formData.serch.value)
}
formData.serch.value = ''
})
}
}
function deepCopy(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var newObj = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
newObj[key] = deepCopy(obj[key]);
}
}
return newObj;
}
const objFn = (res, data) => {
for (let key in res) {
if (typeof res[key] === 'object') {
objFn(res[key], data[key]);
} else {
data[key] = res[key]
}
}
}
const setPropertiesToNull = (obj) => {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (typeof obj[prop] === 'object') {
setPropertiesToNull(obj[prop]);
} else {
obj[prop] = null;
}
}
}
}
const objClear = (obj) => {
for (let key in obj) {
obj[key].splice(0, obj[key].length)
}
}
const popCloseFn = () => {
showPop.value = false
serchList.splice(0, serchList.length)
objClear(popList)
objClear(formData1)
// setPropertiesToNull(formData)
}
const swipeDel = (e) => {
serchList.splice(e, 1);
formData1.serch.list.splice(e, 1)
}
const finshFn = () => {
uni.navigateTo({
url: "/pages/index/index"
})
}
</script>
<style lang="scss" scoped>
.cont {
padding-top: 30rpx;
background-color: #F4F4F4;
min-height: 100vh;
}
.card {
.tit {
display: flex;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
}
}
.operate {
width: 693.93rpx;
margin: auto;
.tit {
margin: 20rpx 0;
}
.card {
display: flex;
flex-wrap: wrap;
.operate-li {
font-size: 29.79rpx;
padding: 0 60rpx;
background-color: #F4F4F4;
margin-bottom: 28rpx;
height: 63.08rpx;
line-height: 63rpx;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
}
}
.ripe-btn {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.fertilize {
.fertilize-tit {
display: flex;
// justify-self: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #F4F4F4;
margin-bottom: 20rpx;
.fertilize-tit-r {
display: flex;
}
}
.fertilize-li {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
flex-wrap: wrap;
.fertilize-li-a {
margin-bottom: 20rpx;
min-width: 40vw;
}
}
}
.pop-content {
padding: 20rpx;
padding-bottom: 0;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
// margin-bottom: 40rpx;
}
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
margin: 0 auto;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
.popupShow {
// overflow: hidden;
position: fixed;
left: 30rpx;
}
</style>

View File

@ -1,652 +0,0 @@
<template>
<view :class="{popupShow:showPop}">
<view class="cont">
<landInfo :land_id='land_id'></landInfo>
<view class="operate" v-for="(item,index) in actionData" :key="index" v-show="title==index">
<view class="tit">
{{index}}
</view>
<view class="card">
<view class="operate-li" style="margin: 20rpx 0;margin-right: 20rpx;" @click="showPopFn(items.id)"
v-for="items,indexs in item.actions" :key='indexs'>
{{items.name}}
</view>
</view>
</view>
<!-- {{actionList}} -->
<view class="fertilize" v-for="(item,index) in actionList" :key="index">
<!-- {{actionList}} -->
<view class="card" style="padding-bottom: 0;">
<view class="fertilize-tit">
<view class="">
{{item.action_name}}
</view>
<view class="fertilize-tit-r">
<view class="" style="color: red;" @tap="del(item.id)">
删除
</view>
<view style="margin-left: 40rpx;color: #00A15E;" @tap='editFn(item)'>
编辑
</view>
</view>
</view>
<view class="fertilize-li">
<view class="fertilize-li-a" v-for="(items,indexs) in item.action_content" :key="indexs"
v-show="items[0]?.tit">
<!-- {{indexs}} -->
<view class="" v-for="item2 in items" :key="item2" v-show="item2.tit">
<view class="" v-if="indexs=='text'||indexs=='select'">
{{item2.tit}}: {{item2.value}}
</view>
<view v-if="indexs=='pic'">
{{item2.tit}}: <text style="color: #3274F9;"
@click="previewImage(item2.value)">图片</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="" style="height: 100px">
</view>
</view>
<view class="ripe-btn" @click="finshFn">
完成今日操作
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="popCloseFn" @open="showPop=true">
<scroll-view scroll-y style="max-height: 90vh;">
<!-- 滚动内容 -->
<!-- 文本 -->
<view class="pop-content" v-for="item,index in popList.text" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入" border="surround" v-model="formData1.text[index].value"
@change="change1(item.title,index)"></up-input>
</view>
</view>
<!-- 下拉 -->
<view class="pop-content" v-for="item,index in popList.select" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="点击选择" @change="change2(item.title,index)" border="surround"
v-model="formData1.select[index].value" @tap="choseSelect(item,index)"></up-input>
</view>
</view>
<!-- 图片 -->
<view class="pop-content" v-for="item,index in popList.pic" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li" @click="updateImgFn(item.title,index)">
<view v-if="formData1.pic[index]?.value">
<u--image :src="formData1.pic[index]?.value" width="100%" height="196.26rpx"></u--image>
</view>
<view class="code-img" v-else>
<view class="carime-icon">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<!-- 搜素 -->
<view class="pop-content" v-for="item,index in popList.serch" :key='index'>
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData1.serch[index].value"
@change="change4(item.title,index)"></up-input>
</view>
<view style="margin-bottom: 20rpx;" v-for="(item,index) in serchList" :key="item">
<u-swipe-action>
<u-swipe-action-item :options="options1"
style="border-radius: 20rpx;border: 1px solid #C7C6CD;" @click="swipeDel(index)">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: {{item.animal_code}}
</view>
<view class="" style="color: #00A15E;" v-if="item.animal_status==1">
健康
</view>
<view class="" style="color: #FFD736;" v-if="item.animal_status==2">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==3">
可出栏
</view>
<view class="" style="color: #3274F9;" v-if="item.animal_status==5">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:{{item.animal_kind}}
</view>
<view class="">
年龄: {{item.animal_age}}个月
</view>
<view class="">
体重: {{item.animal_weight}}kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</scroll-view>
</u-popup>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn" @close="showPicker=false"
@cancel="showModal=false"></u-picker>
<u-modal :show="showModal" :showCancelButton='true' :closeOnClickOverlay="true" @close="showModal=false"
content='确认删除吗?' @confirm="delFn" @cancel="showModal=false"></u-modal>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import landInfo from "@/components/plant/landInfo.vue"
import {
actionsListAPI,
actionsDetailAPI,
addLandCropRecordAPI,
landCropRecordListAPI,
delLandCropRecordAPI,
ediLandCropRecordAPI
} from "@/api/plant.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
addFishRecordAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
const serchList = reactive([])
const actionList = reactive([])
const options1 = reactive([{
text: '删除'
}])
const showPicker = ref(false)
const columns = reactive([
['中国', '美国', '日本']
], )
const confirmFn = (e) => {
showPicker.value = false
formData1.select[selectIndex.value].value = e.value[0]
}
const crop_id = ref(0)
const land_id = ref(0)
const type = ref(0)
const actionData = reactive({})
const delIndex = ref(0)
const title = ref('')
onLoad((options) => {
title.value = options.title
land_id.value = options.land_id
crop_id.value = options.crop_id
getAcyionListFn()
})
const getAcyionListFn = (type) => {
actionList.splice(0, actionList.length)
actionsListAPI({
type: 1,
crop_id: crop_id.value
}).then(res => {
for (let key in res.data) {
if (key == title.value) {
actionData[key] = res.data[key]
actionData[key].action_record.forEach(item => {
item.action_content = JSON.parse(item.action_content)
})
actionList.push(...(res.data[key].action_record))
}
}
console.log(actionList)
})
}
const showPop = ref(false)
const baseData = reactive({
text: {
value: "",
tit: ""
},
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData = reactive({
text: [{
value: "",
tit: ""
}],
select: {
value: "",
tit: ""
},
pic: {
value: "",
tit: ""
},
serch: {
value: "",
tit: "",
list: [],
},
})
let formData1 = reactive({
text: [],
select: [],
pic: [],
serch: []
})
// ,true,false
const actionType = ref(false)
const confirm = () => {
showPop.value = false
if (actionType.value) {
addLandCropRecordAPI({
crop_id: Number(crop_id.value),
action_id: action_id.value,
action_content: JSON.stringify(formData1)
}).then(res => {
setPropertiesToNull(formData1)
})
} else {
ediLandCropRecordAPI({
record_id: delIndex.value,
action_content: JSON.stringify(formData1)
})
}
objClear(popList)
getAcyionListFn(type.value)
serchList.splice(0, serchList.length)
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const del = (index) => {
showModal.value = true
delIndex.value = index
}
const showModal = ref(false)
const delFn = () => {
showModal.value = false
delLandCropRecordAPI({
record_id: delIndex.value
}).then(res => {
getAcyionListFn(type.value)
})
}
const editFn = (item) => {
delIndex.value = item.id
showPopFn(item.action_id)
formData1 = reactive(deepCopy(item.action_content))
if (item.action_content.serch?.list?.length) {
item.action_content.serch.list.forEach(item => {
animalSearchByCodeAPI({
code: item
}).then(res => {
serchList.push(res.data)
})
})
}
actionType.value = false
}
const popList = reactive({
text: [],
serch: [],
select: [],
pic: []
})
const action_id = ref("")
const showPopFn = (id) => {
actionType.value = true
// popList,
objClear(formData1)
objClear(popList)
action_id.value = id
actionsDetailAPI({
action_id: id
}).then(res => {
res.data.forEach(item => {
if (item.type == 1) {
formData1.text.push({
tit: "",
value: ""
})
popList.text.push(item)
}
if (item.type == 2) {
formData1.pic.push({
tit: "",
value: ""
})
popList.pic.push(item)
}
if (item.type == 4) {
formData1.select.push({
tit: "",
value: ""
})
popList.select.push(item)
}
if (item.type == 3) {
formData1.serch.push({
value: "",
tit: "",
list: [],
})
popList.serch.push(item)
}
if (item.type == 4) {
}
})
showPop.value = true
})
}
const updateImgFn = (tit, index) => {
change3(tit, index)
uplodeImg().then(res => {
formData1.pic[index].value = res.data.image
})
}
const previewImage = (src) => {
uni.previewImage({
urls: [src],
})
}
const selectIndex = ref('')
const choseSelect = (item, index) => {
formData1.select[index].tit = item.title
selectIndex.value = index
columns[0] = item.options.split(',')
showPicker.value = true
}
const change1 = (tit, index) => {
formData1.text[index].tit = tit
}
const change2 = (tit) => {
formData.select.tit = tit
}
const change3 = (tit, index) => {
formData1.pic[index].tit = tit
}
const change4 = (tit) => {
formData.serch.tit = tit
if (formData.serch.value) {
animalSearchByCodeAPI({
code: formData.serch.value
}).then(res => {
if (res.data.id) {
serchList.push(res.data)
console.log(formData.serch, 54554)
formData.serch.list.push(formData.serch.value)
}
formData.serch.value = ''
})
}
}
function deepCopy(obj) {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
var newObj = Array.isArray(obj) ? [] : {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
newObj[key] = deepCopy(obj[key]);
}
}
return newObj;
}
const objFn = (res, data) => {
for (let key in res) {
if (typeof res[key] === 'object') {
objFn(res[key], data[key]);
} else {
data[key] = res[key]
}
}
}
const setPropertiesToNull = (obj) => {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (typeof obj[prop] === 'object') {
setPropertiesToNull(obj[prop]);
} else {
obj[prop] = null;
}
}
}
}
const objClear = (obj) => {
for (let key in obj) {
obj[key].splice(0, obj[key].length)
}
}
const popCloseFn = () => {
showPop.value = false
serchList.splice(0, serchList.length)
objClear(popList)
objClear(formData1)
// setPropertiesToNull(formData)
}
const swipeDel = (e) => {
serchList.splice(e, 1);
formData1.serch.list.splice(e, 1)
}
const finshFn = () => {
uni.navigateTo({
url: "/pages/index/index"
})
}
</script>
<style lang="scss" scoped>
.cont {
padding-top: 30rpx;
background-color: #F4F4F4;
min-height: 100vh;
}
.card {
.tit {
display: flex;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
}
}
.operate {
width: 693.93rpx;
margin: auto;
.tit {
margin: 20rpx 0;
}
.card {
display: flex;
flex-wrap: wrap;
.operate-li {
font-size: 29.79rpx;
padding: 0 60rpx;
background-color: #F4F4F4;
margin-bottom: 28rpx;
height: 63.08rpx;
line-height: 63rpx;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
}
}
.ripe-btn {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.fertilize {
.fertilize-tit {
display: flex;
// justify-self: center;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #F4F4F4;
margin-bottom: 20rpx;
.fertilize-tit-r {
display: flex;
}
}
.fertilize-li {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
flex-wrap: wrap;
.fertilize-li-a {
margin-bottom: 20rpx;
min-width: 40vw;
}
}
}
.pop-content {
padding: 20rpx;
padding-bottom: 0;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
// margin-bottom: 40rpx;
}
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
margin: 0 auto;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
.popupShow {
// overflow: hidden;
position: fixed;
left: 30rpx;
}
</style>

View File

@ -0,0 +1,231 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="药剂种类" prop="formData.breed" borderBottom ref='item1' required>
<up-input placeholder="请输入药剂种类" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="药剂品牌" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入药剂品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="药剂用量" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入药剂用量" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="开始日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" border="surround" @blur="openDate" :disabled="mode=='detail'"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" border="surround" @blur="openDate" :disabled="mode=='detail'"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" border="surround" :disabled="mode=='detail'"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业面积" type="number" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" type="number" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
防治图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea v-model="formData.breed" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
</view>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const calendar = ref(null)
const form = ref(null)
const openDate = () => {
calendar.value.open()
}
// console.log()
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -0,0 +1,230 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="肥料种类" prop="formData.breed" borderBottom ref='item1' required>
<up-input placeholder="请输入肥料种类" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="肥料品牌" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入肥料品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="肥料用量" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入肥料用量" border="surround" :disabled="mode=='detail'"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="开始日期" @click="openDate" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
施肥图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea v-model="formData.breed" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
</view>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const calendar = ref(null)
const form = ref(null)
const openDate = () => {
calendar.value.open()
}
// console.log()
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -0,0 +1,201 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
收获图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea :disabled="mode=='detail'" v-model="formData.breed" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const form = ref(null)
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -0,0 +1,236 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="灌溉方式" prop="formData.breed" borderBottom ref='item1' required>
<uni-data-select v-model="formData.breed" :disabled="mode=='detail'"
:localdata="range"></uni-data-select>
</u-form-item>
<u-form-item label="开始日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" type="number" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
灌溉图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea v-model="formData.breed" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
</view>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const range = reactive([{
value: 0,
text: "喷灌"
},
{
value: 1,
text: "滴灌"
},
{
value: 2,
text: "沟灌"
},
])
const calendar = ref(null)
const form = ref(null)
const openDate = () => {
calendar.value.open()
}
// console.log()
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

223
pages/husbandryForm/sow.vue Normal file
View File

@ -0,0 +1,223 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="种植种类" prop="formData.breed" borderBottom ref='item1' required>
<up-input placeholder="请输入种植种类" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="种植品种" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入品种" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="开始日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="种植面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入种植面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
种植图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea v-model="formData.breed" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
</view>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const calendar = ref(null)
const form = ref(null)
const openDate = () => {
calendar.value.open()
}
// console.log()
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -0,0 +1,230 @@
<template>
<!-- 播种 -->
<view class="content">
<view class="card">
<u--form labelPosition="top" labelWidth='100' :model="formData" :rules="rules" ref="form">
<u-form-item label="除草剂种类" prop="formData.breed" borderBottom ref='item1' required>
<up-input placeholder="请输入除草剂种类" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="除草剂品牌" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入除草剂品牌" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="除草剂用量" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入除草剂用量" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="开始日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="结束日期" prop="formData.breed" borderBottom required>
<up-input placeholder="请选择日期" @blur="openDate" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业地块" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业地块" :disabled="mode=='detail'" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="作业面积" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入作业面积" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<u-form-item label="参与人" prop="formData.breed" borderBottom required>
<up-input placeholder="请输入参与人" :disabled="mode=='detail'" type="number" border="surround"
v-model="formData.breed"></up-input>
</u-form-item>
<view class="card-li">
<view class="card-li-tit">
除草图片
</view>
<view class="code-img">
<view class="" @click="updateImgFn">
<view class="" v-if="formData.buy_cert">
<u--image :src="formData.buy_cert" width="637.85rpx" height="350.47rpx"></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
</view>
<u-form-item label="备注" prop="formData.breed" borderBottom required>
<u--textarea v-model="formData.breed" :disabled="mode=='detail'" placeholder="请输入内容"></u--textarea>
</u-form-item>
</u--form>
<view>
<uni-calendar ref="calendar" :showMonth="true" :lunar="true" :insert="false" @confirm="dateConfirmfn" />
</view>
</view>
<view class="confirm" v-if="mode=='add'">
<view class="confirm-btn" style="color: white;background-color: #0AA565;" @click="addFn">
完成添加
</view>
</view>
</view>
</template>
<script setup>
import {
addFishAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
import {
reactive,
ref
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app"
const calendar = ref(null)
const form = ref(null)
const openDate = () => {
calendar.value.open()
}
// console.log()
const formData = reactive({
breed: ""
})
const dateConfirmfn = (e) => {
console.log(e)
}
const rules = {
'formData.breed': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const addFn = () => {
form.value.validate().then(res => {
console.log(6)
}).catch(errors => {
uni.$u.toast('校验失败')
})
console.log()
return
this.$refs.uForm.validate().then(res => {
uni.$u.toast('校验通过')
}).catch(errors => {
uni.$u.toast('校验失败')
})
navgo('/pages/index/index')
}
const updateImgFn = async () => {
if (mode.value == 'detail') return
let res = await uplodeImg()
formData.buy_cert = res.data.image
}
const mode = ref('add')
onLoad((options) => {
if (options.task_id) {
mode.value = "detail"
}
})
</script>
<style lang='scss' scoped>
.content {
padding-bottom: 100rpx;
}
.tit {
display: flex;
justify-content: space-between;
}
.card-li-tit {
margin-bottom: 20rpx;
}
.confim-btn {
margin: 0 auto;
width: 196.26rpx;
height: 66.59rpx;
/* border: ; */
border: #00A15E 1px solid;
color: #00A15E;
display: flex;
align-items: center;
justify-content: center;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
}
.up-img {
width: 341.71rpx
}
.today-btn {
width: 588.79rpx;
background-color: #00A15E;
color: white;
position: fixed;
bottom: 40rpx;
/* transform: ; */
left: 50%;
transform: translateX(-50%);
background: linear-gradient(to right, #00A15E, #4CC593);
/* margin: 0 auto; */
}
.code-img {
background-color: #F4F4F4;
height: 350.47rpx;
position: relative;
/* margin-bottom: 100rpx; */
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.confirm {
position: fixed;
height: 84.11rpx;
display: flex;
bottom: 30rpx;
width: 750rpx;
.confirm-btn {
width: 315.42rpx;
height: 84.11rpx;
border: #00A15E 1px solid;
margin: 0 auto;
border-radius: 80rpx;
text-align: center;
line-height: 84rpx;
}
}
</style>

View File

@ -1,13 +1,24 @@
<template>
<view class="" style="position: relative;">
<view class="top">
<view class="" style="height: 100rpx;">
<view class="" style="height:var(--status-bar-height) ;">
</view>
<view class="nav">
<view class="">
<u-icon name="scan" color="white" :size="30"></u-icon>
</view>
<view class="" style="margin-left: 20rpx;">
<u-icon name="plus-circle" color="white" :size="28"></u-icon>
</view>
</view>
</view>
<view class="" style="height: 100rpx;">
<view class="">
<view class="" style="height:var(--status-bar-height) ;">
</view>
<view class="nav">
</view>
</view>
<view class="content" v-if="false">
<view class="content" v-if="true">
<!-- 土地信息 -->
<view class="">
<view class="card">
@ -41,7 +52,7 @@
</view>
</view>
</view>
<view class="video">
<view class="video" @click="navto('/pages/live/live')">
<u--image :src="url" width="100%" height="300rpx"></u--image>
</view>
</view>
@ -270,8 +281,18 @@
background-color: #34D190;
position: fixed;
z-index: 999999;
height: 100rpx;
width: 750rpx;
}
.nav {
height: 70rpx;
display: flex;
justify-content: flex-end;
box-sizing: border-box;
align-items: center;
padding-right: 40rpx;
}
.card {

View File

@ -8,31 +8,15 @@
<u-search bgColor="white" :show-action="false" placeholder="搜索你的土地信息" v-model="keyword"
shape="round"></u-search>
</view>
<!-- <view class="card">
<view class="card-li">
农户名称: 张伟
</view>
<view class="card-li">
种养殖类型: 种植户
</view>
<view class="card-li">
土地面积: 20
</view>
<view class="card-li">
地址: 四川省巴中市恩阳区
</view>
</view> -->
<view class="card" v-for="(item,index) in [1,1,1]" :key="index"
@click="navgoFn(item.is_cropped,item.land_id)">
<view class="card" v-for="(item,index) in [1,1,1]" :key="index" @click="navgo('/pages/landDetail/index')">
<view class="tit card-li">
<view class="">
土地名称
</view>
<view class="" style="color: #00A15E;" v-if="item.is_cropped">
<view class="" style="color: #00A15E;">
已种植
</view>
<view class="" style="color: #00A15E;" v-else>
<view class="" style="color: #00A15E;">
未种植
</view>
</view>
@ -41,22 +25,12 @@
面积: 20
</view>
</view>
<view class="card-li tit" v-if="item.crop_name">
<view class="card-li tit">
<view class="" style="font-weight: normal;">
农作物: 洋芋
</view>
<view class="" style="color: #FF9B66;" v-if="item.ripe_time">
已成熟
</view>
</view>
<view class="card-li tit" style="font-weight: normal;" v-show="item.crop_yield">
<view class="">
预计产量: 30kg
</view>
<!-- <view class="" v-if="false">
已出售: 500kg
</view> -->
</view>
</view>
<view style="height: 170rpx;">
</view>
@ -97,17 +71,6 @@
url
})
}
const navgoFn = (is_cropped, land_id) => {
if (!is_cropped) {
navgo(`/pages/InformationAdd/index?land_id=${land_id}`)
} else if (is_cropped) {
navgo(`/pages/detail/plant?land_id=${land_id}`)
}
if (is_cropped == 2) {
navgo('/pages/detail/plant')
}
}
</script>
<style lang="scss">

235
pages/landDetail/index.vue Normal file
View File

@ -0,0 +1,235 @@
<template>
<view class="box">
<view class="content">
<view class="video" @click="navto('/pages/live/live')">
<u--image :src="url" width="100%" height="300rpx"></u--image>
</view>
<view class="time">
<u-icon name="clock"></u-icon>
<text>刷新时间: {{getNowTimeFn()}} </text>
</view>
<view class="add-thing" @click="showPicker=true">
记农事
</view>
<landInfo></landInfo>
<view class="">
<view class="tit" style="font-size: 33.29rpx;margin: 20rpx 0;">
历史农事信息
</view>
<view class="thing-card" v-for="(item,index) in dataList" :key="index">
<view class="head">
<view class="">
种植
</view>
<view class="" @click="navtoForm(item.type)">
农事查看
</view>
</view>
<view class="body">
<view class="left">
<u--image @click="perviewFn(url)" radius='10' :src="url" width="200rpx"
height="200rpx"></u--image>
</view>
<view class="right">
<view class="">
土地名称: 张伟撒打算撒旦
</view>
<view class="">
土地名称: 张伟撒打算撒旦
</view>
<view class="">
土地名称: 张伟撒打算撒旦
</view>
<view class="">
土地名称: 张伟撒打算撒旦
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 组件 -->
<view class="">
<u-picker keyName="label" :show="showPicker" @cancel="showPicker=false" @confirm="confirm"
:columns="columns"></u-picker>
</view>
</view>
</template>
<script setup>
import landInfo from "@/components/plant/landInfo.vue"
import {
ref,
reactive
} from "vue"
const dataList = reactive([{
type: '0'
}, {
type: '1'
}, {
type: '2'
}, {
type: '3'
}, {
type: '4'
}, {
type: '5'
},
])
const showPicker = ref(false);
const columns = reactive([
[{
label: '种植',
route: "/pages/husbandryForm/sow"
}, {
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"
},
]
]);
const navto = (url) => {
uni.navigateTo({
url
})
}
const navtoForm = (type) => {
switch (type) {
//
case "0":
navto(`/pages/husbandryForm/sow?task_id=${5}`);
break;
//
case "1":
navto(`/pages/husbandryForm/fertilize?task_id=${5}`);
break;
//
case "2":
navto(`/pages/husbandryForm/weeding?task_id=${5}`);
break;
//
case "3":
navto(`/pages/husbandryForm/irrigate?task_id=${5}`);
break;
//
case "4":
navto(`/pages/husbandryForm/Pest?task_id=${5}`);
break;
//
case "5":
navto(`/pages/husbandryForm/harvest?task_id=${5}`);
break;
}
}
const confirm = (e) => {
showPicker.value = false
uni.navigateTo({
url: e.value[0].route
})
}
const url = ref('https://ceshi-worker-task.lihaink.cn//uploads//images//20231121//202311211336582b7920656.jpg')
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
}
const perviewFn = (url) => {
console.log(url)
uni.previewImage({
urls: [url]
})
}
</script>
<style lang="scss" scoped>
.box {
width: 750rpx;
min-height: 100vh;
background-color: $theme-bg-color;
padding: 0;
.content {
width: 693.93rpx;
margin: auto;
}
// padding: 20rpx;
.time {
display: flex;
font-size: 26.29rpx;
color: #737373;
margin-top: 10rpx;
}
.video {
// margin-top: 10rpx;
}
.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;
}
}
.thing-card {
width: 693.93rpx;
box-sizing: border-box;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 30rpx;
.head {
height: 90rpx;
border-radius: 20rpx 20rpx 0 0;
background-color: $theme-main-color;
display: flex;
justify-content: space-between;
line-height: 90rpx;
color: white;
padding: 0 30rpx;
}
.body {
padding: 20rpx;
display: flex;
// justify-content: space-between;
.right {
display: flex;
justify-content: space-between;
flex-direction: column;
margin-left: 40rpx;
}
}
}
</style>

15
pages/live/live.nvue Normal file
View File

@ -0,0 +1,15 @@
<template>
<div>
监控页面
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -1,164 +0,0 @@
<template>
<view class="content">
<!-- <imgCard></imgCard>
<view class="bad-info">
<view class="" style="display: flex;align-items: center;">
<u--image :src="urlFn('sj')" style="margin: 0 5rpx;" width="28.04rpx" height="28.04rpx"></u--image>
<text>刷新时间:{{dateFn()}}</text>
</view>
<view style="display: flex;" @click="navgo(`/pages/poultry/histroyFeed?id=${id}`)">
查看史条件 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
<view class="card">
<view class="tit">
<view class="">
编号: 52656
</view>
<view class="">
溯源码: 52656
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: 土豆
</view>
<view class="">
年龄: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: 20
</view>
<view class="">
体重: 45kg
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: green;">
健康
</view>
</view>
</view> -->
<detailCard :id='id' :showImg='true'></detailCard>
<view class="">
<view class="" style="margin-bottom: 20rpx;">
饲养记录
</view>
<myTable></myTable>
</view>
</view>
</template>
<script setup>
import myTable from "@/components/myTable/index.vue"
import imgCard from "@/components/imgCard.vue"
import detailCard from "@/components/poultry/detailCard.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
ref
} from "vue"
const urlFn = (name) => {
return `/static/img/${name}.png`
}
const img = (w, h, m) => {
return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
}
const navgo = (url) => {
uni.navigateTo({
url
})
}
const dateFn = () => {
var today = new Date();
//
var year = today.getFullYear();
var month = today.getMonth() + 1; // 01
var day = today.getDate();
//
var dateStr = year + '-' + month + '-' + day;
return dateStr
//
}
const id = ref(0)
onLoad((option) => {
id.value = option.id
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.table {
margin-top: 20rpx;
height: 500rpx;
background-color: red;
}
.bad-info {
display: flex;
// background-color: red;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
color: #737373;
width: 693.93rpx;
font-size: 26.29rpx;
.tit-b {
color: red;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,330 +0,0 @@
<template>
<view class="content">
<view class="head" v-if="addList.length">
已添加{{addList.length}}条家畜
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
养殖品种
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.kind"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
具体品类
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.breed"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
年龄
</view>
<view class="">
<up-input placeholder="请输入年龄" border="surround" v-model="formData.age"></up-input>
</view>
</view>
<view class="card-li">
<view class="select">
养殖类型: <up-input @tap="selectFoucsFn" readonly placeholder="请选择" style="margin-top: 20rpx;"
border="surround" v-model="gender">
</up-input>
<view class="JT" :class="{actJT:selectAct}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct">
<view class="select-li" v-for="(item,index) in selectList" :key="index"
@click="changSelectfn(index)" :style="{color:indexs==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="select">
状态: <up-input placeholder="请选择" style="margin-top: 20rpx;" border="surround" @click="selectFoucsFn1"
v-model="status">
</up-input>
<view class="JT" :class="{actJT:selectAct1}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct1" style="bottom:-250rpx">
<view class="select-li" v-for="(item,index) in selectList1" :key="index"
@click="changSelectfn1(index)" :style="{color:indexs1==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs1==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
体重
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="formData.weight"></up-input>
</view>
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<view class="" v-if="formData.pic">
<u--image :src="formData.pic" width="637.85rpx" height='196.26rpx'></u--image>
</view>
<view class="carime-icon" v-else>
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
上传
</view>
</view>
</view>
</view>
</view>
<view class="next-btn" @click="nextFn">
下一个
</view>
<view class="ripe-btn" @click='navgo'>
完成添加
</view>
</view>
</template>
<script setup>
import {
reactive,
ref
} from "vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
addAnimalAPI,
} from "@/api/chick.js"
const navgo = () => {
if (formData.kind) {
nextFn()
}
uni.navigateTo({
url: "/pages/index/index"
})
}
const updateImgFn = () => {
uplodeImg().then(res => {
formData.pic = res.data.image
})
}
const off = () => {
selectAct.value = false
selectAct1.value = false
}
const selectList = reactive([
"公猪", "母猪"
])
const gender = ref("")
const status = ref("")
const selectList1 = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
])
const value = ref("")
const value1 = ref("")
const selectAct = ref(false)
const selectAct1 = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
selectAct1.value = false
}
const selectFoucsFn1 = (e) => {
selectAct1.value = true
selectAct.value = false
}
const indexs = ref(0)
const indexs1 = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
formData.gender = index + 1
gender.value = selectList[index]
selectAct.value = false
selectAct1.value = false
}
const changSelectfn1 = (index) => {
indexs1.value = index
value1.value = selectList[index]
formData.status = index + 1
status.value = selectList1[index]
selectAct.value = false
selectAct1.value = false
}
const baseFormData = reactive({
user_id: 307,
kind: "",
breed: "",
gender: 1,
age: "",
status: 1,
weight: "",
pic: ""
})
const objFn = (res, obj) => {
for (let key in res) {
obj[key] = res[key]
}
}
const formData = reactive({})
objFn(baseFormData, formData)
const nextFn = () => {
addAnimalAPI({
...formData
}).then(res => {
status.value = ''
gender.value = ''
addList.push(1)
objFn(baseFormData, formData)
uni.showToast({
title: '添加成功',
icon: 'success',
duration: 1000,
})
})
}
const addList = reactive([])
</script>
<style lang="scss">
.card-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.card-cont {
display: flex;
justify-content: space-between;
.card-l {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.card-r {
overflow: hidden;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
width: 353.97rpx;
height: 210.28rpx;
}
}
.card-li-tit {
margin-bottom: 20rpx;
}
.uplode {
height: 350.47rpx;
background-color: red;
}
.next-btn {
width: 196.26rpx;
height: 66.59rpx;
border: 1px solid #00A15E;
color: #00A15E;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
margin: 0 auto;
text-align: center;
line-height: 66rpx;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.select {
position: relative;
.JT {
position: absolute;
right: 20rpx;
top: 60%;
z-index: 9;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 608.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 0rpx;
bottom: -130rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.head {
text-align: center;
margin-bottom: 10rpx;
}
</style>

View File

@ -1,79 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="tit">
<view class="">
编号: 52656
</view>
<view class="">
溯源码: 52656
</view>
</view>
<view class="card-li">
<view class="">
养殖品种: 土豆
</view>
<view class="">
年龄: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: 20
</view>
<view class="">
体重: 45kg
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" style="display: flex;align-items: center;">
<u--image src="/static/img/GG.png" style="margin: 0 21rpx;" width="80rpx" height="80rpx"></u--image>
当前养殖状态
</view>
<view class="" style="color: green;">
健康
</view>
</view>
</view>
<view class="">
<view class="" style="margin-bottom: 20rpx;">
饲养记录
</view>
<myTable></myTable>
</view>
</view>
</template>
<script setup>
import myTable from "@/components/myTable/index.vue"
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.table {
margin-top: 20rpx;
height: 500rpx;
background-color: red;
}
</style>

View File

@ -1,84 +0,0 @@
<template>
<view class="content">
<farmersCard></farmersCard>
<view class="histroy">
<view class="tit" style="margin-bottom: 40rpx;">
历史操作记录
</view>
<myTable :dataList='dataList'></myTable>
</view>
</view>
<!-- -->
</template>
<script setup>
import farmersCard from "@/components/poultry/farmersCard.vue"
import {
ref,
reactive
} from "vue"
import myTable from "@/components/myTable/index.vue"
import {
actionsAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
const dataList = reactive({})
onLoad((option) => {
actionsAPI({
type: 2
}).then(res => {
for (let key in res.data[option.index].action_record) {
dataList[key] = res.data[option.index].action_record[key]
}
})
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 30rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,415 +0,0 @@
<template>
<view class="content" @click.capture="selectAct=false">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view> -->
<!-- <view class="serch">
<u-search bgColor='white' height='63.08rpx' :show-action="false" actionText="搜索"
:animation="true"></u-search>
<view class="serch-btn">
搜索
</view>
</view> -->
<farmersCard></farmersCard>
<view class="title">
<view class="">
编号: {{baseData.code}}
</view>
<view class="more-jt" @click="navgo(`/pages/poultry/SingleDetail?id=${poultry_id}`)">
查看养殖详情 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;" width="31.54rpx"
height="31.54rpx"></u--image>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="" @click.capture="selectFoucsFn">
养殖品种: {{baseData.kind}}
</view>
<view class="" style="display: flex;align-items: center;">
具体种类: {{baseData.breed}}
</view>
</view>
<view class="card-li">
<view class="" @click.capture="selectFoucsFn">
养殖类型: {{baseData.animal_gender==1?'公':"母"}}
</view>
<view class="" style="display: flex;align-items: center;">
体重: <up-input style="height: 49.07rpx;width: 215.54rpx;margin-left: 20rpx;" placeholder="请输入内容"
border="surround" v-model="formData.weight"></up-input>
</view>
</view>
<view class="card-li" style="align-items: center;">
<view class="">
年龄: {{baseData.age}}
</view>
<view class="select">
状态: <up-input readonly style="height: 49.07rpx;width: 215.54rpx;margin-left: 20rpx;"
placeholder="请选择" border="surround" @click.capture="selectFoucsFn" v-model="value">
</up-input>
<view class="JT" :class="{actJT:selectAct}">
<u--image src="/static/img/XLJT.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
<view class="selectvalue" v-show="selectAct">
<view class="select-li" v-for="(item,index) in selectList" :key="index"
@click="changSelectfn(index)" :style="{color:indexs==index?'black':'#B3B3B3'}">
{{item}}
<view class="" v-show='indexs==index'>
<u--image src="/static/img/XLZZ.png" width="24.53rpx" height="24.53rpx"></u--image>
</view>
</view>
</view>
</view>
</view>
<!-- <imgCard :imgUrl='baseData?.pic_detail?.pic'></imgCard> -->
<imgCard :imgUrl='baseData?.pic_detail?.pic'></imgCard>
<view class="up-plant-btn" @tap="updataStatusFn">
确认更新
</view>
</view>
<view class="circumstance" v-for="(item,index) in actionList" :key="index">
<view class="card-tit">
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo('/pages/growRecord/index')">
更新{{index.slice(0,-2)}}
</view>
</view>
<myTable :tit='`查看${index.slice(0,-2)}`' :dataList="item.action_record" route='/pages/feedIng/allRecording'>
</myTable>
</view>
<view class="ripe-btn" @tap="outBar">
标记状态为出栏
</view>
</view>
</template>
<script setup>
import farmersCard from "@/components/poultry/farmersCard.vue"
import imgCard from "@/components/imgCard.vue"
import myTable from "@/components/myTable/index.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
ref,
reactive
} from "vue"
import {
animalInfoAPI,
animalStatusAPI
} from "@/api/animal.js"
import {
poultryStatusAPI,
poultryInfoAPI
} from "@/api/chick.js"
import {
actionsAPI
} from "@/api/animal.js"
const selectList = reactive([
"健康", "产蛋中", "生病隔离中", "可出栏"
])
const value = ref("")
const selectAct = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
}
const indexs = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
formData.status = index + 1
}
const poultry_id = ref(0)
const baseData = reactive({})
onLoad((options) => {
poultry_id.value = options.id
formData.poultry_id = options.id
poultryInfoAPI({
poultry_id: options.id
}).then(res => {
for (let key in res.data) {
baseData[key] = res.data[key]
}
formData.weight = baseData.weight
formData.status = baseData.status
value.value = selectList[baseData.status - 1]
indexs.value = baseData.status - 1
})
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
const formData = reactive({
status: '',
poultry_id: '',
weight: ""
})
const updataStatusFn = () => {
poultryStatusAPI({
...formData
}).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
})
}
const outBar = () => {
poultryStatusAPI({
status: 4,
animal_id: animal_id.value,
}).then(res => {
uni.showToast({
title: res.msg,
icon: 'none'
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/index/index'
})
}, 2000)
})
}
const actionList = reactive({})
actionsAPI({
type: 3
}).then(res => {
for (let key in res.data) {
actionList[key] = (res.data)[key]
}
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.title {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
margin-top: 42rpx;
.updata-btn {
width: 192.76rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
font-size: 26.29rpx;
}
}
.serch {
position: relative;
margin-bottom: 20rpx;
.serch-btn {
color: white;
width: 115.65rpx;
height: 63.08rpx;
background-color: #1BAB6F;
text-align: center;
line-height: 63.08rpx;
border-radius: 50rpx;
position: absolute;
top: 0;
right: 0;
}
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 20rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.select {
display: flex;
align-items: center;
position: relative;
.JT {
position: absolute;
right: 20rpx;
z-index: 9999;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 208.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 90rpx;
bottom: -250rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.circumstance {
width: 693.93rpx;
margin: 0 auto;
margin-bottom: 43rpx;
.card-tit {
display: flex;
justify-content: space-between;
margin-bottom: 28rpx;
}
.updata-btn {
font-size: 26.29rpx;
// width: 192.76rpx;
padding: 0 20rpx;
height: 57.83rpx;
border: 1px solid #00A15E;
color: #00A15E;
display: flex;
justify-content: center;
align-items: center;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
}
.check {
font-size: 29.79rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
.tab {
height: 500rpx;
background-color: red;
}
}
</style>

View File

@ -1,183 +0,0 @@
<template>
<view class="content">
<!-- <view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view> -->
<farmersCard></farmersCard>
<view class="serch">
<u-search bgColor='white' v-model="query" @change="queryFn" height='63.08rpx' :show-action="false"
actionText="搜索" :animation="true"></u-search>
<view class="serch-btn">
搜索
</view>
</view>
<view class="card" v-for="(item,index) in animalList" :key="index"
@click="navgo(`/pages/poultry/feedDetail?id=${item.id}`)">
<view class="tit">
<view class="">
编号: {{item.code}}
</view>
<view class="" style="color: #00A15E;" v-if='item.status==1'>
健康
</view>
<view class="" style="color: #FFD736;" v-if='item.status==2'>
产蛋期
</view>
<view class="" style="color: #3274F9;" v-if='item.status==4'>
可出栏
</view>
<view class="" style="color: #F84221;" v-if='item.status==3'>
生病隔离中
</view>
</view>
<view class="card-li">
<view class="">
养殖类型: {{item.kind}}
</view>
<view class="">
年龄: {{item.age}}
</view>
<view class="">
体重: {{item.weight}}kg
</view>
</view>
</view>
<view class="ripe-btn" @click="navgo('/pages/feedIng/addPoultry')">
添加新动物
</view>
</view>
</template>
<script setup>
import {
animalListAPI,
} from "@/api/chick.js"
import {
reactive,
ref
} from "vue";
import farmersCard from "@/components/poultry/farmersCard.vue"
const navgo = (url) => {
uni.navigateTo({
url
})
}
const animalList = reactive([])
animalListAPI({
user_id: 307,
page_no: 1,
page_size: 3000000,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
})
const query = ref("")
const queryFn = () => {
console.log(444454)
animalList.splice(0, 999999999)
animalListAPI({
user_id: 307,
keyword: query.value,
}).then(res => {
res.data.forEach(item => {
animalList.push(item)
})
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.serch {
position: relative;
margin-bottom: 20rpx;
.serch-btn {
color: white;
width: 115.65rpx;
height: 63.08rpx;
background-color: #1BAB6F;
text-align: center;
line-height: 63.08rpx;
border-radius: 50rpx;
position: absolute;
top: 0;
right: 0;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
margin-top: 64rpx;
}
.showmore {
font-size: 29.79rpx;
justify-content: center;
display: flex;
align-items: center;
}
</style>

View File

@ -1,101 +0,0 @@
<template>
<view class="content">
<view class="">
<view class="">
养殖情况
</view>
<imgCard v-for="(item,index) in imgList" :imgUrl='item' :key="index" @tap='previewImage(index)'></imgCard>
</view>
<view class="up-plant-btn" @click="updateImgFn">
上传新的种植情况
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
import uplodeImg from "@/utils/uplodeImg.js"
import {
animalPicListAPI,
addAnimalPicAPI
} from "@/api/chick.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
reactive,
ref
} from "vue";
const img = ref("")
const updateImgFn = () => {
uplodeImg().then(res => {
img.value = res.data.image
addAnimalPicAPI({
poultry_id: Number(animal_id.value),
pic: res.data.image
}).then(res => {
imgList.unshift(img.value)
})
})
}
const imgList = reactive([])
const animal_id = ref("")
onLoad((option) => {
animal_id.value = option.id
animalPicListAPI({
poultry_id: option.id
}).then(res => {
res.data.forEach(item => {
imgList.push(item.pic)
})
})
})
const previewImage = (index) => {
uni.previewImage({
urls: imgList,
current: index,
})
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

View File

@ -1,11 +0,0 @@
<template>
<view class="">
dsfsd
</view>
</template>
<script>
</script>
<style>
</style>

View File

@ -1,250 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
养殖头数: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
土地面积: 20
</view>
<view class="">
公猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
养殖种类: 20
</view>
<view class="">
母猪: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
具体种类: 20
</view>
<view class="">
幼崽: 的划分等级
</view>
</view>
</view>
<view class="">
<view style="margin-bottom: 20rpx;">
今日操作
</view>
<view class="card">
<view class="card-li">
<view class="">
喂食
</view>
<view class="" style="color: #00A15E;" @click="showPop=true">
+添加喂食记录
</view>
</view>
</view>
<view class="card">
<view class="card-li">
<view class="">
注射疫苗
</view>
<view class="" style="color: #00A15E;">
+添加喂食记录
</view>
</view>
</view>
</view>
<view style="margin-bottom: 20rpx;">
具体操作内容
</view>
<view class="card">
<view class="tit">
<view class="">
喂食
</view>
<view class="" style="display: flex;">
<view class="" style="margin-right: 40rpx;">
删除
</view>
<view class="" style="color: #00A15E;">
编辑
</view>
</view>
</view>
<view class="card-li">
<view class="">
饲料类型: 无机盐饲料
</view>
<view class="">
饲料品牌: 双胞胎
</view>
</view>
<view class="card-li">
<view class="">
喂食记录: 200kg
</view>
<view class="">
备注: 双胞胎
</view>
</view>
</view>
<view class="card">
<view class="tit">
<view class="">
疫苗注射对象
</view>
<view class="" style="display: flex;">
<view class="" style="margin-right: 40rpx;">
删除
</view>
<view class="" style="color: #00A15E;">
编辑
</view>
</view>
</view>
<view class="card-li">
<view class="">
疫苗名称: 无机盐饲料
</view>
<view class="">
疫苗品牌: 双胞胎
</view>
</view>
<view class="card-li">
<view class="">
操作人员: 200kg
</view>
<view class="">
注射数量: 双胞胎
</view>
</view>
<view class="">
疫苗条形码
<view class="code-img">
</view>
</view>
</view>
<view class="ripe-btn">
完成今日统计
</view>
<!-- 组件 -->
<view class="">
<u-popup :show="showPop" :round="10" :closeable='true' @close="showPop=false" @open="showPop=true">
<view class="pop-content">
<view class="pop-tit">
添加喂食记录
</view>
<view class="">
饲料类型
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData.value"
@change="change"></up-input>
</view>
<view class="">
饲料品牌
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData.value"
@change="change"></up-input>
</view>
<view class="pop-confirm" @tap="confirm">
确认
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const showPop = ref(false)
const formData = reactive({
value: ""
})
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.pop-content {
padding: 20rpx;
.pop-tit {
margin-bottom: 20rpx;
font-weight: bold;
}
.pop-li {
margin: 20rpx 0;
margin-bottom: 40rpx;
}
.pop-confirm {
width: 693.93rpx;
height: 84.11rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
color: white;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
text-align: center;
line-height: 84rpx;
margin-top: 70rpx;
}
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.code-img {
background-color: red;
height: 196.26rpx;
margin-top: 30rpx;
}
</style>

View File

@ -1,219 +0,0 @@
<template>
<view class="content">
<view class="title">
疫苗相关信息
</view>
<view class="card">
<view class="card-li">
<view class="card-li-tit">
疫苗名称
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
疫苗品牌
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
操作人员
</view>
<view class="">
<up-input placeholder="请输入品种" border="surround" v-model="value" @change="change"></up-input>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
疫苗条形码
</view>
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<u--image src="/static/img/DJSC.png" width="91.12rpx" height="91.12rpx"></u--image>
<view class="">
点击上传图片
</view>
</view>
</view>
</view>
<view class="card-li">
<view class="card-li-tit">
注射对象
</view>
<view class="scan">
扫描动物耳标/脚标
</view>
</view>
</view>
<view style="margin-bottom: 20rpx;" v-for="item in [1,1,1,1,1]">
<u-swipe-action>
<u-swipe-action-item :options="options1" style="border-radius: 20rpx;">
<view class="" style="padding: 20rpx 30rpx;">
<view class="swipe-action-tit">
<view class="">
编号: 123456
</view>
<view class="" style="color: #00A15E;" v-if="true">
健康
</view>
<view class="" style="color: #FFD736;" v-if="0">
怀孕中
</view>
<view class="" style="color: #3274F9;" v-if="0">
可出栏
</view>
</view>
<view class="swipe-action-li">
<view class="">
养殖品种:黑山猪
</view>
<view class="">
年龄: 5
</view>
<view class="">
体重: 150kg
</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
<view class="ripe-btn">
确认
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const options1 = reactive([{
text: '删除'
}])
const updateImgFn = () => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
console.log('chooseImage success, temp path is', res.tempFilePaths[0])
var imageSrc = res.tempFilePaths[0]
uni.showLoading({
title: '上传中'
})
this.task = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload', //
filePath: imageSrc,
name: 'file',
formData: {
'user': 'test'
},
success: (res) => {
if (this.pageVisible) {
console.log('uploadImage success, res is:', res)
uni.hideLoading();
uni.showToast({
title: '上传成功',
icon: 'success',
duration: 1000
})
this.imageSrc = imageSrc
}
},
fail: (err) => {
if (this.pageVisible) {
console.log('uploadImage fail', err);
uni.hideLoading();
uni.showModal({
content: err.errMsg,
showCancel: false
});
}
},
});
},
fail: (err) => {
console.log('chooseImage fail', err)
}
})
}
</script>
<style lang="scss" scoped>
.card-li-tit {
margin-bottom: 20rpx;
}
.title {
margin: 20rpx 0;
}
.code-img {
background-color: #F4F4F4;
height: 196.26rpx;
position: relative;
.carime-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
}
.scan {
// width: 623.83rpx;
height: 80.61rpx;
border: 2px solid #00A15E;
border-radius: 50rpx;
color: #00A15E;
text-align: center;
line-height: 80rpx;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.swipe-action-tit {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #F4F4F4;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.swipe-action-li {
display: flex;
justify-content: space-between;
// align-items: ;
}
</style>

View File

@ -1,306 +0,0 @@
<template>
<view class="" style="padding: 30rpx;">
<view class="" style="padding: 20rpx;box-sizing: border-box;">
<view class="head">
<view class="subsection">
<view class="subsection-li" @click="changeDate('day')">
</view>
<view class="subsection-li" @click="changeDate('month')">
</view>
<view class="act" :style="{left:leftNum+'rpx'}">
</view>
</view>
<view class="set">
<view class="" style="margin: 0 10rpx;" @tap='choseDateFn'>
<u-icon name="setting" color="white" size="15"></u-icon>
</view> 自定义
</view>
</view>
<view class="">
<view class="tit">
土地检测数据
</view>
<view class="charts-box" v-for="(item,index) in baseData " :key="index">
<qiun-data-charts type="line" :opts="opts[index]" :chartData="chartData[index]" />
</view>
</view>
</view>
</view>
<uni-calendar :insert="false" ref="calendar" :range='true' :lunar="true" @confirm="confirm" />
</template>
<script>
import {
landEnvDataChartAPI
} from "@/api/plant.js"
export default {
data() {
return {
type: false,
showPicker: false,
leftNum: 10,
baseData: [],
xInfo: [{
name: "土壤温度(℃)",
data: 'soil_temp'
}, {
name: "土壤湿度(%RH)",
data: 'soil_mois'
}, {
name: "磷含量%)",
data: 'p_content'
}, {
name: "氮含量(mg/l)",
data: 'n_content'
}, {
name: "钾含量(%)",
data: 'k_content'
},
],
chartData: [],
opts: []
};
},
onReady() {
// console.log(this.getFiveDay())
this.initCharts(this.getFiveDay()[4], this.getFiveDay()[0])
},
methods: {
getOptFn() {
return {
dataLabel: false,
color: ["#1890FF"],
padding: [15, 15, 0, 15],
yAxis: {
gridType: "dash",
dashLength: 4,
gridColor: "#CCCCCC",
padding: 10,
data: [{
position: "left",
title: "",
min: 0,
max: 100,
},
{
position: "right",
min: 0,
max: 110,
title: "",
textAlign: "left"
},
]
},
xAxis: {
disabled: false
},
extra: {
line: {
type: "curve",
animation: "horizontal"
}
}
}
},
getFiveDay() {
const today = new Date();
const lastFiveDays = [];
for (let i = 0; i < 5; i++) {
const date = new Date(today.getTime() - (i + 1) * 24 * 60 * 60 * 1000);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
lastFiveDays.push(`${year}-${month}-${day}`);
}
return lastFiveDays;
},
choseDateFn() {
// console.log()
this.$refs.calendar.open()
},
confirm(e) {
// console.log(e)
this.opts.forEach(item => {
console.log(item)
item.xAxis.disabled = true
})
this.initCharts(e.range.before, e.range.after)
},
changeDate(type) {
if (type == 'day') {
this.opts.forEach(item => {
console.log(item)
item.xAxis.disabled = false
})
this.opts.xAxis.disabled = false
this.leftNum = 10
this.initCharts(this.getFiveDay()[4], this.getFiveDay()[0])
} else {
this.leftNum = 160
let date = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-'
this.initCharts(date + '01', date + '30')
// this.opts.xAxis.disabled = true
this.opts.forEach(item => {
console.log(item)
item.xAxis.disabled = true
})
}
// this.initCharts('2023-10-23', '2023-10-27')
},
navgo() {
uni.navigateTo({
url: '/pages/index3/index'
})
},
backFn() {
uni.navigateBack()
},
initCharts(start_time, end_time) {
landEnvDataChartAPI({
user_id: 307,
start_time,
end_time
}).then(res => {
res.data.forEach((item, index) => {
this.opts.push(this.getOptFn())
// console.log()
this.opts[index].yAxis.data[0].max = item.max
this.opts[index].yAxis.data[1].max = item.max
})
// console.log(res.data[0].max)
this.baseData = res.data
let datas = this.baseData
this.baseData.forEach((item, index) => {
this.getServerData(item, index)
})
})
},
getServerData(datas, index) {
setTimeout(() => {
let res = {
categories: datas['create_time'],
series: [{
name: this.xInfo[index].name,
index: 1,
type: "lines",
data: datas[this.xInfo[index].data]
}]
};
this.chartData[index] = JSON.parse(JSON.stringify(res));
}, 500);
},
}
};
</script>
<style lang="less" scoped>
.head {
// height: 10vh;
display: flex;
justify-content: space-between;
align-items: center;
// background-color: red;
.subsection {
display: flex;
width: 300.12rpx;
height: 98.13rpx;
background-color: #F4F4F4;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
line-height: 5vh;
position: relative;
.subsection-li {
width: 150.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
text-align: center;
line-height: 94rpx;
z-index: 8;
// margin-top: 10rpx;
}
.act {
position: absolute;
width: 130.7rpx;
height: 84.11rpx;
border-radius: 50.82rpx 50.82rpx 50.82rpx 50.82rpx;
background-color: #fff;
top: 50%;
transform: translateY(-50%);
transition: .5s;
}
}
.set {
width: 159.46rpx;
height: 63.08rpx;
font-size: 29.79rpx;
background-color: #0BC677;
border-radius: 31.54rpx 31.54rpx 31.54rpx 31.54rpx;
color: white;
text-align: center;
line-height: 63rpx;
display: flex;
align-items: center;
}
}
.tit {
text-align: center;
margin: 30rpx 0;
font-size: 36.8rpx;
}
.charts-box {
width: 100%;
height: 300px;
border: 1px solid black;
margin-bottom: 40rpx;
}
.detect {
.line {
width: 7.01rpx;
height: 31.54rpx;
background-color: #4CC593;
display: inline-block;
margin-right: 10rpx;
}
.detecttit {
font-size: 31.54rpx;
display: flex;
align-items: center;
}
.content {
padding-top: 20rpx;
}
}
</style>

View File

@ -1,121 +0,0 @@
<template>
<view class="content">
<landInfo :land_id='land_id'></landInfo>
<view class="histroy">
<view class="tit" style="margin-bottom: 40rpx;">
历史操作记录
</view>
<myTable :dataList='dataList'></myTable>
</view>
<view class="btn"
@click="navgo(`/pages/growRecord/index?land_id=${land_id}&crop_id=${crop_id}&type=1&title=${title}`)">
记录今日操作
</view>
</view>
</template>
<script setup>
import {
actionsListAPI,
actionsDetailAPI,
landCropRecordListAPI,
landCropRecordInfoAPI
} from "@/api/plant.js"
import myTable from "@/components/myTable/index.vue"
import landInfo from "@/components/plant/landInfo.vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
actionsAPI
} from "@/api/animal.js"
import {
reactive,
ref
} from "vue"
// actionsListAPI({
// type: 1
// }).then(res => {
// console.log(res)
// })
const land_id = ref(0)
const crop_id = ref(0)
const dataList = reactive({})
const title = ref('')
onLoad((option) => {
land_id.value = option.land_id
crop_id.value = option.crop_id
title.value = option.index
actionsAPI({
type: 1,
crop_id: crop_id.value
}).then(res => {
// console.log(res.data[option.index].action_record)
for (let key in res.data[option.index].action_record) {
dataList[key] = res.data[option.index].action_record[key]
}
})
// landCropRecordInfoAPI({
// record_id: 41
// })
// landCropRecordListAPI({
// crop_id: 1,
// action_type_id: 1
// }).then(res => {
// for (let key in res.data) {
// dataList[key] = res.data[key]
// }
// console.log(dataList)
// })
})
// actionsDetailAPI({
// action_id: 2
// }).then(res => {
// // console.log(res)
// })
const navgo = (url) => {
uni.navigateTo({
url
})
}
</script>
<style lang="scss" scoped>
.content {
padding: 20rpx;
background-color: #F4F4F4;
min-height: 100vh;
.card {
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
}
}
.table {
height: 500rpx;
background-color: red;
}
.btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
border: 1px solid #00A15E;
text-align: center;
line-height: 66rpx;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
margin: 0 auto;
margin-top: 80rpx;
}
}
</style>

View File

@ -1,234 +0,0 @@
<template>
<view class="content">
<!-- {{userInfoData}} -->
<view class="card">
<view class="card-tit">
<view class="" style="display: flex; align-items: center;">
<u--image :src="userInfoData.avatar" shape="circle" style="margin: 0 5rpx;" width="84.11rpx"
height="84.11rpx"></u--image>
<view class="" style="margin-left: 20rpx;">
{{userInfoData.name}}
</view>
</view>
<view class="">
管辖: {{userInfoData.address}}
</view>
</view>
<view class="card-li" v-if="!showMore">
<view class="">
监管农户: {{userInfoData.farmer_total}}
</view>
<view class="">
涉及土地面积: {{userInfoData.farmer_area}}
</view>
</view>
<view class="border">
</view>
<view class="" v-if="showMore">
<view class="card-li">
<view class="">
监管农户: {{userInfoData.farmer_total}}
</view>
<view class="">
涉及土地面积: {{userInfoData.farmer_area}}
</view>
</view>
<view class="card-li">
<view class="">
种植户: {{userInfoData.farmer_zz_total}}
</view>
<view class="">
占地面积: {{userInfoData.farmer_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-大型动物: {{userInfoData.farmer_jc_total}}
</view>
<view class="">
占地面积: {{userInfoData.farmer_jc_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-禽类: {{userInfoData.farmer_jq_total}}
</view>
<view class="">
占地面积: {{userInfoData.farmer_jq_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-水产: {{userInfoData.farmer_sc_total}}
</view>
<view class="">
占地面积: {{userInfoData.farmer_sc_area}}
</view>
</view>
<view class="border">
</view>
<view class="detail" @click="showMore=!showMore">
收起 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;transform: rotate(270deg);"
width="28.04rpx" height="28.04rpx"></u--image>
</view>
</view>
<view class="detail" v-if="!showMore" @click="showMore=!showMore">
查看监管详情 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;transform: rotate(90deg)"
width="28.04rpx" height="28.04rpx"></u--image>
</view>
</view>
<view class="query" @tap='showPicker=true'>
<view class="" style="margin-right: 10rpx;">
{{query}} (100)
</view>
<u--image src="/static/img/CKGD.png" width="35.04rpx" height="35.04rpx"></u--image>
</view>
<view class="card" v-for="(item,index) in userInfoData.farmer_list" :key="index">
<view class="card-tit">
<view class="" style="display: flex; align-items: center;">
<u--image src="/static/img/bg1.png" shape="circle" style="margin: 0 5rpx;" width="84.11rpx"
height="84.11rpx"></u--image>
<view class="" style="margin-left: 20rpx;">
{{item.name}}
</view>
</view>
<view class="">
地址: {{item.address}}
</view>
</view>
<view class="card-li">
<view class="" style="margin-bottom: 20rpx;">
土地面积: {{item.total_area}}
</view>
<view class="">
种养殖类别: {{farmerTypeFn(item)}}
</view>
</view>
<!-- <view class="border">
</view>
<view class="">
更新时间: 2023-10-11
</view> -->
</view>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" @close="showPicker=false" :columns="columns" @confirm="pickerConfirmFn"
@cancel='showPicker=false' :closeOnClickOverlay='true'></u-picker>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import {
onLoad
} from "@dcloudio/uni-app"
import {
userInfoAPI
} from "@/api/plant.js"
const userInfoData = reactive({})
onLoad((option) => {
userInfoAPI({
user_id: option.id,
user_type: 2
}).then(res => {
for (let key in res.data) {
userInfoData[key] = res.data[key]
}
})
})
const farmerTypeFn = (data) => {
let arr = ['is_zz_user', 'is_sz_user', 'is_jc_user', 'is_jq_user']
let identity = ''
arr.forEach(item => {
if (data[item]) {
identity = identity + typeFn(item)
}
})
return identity.substr(0, identity.length - 1)
}
const typeFn = (type) => {
if (type == 'is_zz_user') return "种植户,"
if (type == 'is_sz_user') return "水产户,"
if (type == 'is_jc_user') return "家畜户,"
if (type == 'is_jq_user') return "家禽户,"
}
const showMore = ref(false)
const showPicker = ref(false)
const columns = reactive([
['全部 ', '1队农户', '2队农户', '3队农户', '4队农户', '5队农户', '6队农户']
]);
const pickerConfirmFn = (e) => {
query.value = e.value[0]
showPicker.value = false
}
const query = ref("全部")
</script>
<style lang="scss" scoped>
.card {
padding: 30rpx;
}
.card-herd {
display: flex;
justify-content: space-between;
align-items: center;
}
.serch {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.card-tit {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.card-li {
display: flex;
// margin: ;
flex-wrap: wrap;
justify-content: space-between;
}
.border {
border-bottom: 1px solid #F4F4F4;
margin: 20rpx 0;
}
.detail {
display: flex;
align-items: center;
justify-content: center;
}
.query {
margin-bottom: 40rpx;
display: flex;
align-items: center;
}
</style>

View File

@ -1,227 +0,0 @@
<template>
<view class="content" @click.capture="selectAct=false">
<view class="card">
<view class="tit">
<view class="">
农户名称: 1号土地
</view>
</view>
<view class="card-li">
<view class="">
种养殖类型: 土豆
</view>
<view class="">
土地面积: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
联系方式: 20
</view>
<view class="">
1号土地: 的划分等级
</view>
</view>
<view class="card-li">
<view class="">
2号土地: 20
</view>
<view class="">
3号土地: 计划G几乎是官方
</view>
</view>
<view class="card-li">
<view class="">
地址: 四川省巴中市恩阳区三
</view>
</view>
</view>
<supervision></supervision>
<view class="title">
<view class="">
农户上传操作记录
</view>
</view>
<myTable route='/pages/feedIng/allFeed'></myTable>
<view class="ripe-btn">
确定
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
import myTable from "@/components/myTable/index.vue"
import supervision from "@/components/supervision/index.vue"
import {
ref,
reactive
} from "vue"
const selectList = reactive([
"健康", "怀孕中", "生病隔离中", "可出栏"
])
const value = ref("")
const selectAct = ref(false)
const selectFoucsFn = (e) => {
selectAct.value = true
}
const indexs = ref(0)
const changSelectfn = (index) => {
indexs.value = index
value.value = selectList[index]
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20rpx;
.tit {
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBF1EF;
}
.card-li {
margin-top: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.title {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
margin-top: 42rpx;
}
.serch {
position: relative;
margin-bottom: 20rpx;
.serch-btn {
color: white;
width: 115.65rpx;
height: 63.08rpx;
background-color: #1BAB6F;
text-align: center;
line-height: 63.08rpx;
border-radius: 50rpx;
position: absolute;
top: 0;
right: 0;
}
}
.head-img {
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin: 0 auto;
position: relative;
.poisition {
opacity: 0.7;
position: absolute;
width: 380.26rpx;
height: 71rpx;
background-color: #FFFFFF;
left: 20rpx;
bottom: 36rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
display: flex;
align-items: center;
font-size: 29.79rpx;
.dw-cls {
margin: 0 5rpx;
}
}
}
.up-plant-btn {
width: 371.5rpx;
height: 66.59rpx;
color: #00A15E;
margin: 40rpx auto;
border: 1px solid #00A15E;
font-weight: bold;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
justify-content: center;
}
.ripe-btn {
width: 588.79rpx;
height: 84.11rpx;
background-color: #00A15E;
color: white;
display: flex;
justify-content: center;
align-items: center;
margin: 85rpx auto;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
background: linear-gradient(to right, #00A15E, #4CC593);
}
.select {
display: flex;
align-items: center;
position: relative;
.JT {
position: absolute;
right: 20rpx;
z-index: 9999;
transition: .2s;
}
.actJT {
transition: .2s;
transform: rotate(180deg);
}
.selectvalue {
position: absolute;
width: 208.53rpx;
background-color: white;
z-index: 99;
font-size: 26.29rpx;
left: 90rpx;
bottom: -250rpx;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
padding: 0 20rpx;
border: 1px solid #F4F4F4;
.select-li {
margin: 20rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
}
}
}
.updata-btn {
display: flex;
align-items: center;
}
</style>

View File

@ -1,210 +0,0 @@
<template>
<view class="">
<view class="content">
<view class="border-bgc">
</view>
<view class="" style="height: 30rpx;">
</view>
<view class="card">
<view class="card-li">
农户名称: {{userInfo.name}}
</view>
<view class="card-li">
种养殖类型: 种植户
</view>
<view class="card-li">
土地面积: {{userInfo.total_land_area}}
</view>
<view class="card-li">
地址: {{userInfo.area_name}}{{userInfo.street_name}}{{userInfo.village_name}}{{userInfo.brigade_name}}
</view>
</view>
<view class="card" v-for="(item,index) in userInfo.land_detail" :key="index"
@click="navgoFn(item.is_cropped,item.land_id)">
<view class="tit card-li">
<view class="">
{{item.land_notes}}
</view>
<view class="" style="color: #00A15E;" v-if="item.is_cropped">
已种植
</view>
<view class="" style="color: #00A15E;" v-else>
未种植
</view>
</view>
<view class="card-li">
<view class="">
面积: {{item.land_area}}
</view>
</view>
<view class="card-li tit" v-if="item.crop_name">
<view class="" style="font-weight: normal;">
农作物: {{item.crop_name}}
</view>
<view class="" style="color: #FF9B66;" v-if="item.ripe_time">
已成熟
</view>
</view>
<view class="card-li tit" style="font-weight: normal;" v-show="item.crop_yield">
<view class="">
预计产量: {{item.crop_yield}}kg
</view>
<view class="" v-if="false">
已出售: 500kg
</view>
</view>
</view>
<view style="height: 170rpx;">
</view>
</view>
<view class="bottom">
<!-- <view class="add-btn" @click="navgo('/pages/growRecord/index')">
批量处理
</view> -->
<view class="add-btn add" @click="navgo('/pages/InformationAdd/index')">
增加种植
</view>
</view>
</view>
</template>
<script setup>
import {
reactive
} from "vue"
const userInfo = reactive({
"id": 307,
"create_user_id": 33,
"company_id": 17,
"name": "王五",
"phone": "18148000562",
"area_name": "纳溪区",
"street_name": "安富街道",
"village_name": "上坝街",
"brigade_name": "1队",
"is_zz_user": true,
"is_sc_user": true,
"is_jq_user": true,
"is_dw_user": true,
"total_land_area": 5000,
"total_pond_area": 32,
"total_henhouse_area": 0,
"total_pasture_area": 0,
"pond_detail": [{
"pond_id": 74,
"pond_area": "32",
"pond_notes": "好看"
},
{
"pond_id": 73,
"pond_area": "",
"pond_notes": "过好几个"
}
],
"land_detail": [{
"land_id": 69,
"land_area": "3000",
"land_notes": "土地二",
"is_cropped": true,
"source_code": "NO1698027424",
"crop_name": "葡萄",
"crop_variety": "阳光玫瑰",
"crop_brand": "不知道啥品牌",
"crop_yield": 1000,
"seed_time": "2023-10-23 10:17:04",
"ripe_time": "2023-10-23 16:40:01"
},
{
"land_id": 68,
"land_area": "2000",
"land_notes": "土地一",
"is_cropped": false
}
]
})
const navgo = (url) => {
uni.navigateTo({
url
})
}
const navgoFn = (type, id) => {
if (!type) {
navgo("/pages/InformationAdd/index")
} else if (type) {
navgo(`/pages/detail/plant?land_id=${id}`)
}
if (type == 2) {
navgo('/pages/detail/plant')
}
}
</script>
<style lang="scss">
.content {
min-height: 90vh;
position: relative;
// padding: 0 20rpx;
// padding-top: 50rpx;
background-color: #EAF2EF;
padding: 0;
.card {
position: relative;
width: 693.93rpx;
margin: auto;
background-color: #fff;
box-sizing: border-box;
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
margin-bottom: 40rpx;
.card-li {
// margin-bottom: 17rpx;
}
.tit {
display: flex;
font-size: 33.29rpx;
font-weight: bold;
// background-color: red;
justify-content: space-between;
}
}
}
.bottom {
width: 750rpx;
height: 150rpx;
background-color: #EAF2EF;
position: fixed;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
.add-btn {
width: 238.32rpx;
height: 84.11rpx;
border: #34D190 1px solid;
border-radius: 42.06rpx 42.06rpx 42.06rpx 42.06rpx;
display: flex;
align-items: center;
color: #00A15E;
font-size: 33.29rpx;
font-weight: bold;
justify-content: center;
margin-right: 20rpx;
}
.add {
background-color: #00A15E;
color: white;
}
}
</style>

View File

@ -1,179 +0,0 @@
<template>
<view class="content">
<view class="card">
<view class="card-herd">
<u--image :src="userInfoDetail.avatar" shape="circle" style="margin: 0 5rpx;" width="84.11rpx"
height="84.11rpx"></u--image>
<view class="">
{{userInfoDetail.name}}
</view>
<view class="">
{{userInfoDetail.company_name}}
<!-- 通滩指导养殖合作服务公司 -->
</view>
</view>
</view>
<view class="serch">
<view class="" style="margin-right: 61rpx;">
监管土地
</view>
<!-- <u-search placeholder="搜索基地名称" :show-action="false" bgColor='white' v-model="keyword"></u-search> -->
</view>
<view class="card" v-for="(item,index) in userInfoDetail.captain_list" :key="index" @click="navgo(item.id)">
<view class="card-tit">
<view class="" style="display: flex; align-items: center;">
<u--image :src="item.avatar" shape="circle" style="margin: 0 5rpx;" width="84.11rpx"
height="84.11rpx"></u--image>
<view class="" style="margin-left: 20rpx;">
{{item.name}}
</view>
</view>
<view class="">
管辖: {{item.address}}
</view>
</view>
<view class="card-li" v-if="!showMore">
<view class="">
监管农户: {{item.farmer_total}}
</view>
<view class="">
涉及土地面积: {{item.farmer_area}}
</view>
</view>
<view class="border">
</view>
<view class="" v-if="showMore">
<view class="card-li">
<view class="">
监管农户:{{item.farmer_total}}
</view>
<view class="">
涉及土地面积: {{item.farmer_area}}
</view>
</view>
<view class="card-li">
<view class="">
种植户:{{item.farmer_zz_total}}
</view>
<view class="">
占地面积: {{item.farmer_zz_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-大型动物: {{item.farmer_jc_total}}
</view>
<view class="">
占地面积: {{item.farmer_jc_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-禽类: {{item.farmer_jq_total}}
</view>
<view class="">
占地面积: {{item.farmer_jq_area}}
</view>
</view>
<view class="card-li">
<view class="">
养殖户-水产: {{item.farmer_sc_total}}
</view>
<view class="">
占地面积: {{item.farmer_sc_area}}
</view>
</view>
<view class="border">
</view>
<view class="detail" @click="showMore=!showMore">
收起 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;transform: rotate(270deg);"
width="28.04rpx" height="28.04rpx"></u--image>
</view>
</view>
<view class="detail" v-if="!showMore" @click="showMore=!showMore">
查看监管详情 <u--image src="/static/img/CKGD.png" style="margin-left: 5rpx;transform: rotate(90deg)"
width="28.04rpx" height="28.04rpx"></u--image>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import {
userInfoAPI
} from "@/api/plant.js"
const showMore = ref(true)
const userInfoDetail = reactive({})
userInfoAPI({
user_id: 25,
user_type: 1
}).then(res => {
for (let key in res.data) {
userInfoDetail[key] = res.data[key]
}
})
const navgo = (id) => {
uni.navigateTo({
url: `/pages/supervision/captain?id=${id}`
})
}
</script>
<style lang="scss" scoped>
.card {
padding: 30rpx;
}
.card-herd {
display: flex;
justify-content: space-between;
align-items: center;
}
.serch {
display: flex;
align-items: center;
margin-bottom: 20rpx;
}
.card-tit {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.card-li {
display: flex;
// margin: ;
justify-content: space-between;
}
.border {
border-bottom: 1px solid #F4F4F4;
margin: 20rpx 0;
}
.detail {
display: flex;
align-items: center;
justify-content: center;
}
</style>

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,5 @@
Promise.resolve("./pages/live/live.js").then((res) => {
res.length;
});
Promise.resolve("./app.css.js").then(() => {
});

View File

@ -16,8 +16,8 @@
<body>
<div id="app"></div>
<script src="uni-app-view.umd.js"></script>
<script src="app-wxs.js"></script>
<script src="app-renderjs.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -861,9 +861,16 @@ uni-view[data-v-1500ce68], uni-scroll-view[data-v-1500ce68], uni-swiper-item[dat
background-color: #34D190;
position: fixed;
z-index: 999999;
height: 3.125rem;
width: 23.4375rem;
}
.nav[data-v-1cf27b2a] {
height: 2.1875rem;
display: flex;
justify-content: flex-end;
box-sizing: border-box;
align-items: center;
padding-right: 1.25rem;
}
.card[data-v-1cf27b2a] {
display: flex;
justify-content: space-between;