<!-- 删除，单元，修改，添加，管理功能皆未实现 -->
<template>
	<view class="">
		<view @click="goDetail(item)"  class="data" v-for="(item, index) in list" :key="index">
			<view class="top">
				<view class="left">
					<view class="title flex justify-center align-center">
						<image @click.stop="$util.preview(item.fastDfsServer+item.imageUri)" v-if="item.imageUri" style="width: 60rpx;height: 60rpx;border-radius: calc(8rpx);" :src="item.fastDfsServer+item.imageUri"></image>
						<u-icon v-else name="man-add-fill"  size="34" color="#50baca"></u-icon>
						<text class="padding-left-10">姓名：{{item.name}}</text>
					</view>
				</view>
				<view class="right flex justify-center align-center">
					<text>人脸审核状态：</text>
					<text class="text-yellow" v-if="item.checkState==-1">待上传</text>
					<text class="text-orange" v-else-if="item.checkState==0">待审核</text>
					<text class="text-green " v-else-if="item.checkState==1">审核通过</text>
					<text class="text-red" 	  v-else="item.checkState==2">审核未通过</text>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view style="padding: 0 30rpx;">
						<view class="content flex">
							<u-icon v-if="item.sex==1" name="man"   size="30" color="#fdb524"></u-icon>
							<u-icon v-else name="woman"   size="30" color="#fdb524"></u-icon>
							<text   class="text-bold  padding-left-10">性别：</text>
							<text   v-text="item.sex==1?'男':'女'"></text>
						</view>
						<view  class="content flex">
							<u-icon name="bookmark"  size="30" color="#5ca8f0"></u-icon>
							<text class="text-bold padding-left-10">住户类型：</text>
							<text class="" v-if="item.type==0">业主</text>
							<text class="" v-else-if="item.type==1">成员</text>
							<text class="" v-else="item.type==2">租客</text>
						</view>
						<view  class="content flex">
							<u-icon name="xiaoqu" custom-prefix="custom-icon" size="30" color="#2fc500"></u-icon>
							<text class="text-bold padding-left-10">房屋信息：</text>
							<text >{{item.residentialName}},{{item.buildingName}},{{item.unitName}},{{item.roomName}}</text>
						</view>
						<view  class="content flex">
							<text class="cuIcon-mobile" style="color: #007AFF;font-size: 32rpx;"></text>
							<text class="text-bold padding-left-10">联系方式：</text>
							<text class="text-bold" style="padding-top: 6rpx;" v-text="item.phone" ></text>
						</view>
					</view>
				</view>
			</view>
			<view class="bottom flex" >
				<view @click.stop="edit(item)" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
					修改信息
				</view>
<!-- 				<view @click.stop="deleteItem(item)" class="cu-btn  sm round bg-red" style="margin: 0 10rpx;">
					删除记录
				</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
			})
		},
		deleteItem(item){
			this.$emit('deleteItem',item)
		},
		edit(item){
			uni.navigateTo({
				url:"/pages/user/edit?id="+item.id
			})
		},
		goDetail(item){
			uni.navigateTo({
				url:"./detail?id="+item.id
			})
		}
		
	}
};
</script>

<style lang="scss">
.data {
	width: 710rpx;
	background-color: #ffffff;
	margin: 20rpx auto;
	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 solid #dedede;
		.left {
			display: flex;
			align-items: center;
			.title {
				margin: 0 10rpx;
				font-size: 30rpx;
			}
		}
		.right{
			margin-right: 10rpx;
		}
	}
	.item {
		margin: 5rpx 0 20rpx 0;
		.content {
			border-bottom: 1rpx dashed #DDDDDD;
			padding: 30rpx 0;
		}
	}
	.bottom {
		display: flex;
		margin-top: 30rpx;
		justify-content: flex-end;
		align-items: center;
	}
}
</style>