cultivationApp/pages/feedIng/histroyFeed.vue

134 lines
2.5 KiB
Vue
Raw Normal View History

2023-10-21 18:02:06 +08:00
<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="">
今日养殖状态
</view>
<imgCard></imgCard>
<view class="">
养殖情况
</view>
2023-10-25 19:55:18 +08:00
<imgCard v-for="(item,index) in imgList" :imgUrl='item.pic' :key="index"></imgCard>
2023-10-21 18:02:06 +08:00
</view>
2023-10-23 17:57:19 +08:00
<view class="up-plant-btn" @click="updateImgFn">
2023-10-21 18:02:06 +08:00
上传新的种植情况
</view>
</view>
</template>
<script setup>
import imgCard from "@/components/imgCard.vue"
2023-10-25 19:55:18 +08:00
import uplodeImg from "@/utils/uplodeImg.js"
import {
animalPicListAPI,
addAnimalPicAPI
} from "@/api/animal.js"
import {
onLoad
} from "@dcloudio/uni-app"
import {
reactive,
ref
} from "vue";
2023-10-23 17:57:19 +08:00
const updateImgFn = () => {
2023-10-25 19:55:18 +08:00
uplodeImg().then(res => {
addAnimalPicAPI({
animal_id: Number(animal_id.value),
pic: res.data.image
}).then(res => {
console.log(res)
})
2023-10-23 17:57:19 +08:00
})
}
2023-10-25 19:55:18 +08:00
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)
})
})
})
2023-10-21 18:02:06 +08:00
</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>