<template>
	<view class="center plr-25">
		<view class="flex-column-center fs-30 mt-30 h-140 pb-30 br-12 plr-25"
			style="background: linear-gradient( 90deg, #5FE8A9 0%, #1FCA7C 100%);color: white;">
			<image class="w-42 h-42 mr-20" src="/pagesMain/static/icon_cz_img.png"></image>
			<text>停车管理费</text>
		</view>
		<view class="flex-column br-12" style="margin-top: -50rpx;background:white;">
			<view class="flex-column">
				<view class="flex-column br-12 fs-28" style="color: #999999;">
					<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
						<text>户号信息</text>
						<text>{{$wskj.isNullStr(userinfo.name)}}</text>
					</view>
					<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
						<text>小区名称</text>
						<text>{{userinfo.communityName}}</text>
					</view>
					<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
						<text>住址信息</text>
						<text>{{userinfo.room}}</text>
					</view>
					<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;" @click="open">
						<text>车位号</text>
						<view class="flex v-center">
							<text>{{carNumber==''?"请选择":carNumber}}</text>
							<image class="w-25 h-30 ml-10" src="/static/icon_r.png"></image>
						</view>
					</view>
				</view>
				<view class="flex">
					<view @click="onTabClick(index)" class="h-50 flex-column flex-between-center fs-28 pad-30"
						style="flex: 1;" :style="{ color: index==indexTab?'#333333':'#999999'}"
						v-for="(item, index) in 3" :key="index">
						<text>{{index==0?"费用预存":index==1?"待缴查看":index==2?"缴费记录":""}}</text>
						<view v-if="index==indexTab" style="background: #27CC81;height: 1rpx;width: 77rpx;">
						</view>
						<view v-else style="background: #FFFFFF;height: 1rpx;width: 77rpx;">
						</view>
					</view>
				</view>
				<text v-if="indexTab==1" class="fs-30 fw-700 ">未缴金额\n￥1355.04</text>
			</view>
		</view>
		<view class="overflow-y" style="background: white;">
			<scroll-view scroll-y style="height:100%;">
				<view v-if="indexTab==1" v-for="(item, index) in 8" :key="index" @click="onClick(index)">
					<view class="flex-column fs-24 mar-20 pb-20" style="border-bottom: 1rpx solid #E9E9E9;">
						<view class="flex v-center fs-28">
							<text>2025年01月</text>
							<text style="color: #EE0101;">￥108.23</text>
							<image style="width: 20rpx;height: 20rpx;" src="/pagesMain/static/icon_zksq_1.png">
							</image>
						</view>
						<view v-if="indexNumber==index" class="flex-column mt-20 fs-24"
							style="color: #999999;text-align: left;">
							<text>缴费项目：物业管理费</text>
							<text>房屋面积：72.15</text>
							<text>单价/平米：￥1.3</text>
							<text>金额：93.8</text>
						</view>
					</view>
				</view>
				<view v-if="indexTab==2" v-for="(item, index) in 10" :key="index" @click="onClick(index)">
					<view class="flex-column fs-24 mb-20" style="text-align: left;">
						<text class="fs-28 h-80 lh-80 plr-25" style="background:#F2F2F2;">2024年6月</text>
						<view class="flex-row-between plr-25 mtb-20">
							<text style="color: #999999;">缴费渠道：线上缴费</text>
							<text>1355.04</text>
						</view>
						<text class="plr-25" style="color: #999999;">06-06 14:29</text>
					</view>
				</view>
			</scroll-view>
		</view>
		<u-picker :show="show" :columns="columns" closeOnClickOverlay="true" @cancel="close" @close="close"
			@confirm="confirm"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				indexTab: 1,
				indexNumber: 0,
				type: 0,
				show: false,
				columns: [
					['T01', 'T02', 'T03', 'T04', 'T05']
				],
				carNumber: '',
				userinfo: '',

			};
		},
		onLoad(options) {
			this.type = options.type
			this.userinfo = uni.getStorageSync("userInfo")

		},
		methods: {
			onTabClick(index) {
				if (index == 0) {
					this.$wskj.to("/pagesMain/pages/jnzd_czf")
					return
				}
				this.indexTab = index
			},
			onClick(index) {
				this.indexNumber = index
			},
			open() {
				this.show = true
			},
			close() {
				this.show = false
			},
			confirm(e) {
				this.show = 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>