<template>
	<view class="service-pets-card">
		<view class="card-title">
			<text>服务宠物</text>
		</view>
		<view class="pets-list">
			<view class="pet-item" v-for="(pet, index) in pets" :key="index">
				<view class="pet-avatar">
					<image :src="pet.avatar || '/static/images/personal/pet.png'" mode="aspectFill"></image>
					<!-- <view class="pet-tag" v-if="pet.tag">
						<text>{{pet.tag}}</text>
					</view> -->
				</view>
				<view class="pet-details">
					<view class="pet-name-gender" style="display: flex; align-items: center;">
						<text class="pet-name">{{pet.name}}</text>
						<view class="pet-gender" style="margin-left: 10rpx; display: flex; align-items: center;">
							<image :src="pet.gender=='男生'?'/static/images/details/boy.svg':'/static/images/details/girl.svg'" style="width: 24rpx; height: 24rpx;" alt="sex"></image>
						</view>
					</view>
					<text class="pet-service">{{pet.services.join(',')}}: {{pet.serviceDates.join(',')}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			pets: {
				type: Array,
				default: () => []
			}
		}
	}
</script>

<style lang="scss" scoped>
	.service-pets-card {
		background-color: #FFFFFF;
		border-radius: 20rpx;
		padding: 30rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
	}
	
	.card-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
		
		&::before {
			content: '';
			display: inline-block;
			width: 8rpx;
			height: 32rpx;
			background-color: #FFAA48;
			margin-right: 16rpx;
			border-radius: 4rpx;
		}
	}
	
	.pets-list {
		.pet-item {
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;
			
			&:last-child {
				margin-bottom: 0;
			}
			
			.pet-avatar {
				position: relative;
				width: 80rpx;
				height: 80rpx;
				margin-right: 20rpx;
				
				image {
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
				
				.pet-tag {
					position: absolute;
					right: -10rpx;
					bottom: -10rpx;
					background-color: #FFAA48;
					color: #FFFFFF;
					font-size: 20rpx;
					padding: 4rpx 8rpx;
					border-radius: 10rpx;
					line-height: 1;
				}
			}
			
			.pet-details {
				display: flex;
				flex-direction: column;
				
				.pet-name {
					font-size: 28rpx;
					color: #333;
					font-weight: bold;
				}
				
				.pet-service {
					font-size: 24rpx;
					color: #666;
					margin-top: 4rpx;
				}
			}
		}
	}
</style>