<!-- 删除，单元，修改，添加，管理功能皆未实现 -->
<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 align-center justify-center">
						<image @click.stop="preview(item)" v-if="item.imageUri" style="width: 60rpx;height: 60rpx; border-radius: calc(8rpx);" :src="$global.getImgBaseUrl()+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">
					<text class="text-orange" v-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 align-center">
							<u-icon name="xiaoqu" custom-prefix="custom-icon" size="30" color="#2fc500"></u-icon>
							<text style="width: 25%;" class="text-bold padding-left-10">房屋信息：</text>
							<text style="line-height: 42rpx;">{{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.tel" ></text>
							<text @click="$util.call(item.tel)" class="padding-left-10 text-blue" style="text-decoration: underline;">拨打</text>
						</view>
					</view>
				</view>
			</view>
			<view class="bottom flex" >
				<!-- 待审核 -->
				<view @click.stop="pass(item.id)" v-if="item.checkState==0" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
					审核通过
				</view>
				<view @click.stop="fail(item.id)" v-if="item.checkState==0" class="cu-btn  sm round bg-base" 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:{
		preview(item){
			let img=this.$global.getImgBaseUrl()+item.imageUri
			this.$util.preview(img)
		},
		goDetail(item){
			getApp().globalData.userAuthData=item
			uni.navigateTo({
				url:"detail"
			})
		},
		copy(data){
			uni.setClipboardData({
				data:data
			})
		},
		pass(id){
			let params={
				id:id,
				checkState:1
			}
			this.$emit('pass',params)
		},
		fail(id){
			let params={
				id:id,
				checkState:2
			}
			this.$emit('fail',params)
		}
		
	}
};
</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>