TraceabilityAPP/components/plant/landInfo.vue

89 lines
1.5 KiB
Vue
Raw Normal View History

2023-10-25 19:55:18 +08:00
<template>
<view class="card">
<view class="tit">
<view class="">
{{land.crop_id}}号土地
</view>
<view class="">
溯源码: {{land.source_code}}
</view>
</view>
<view class="card-li">
<view class="">
当前种植: {{land.crop_name}}
</view>
<view class="">
种植品牌: {{land.crop_brand}}
</view>
</view>
<view class="card-li">
<view class="">
土地面积: {{land.land_area}}
</view>
<view class="">
种子品牌: {{land.crop_variety}}
</view>
</view>
<view class="card-li" v-if="false">
<view class="">
预计产量: {{land.crop_yield}}
</view>
<view class="">
已出售: ???
</view>
</view>
<view class="card-li">
<view class="">
播种时间: {{land.seed_time}}
</view>
</view>
</view>
</template>
<script setup>
import {
landInfoAPI,
} from "@/api/plant.js"
import {
reactive
} from "vue";
const props = defineProps({
land_id: String
})
const land = reactive({})
const objFn = (res, data) => {
for (let key in res) {
data[key] = res[key]
}
}
setTimeout(() => {
landInfoAPI({
land_id: props.land_id,
user_id: 307
}).then(res => {
objFn(res.data, land)
})
}, 300)
</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>