<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 ">
						<text class="text-bold">员工姓名：</text>
						<text>{{item.realName}}</text>
					</view>
				</view>
				<view class="right">
					<text class="" v-if="item.auditStatus==1">已通过</text>
					<text style="color: #ea7500;" v-if="item.auditStatus==0">待审核</text>
					<text style="color: #da0000;" v-if="item.auditStatus==2">未通过</text>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view style="padding: 20rpx 30rpx 0;">
						<view  v-if="item.face" class="">
							<image @click.stop="$util.preview(item.face)" style="width: 140rpx;height: 140rpx;" :src="item.face" mode=""></image>
						</view>
						<view class="content">
							<text class="padding-right-10">所属企业：</text>
							<text >{{item.enterpriseName}}</text>
						</view>
						<view class="content">
							<text class="padding-right-10">联系方式：</text>
							<text>{{item.phone}}</text>
							<image @click.stop="call(item.phone)" class="call" src="/static/index/call.png" ></image>
						</view>
						<view class="content">
							<text class="padding-right-10">备注：</text>
							<text style="line-height: 50rpx;">{{item.remarks}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="bottom" >
				<!-- 待审核，显示取消工单 -->
				<view @click.stop="pass(item)" v-if="item.auditStatus==0" style="font-size: 22rpx;" class="cu-btn  sm round base-bg-color  margin-right-20" >
					审核通过
				</view>
				<view @click.stop="fail(item)" v-if="item.auditStatus==0" style="font-size: 22rpx;" class="cu-btn  sm round bg-red " >
					审核不通过
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'card',
	props:{
		list:{
			type:Array,
			default:()=>{
				[]
			}
		}
	},
	data() {
		return {
			
		};
	},
	onLoad() {
		
	},
	methods:{
		call(phone){
			uni.makePhoneCall({
				phoneNumber:phone
			})
		},
		goDetail(item){
			uni.navigateTo({
				url:"/pages/index/staffAudit/detail?id="+item.id
			})
		},
		pass(item){
			this.$emit('pass',item)
		},
		fail(item){
			this.$emit('fail',item)
		}
	}
};
</script>

<style lang="scss">
.bg-blue{
	background-color: #59a5f0;
	color: #FFFFFF;
}

	
.data {
	width: 710rpx;
	background-color: #ffffff;
	margin: 20rpx auto;
	border-radius: 6rpx;
	box-sizing: border-box;
	padding: 20rpx;
	font-size: 28rpx;
	.top {
		display: flex;
		justify-content: space-between;
		padding-bottom: 20rpx;
		border-bottom: 1rpx dashed  #EEEEEE;
		.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: 20rpx 0 ;
			
			.call{
				width: 36rpx;
				height: 36rpx;
				margin-left: 40rpx;
				margin-top: 10rpx;
			}
		}
	}
	.bottom {
		
		display: flex;
		margin-top: 30rpx;
		justify-content: flex-end;
		align-items: center;
	}
}
</style>
