<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.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>