<template>
	<view class="">
		<view   class="data" v-for="(item, index) in list" :key="index">
			<view class="top">
				<view class="left">
					<view class="title">
						<u-icon name="fangjian" custom-prefix="custom-icon" size="30" color="#50baca"></u-icon>
						<text style="padding: 0 10rpx;font-weight: 800;">楼栋：</text>
						{{item.name}}
					</view>
				</view>
				
				<view class="right">
					<text>{{item.residentialName}}</text>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view class="cu-list grid col-3 no-border" >
						<view class="cu-item" >
							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.unitNumber}}</text>
							<text class="count ">单元总数</text>
						</view>
						
						<view class="cu-item" >
							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.roomNumber}}</text>
							<text class="count">房间总数</text>
						</view>
						
						<view class="cu-item" >
							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.unitNumber}}</text>
							<text class="count">楼层总数</text>
						</view>
					</view>
				</view>
			</view>
			<view class="bottom">
				<view @click="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
					<text class="cuIcon-edit"></text>
				</view>
				<view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
					<text class="cuIcon-delete"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'card',
	props:{
		list:{
			type:Array,
			default:()=>{
				[]
			}
		}
	},
	data() {
		return {
			loading:false
		};
	},
	created() {
		
	},
	methods:{
		copy(data){
			uni.setClipboardData({
				data:data
			})
		},
		edit(item){
			this.$emit('edit',item)
		},
		delItem(item){
			this.$emit('delItem',item)
		}
	}
};
</script>

<style lang="scss">

.count{
	font-weight: 800;
	padding-top: 10rpx;
}


	
.data {
	background-color: #ffffff;
	margin: 10rpx ;
	border-radius: 6rpx;
	box-sizing: border-box;
	padding: 20rpx 10rpx;
	font-size: 28rpx;
	.top {
		display: flex;
		justify-content: space-between;
		padding-bottom: 20rpx;
		border-bottom: 1rpx dashed   #dedede;
		.left {
			display: flex;
			align-items: center;
			.title {
				margin: 0 10rpx;
				font-size: 30rpx;
			}
		}
		.right{
			margin-right: 10rpx;
		}
	}
	.item {
		margin: 5rpx 0 10rpx 0;
		.content {
			border-bottom: 1rpx dashed #DDDDDD;
			padding: 10rpx 0;
		}
	}
	.bottom {
		display: flex;
		justify-content: flex-end;
		align-items: center;
	}
}
</style>