mkm
/
yanzhiAPP
Template
2
0
Fork 0
yanzhiAPP/pages/poultry/feedList.vue

183 lines
3.6 KiB
Vue
Raw Normal View History

2023-10-25 19:55:18 +08:00
<template>
<view class="content">
2023-10-27 18:38:25 +08:00
<!-- <view class="card">
2023-10-25 19:55:18 +08:00
<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>
2023-10-27 18:38:25 +08:00
</view> -->
<farmersCard></farmersCard>
2023-10-25 19:55:18 +08:00
<view class="serch">
2023-10-27 18:38:25 +08:00
<u-search bgColor='white' v-model="query" @change="queryFn" height='63.08rpx' :show-action="false"
actionText="搜索" :animation="true"></u-search>
<view class="serch-btn">
2023-10-25 19:55:18 +08:00
搜索
</view>
</view>
2023-10-26 20:18:04 +08:00
<view class="card" v-for="(item,index) in animalList" :key="index"
@click="navgo(`/pages/poultry/feedDetail?id=${item.id}`)">
2023-10-25 19:55:18 +08:00
<view class="tit">
<view class="">
2023-10-26 20:18:04 +08:00
编号: {{item.code}}
2023-10-25 19:55:18 +08:00
</view>
2023-10-26 20:18:04 +08:00
<view class="" style="color: #00A15E;" v-if='item.status==1'>
2023-10-25 19:55:18 +08:00
健康
</view>
2023-10-26 20:18:04 +08:00
<view class="" style="color: #FFD736;" v-if='item.status==2'>
产蛋期
2023-10-25 19:55:18 +08:00
</view>
2023-10-26 20:18:04 +08:00
<view class="" style="color: #3274F9;" v-if='item.status==4'>
2023-10-25 19:55:18 +08:00
可出栏
</view>
2023-10-26 20:18:04 +08:00
<view class="" style="color: #F84221;" v-if='item.status==3'>
2023-10-25 19:55:18 +08:00
生病隔离中
</view>
</view>
<view class="card-li">
<view class="">
2023-10-26 20:18:04 +08:00
养殖类型: {{item.kind}}
2023-10-25 19:55:18 +08:00
</view>
<view class="">
2023-10-26 20:18:04 +08:00
年龄: {{item.age}}
2023-10-25 19:55:18 +08:00
</view>
<view class="">
2023-10-26 20:18:04 +08:00
体重: {{item.weight}}kg
2023-10-25 19:55:18 +08:00
</view>
</view>
</view>
<view class="ripe-btn" @click="navgo('/pages/feedIng/addPoultry')">
添加新动物
</view>
</view>
</template>
<script setup>
import {
animalListAPI,
2023-10-26 20:18:04 +08:00
} from "@/api/chick.js"
2023-10-25 19:55:18 +08:00
import {
reactive,
ref
} from "vue";
2023-10-27 18:38:25 +08:00
import farmersCard from "@/components/poultry/farmersCard.vue"
2023-10-25 19:55:18 +08:00
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 = () => {
2023-10-27 18:38:25 +08:00
console.log(444454)
2023-10-25 19:55:18 +08:00
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>