<template>
	<view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
		<cus-header title="报名信息" bgColor="#FFFFFF"></cus-header>
		<div class="add">
			<div class="btn adfacjc" @tap="handleAdd">
				<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/af9133fd-e15e-454d-9152-e4629fd0ce28.png"></image>
				<text>添加</text>
			</div>
		</div>
		<template v-if="list.length">
			<div class="list">
				<up-list @scrolltolower="scrolltolower" style="height: 100%;">
					<up-list-item v-for="(item, index) in list" :key="index">
						<div class="box adfacjb">
							<div class="box-left adfac" @tap="handleEdit(item,index)">
								<div class="box-left-edit">
									<image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/7799f9f2-1dca-4af3-980b-7f6def10e22f.png"></image>
								</div>
								<div class="box-left-info">
									<div class="box-left-info-top adfac">
										<div class="name">{{'张琳琳'}}</div>
										<image class="sex" v-if="item.sex==2" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/b6d1fcb3-55ba-4104-b8cd-756b963a4da8.png"></image>
										<image class="sex" v-else-if="item.sex==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/a1899fd0-c468-48d9-b554-2f17b75a4157.png"></image>
										<div class="age" :class="{'women':item.sex==2,'man':item.sex==1}">{{46}}岁</div>
									</div>
									<div class="box-left-info-bottom">
										身份证 {{'340123**********09'}}
									</div>
								</div>
							</div>
							<div class="box-right" @tap="handleSelect(item,index)">
								<image v-if="item.select" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/87b5b244-d14f-43cd-991b-4ac9f48d909e.png"></image>
								<image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/12/b8a5cabd-57f8-4ad7-9677-f6372423c50a.png"></image>
							</div>
						</div>
					</up-list-item>
				</up-list>
			</div>
			<div class="confirm">确定，已选择{{2}}人</div>
		</template>
		<template v-else>
			<div class="empty">暂无可选人员，请添加</div>
		</template>
	</view>
</template>

<script setup name="">
	import CusHeader from '@/components/CusHeader/index.vue'
	import { ref } from 'vue'
	
	const list = ref([{sex:1},{sex:2},{sex:2}])
	
	const handleAdd = () => {
		uni.navigateTo({
			url:'/pagesHome/applyMemberVindicate'
		})
	}
	
	const handleEdit = (item,index) => {
		uni.navigateTo({
			url:'/pagesHome/applyMemberVindicate?member='+encodeURIComponent(JSON.stringify(item))
		})
	}
	const handleSelect = (item,index) => {
		
	}
</script>

<style scoped lang="scss">
	.common_page{
		padding-bottom: 60rpx;
		.add{
			margin-top: 20rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0 0;
			padding: 30rpx 24rpx 20rpx;
			.btn{
				width: 100%;
				background: rgba(112,207,82,0.08);
				border-radius: 24rpx;
				border: 1rpx dotted #70CF52;
				padding: 21rpx 0;
				image{
					width: 36rpx;
					height: 36rpx;
				}
				text{
					font-family: PingFang-SC, PingFang-SC;
					font-weight: bold;
					font-size: 28rpx;
					color: #70CF52;
					line-height: 40rpx;
					margin-left: 18rpx;
					letter-spacing: 2rpx;
				}
			}
		}
		
		.list{
			flex: 1;
			overflow: auto;
			background: #FFFFFF;
			border-radius: 0 0 20rpx 20rpx;
			padding: 0 24rpx;
			.box{
				padding: 37rpx 0;
				box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
				&-left{
					width: calc(100% - 76rpx);
					&-edit{
						width: 36rpx;
						height: 36rpx;
						image{
							width: 100%;
							height: 100%;
						}
					}
					&-info{
						width: calc(100% - 36rpx);
						padding-left: 20rpx;
						box-sizing: border-box;
						&-top{
							.name{
								font-family: PingFang-SC, PingFang-SC;
								font-weight: bold;
								font-size: 32rpx;
								color: #151B29;
								line-height: 32rpx;
							}
							.sex{
								width: 44rpx;
								height: 32rpx;
								margin-left: 16rpx;
							}
							.age{
								border-radius: 13rpx;
								font-family: PingFangSC, PingFang SC;
								font-weight: 400;
								font-size: 20rpx;
								line-height: 24rpx;
								padding: 4rpx 10rpx;
								margin-left: 13rpx;
								&.women{
									background: rgba(244,101,122,0.14);
									color: #F4657A;
								}
								&.man{
									background: rgba(5,169,254,0.12);
									color: #05A9FE;
								}
							}
						}
						&-bottom{
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #989998;
							line-height: 24rpx;
							margin-top: 23rpx;
						}
					}
				}
				
				&-right{
					width: 36rpx;
					height: 36rpx;
					image{
						width: 100%;
						height: 100%;
					}
				}
			}
		}
		
		.confirm{
			padding: 0 40rpx;
			margin: 40rpx 0 64rpx;
			display: inline-block;
			height: 90rpx;
			background: #B7F358;
			border-radius: 45rpx;
			font-family: PingFang-SC, PingFang-SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #151B29;
			line-height: 90rpx;
			text-align: center;
			letter-spacing: 2rpx;
		}
		
		.empty{
			margin-top: 300rpx;
			text-align: center;
			font-size: 32rpx;
			color: #666666;
		}
	}
</style>