<template>
	<view class="center plr-25">
		<view class="flex-column br-12 fs-28 mt-30" style="background: white;">
			<text class="fs-32 fw-700 mt-30" style="text-align: left;padding-left: 30rpx;">车位出租费</text>
			<text class="fs-28 mt-30" style="text-align: left;padding-left: 30rpx;">车位号</text>
			<view class="flex-row-between mar-30 br-4 pad-25" style="background: #F2F2F2;" @click="openCar">
				<text>{{carNumber==''?"请选择":carNumber}}</text>
				<image class="h-30 w-30" src="/static/icon_xjt.png"></image>
			</view>
			<text class="fs-28 mt-30" style="text-align: left;padding-left: 30rpx;">租赁时间</text>
			<view class="flex-row-between mar-30 br-4 pad-25" style="background: #F2F2F2;" @click="open">
				<text>{{monthsNumber==''?"请选择":monthsNumber}}</text>
				<image class="h-30 w-30" src="/static/icon_xjt.png"></image>
			</view>
			<text class="fs-28 mt-30" style="text-align: left;padding-left: 30rpx;">缴费金额</text>
			<view class="flex-row-between mar-30 br-4 pad-25" style="background: #F2F2F2;">
				<text>￥0</text>
			</view>
		</view>
		<view class="fullscreen-btn" style="margin: 0;margin-top: 60rpx;">
			立即缴费
		</view>
		<u-picker :show="show" :columns="columns" closeOnClickOverlay="true" @cancel="close" @close="close"
			@confirm="confirm"></u-picker>
		<u-picker :show="carShow" :columns="list" closeOnClickOverlay="true" @cancel="closeCar" @close="closeCar"
			@confirm="confirmCar"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				carShow: false,
				list: [
					['1', '2', '3', '4', '5']
				],
				columns: [
					['1个月', '3个月', '6个月', '9个月', '12个月']
				],
				monthsNumber: '',
				carNumber: '',

			};
		},
		onLoad(options) {
			this.type = options.type

		},
		methods: {
			open() {
				this.show = true
			},
			close() {
				this.show = false

			},
			openCar() {
				this.carShow = true
			},
			closeCar() {
				this.carShow = false

			},
			confirm(e) {
				this.show = false
				this.monthsNumber = e.value[0]
				console.log("LMG", e.value[0])
			},
			confirmCar(e) {
				this.carShow = false
				this.carNumber = e.value[0]
				console.log("LMG", e.value[0])
			}
		}
	};
</script>

<style>
	.center {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #F2F2F2;
	}

	.grid-container {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-around; // 可以根据需求调整元素的水平排列方式，这里是均匀分布
		align-items: center; // 垂直方向居中对齐
	}

	.grid-item {
		width: 32%;
		height: 80rpx; // 宫格高度
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background: #F2F2F2;
		border-radius: 12rpx;
		margin-top: 10rpx;
	}
</style>