<template>
	<view class='waiting-method-page'>
		<visitor-list @clickEvent="getVisitorListData" @dataEvent="setVisitorListData" ref="visitors" :add="true"></visitor-list>

		<uni-card v-if="visitor_id==0 || (visitor_id!=0 && visitor_id==item.id)" v-for="(item,key) in visitor_list" :title="item.name" :extra="'身份证：'+item.idcard_txt"  :class="((visitor_list && item.h_list && item.h_list.length>0)?'':'empty')" margin="0 0 0rpx 0" shadow="none" :border="false" padding="24rpx">
			<visitor-account v-for="(item2,key2) in item.h_list" :depart_id="item2.depart_id" :visitor_id="item.id" :thumb="cssUrl+'hicon.svg'" v-if="visitor_list && item.h_list && item.h_list.length>0" :errmsg="(!item2.weeks ? '' : ' '+(item2.weeks<=10?item2.weeks:('超过10')))+'周未看病，请及时复诊'"></visitor-account>
		</uni-card>


		<!-- <uni-card title="上官子涵" extra="身份证：9098******8778" margin="0 0 20rpx 0" shadow="none" :border="false" padding="24rpx" class="">
			<visitor-account :thumb="cssUrl+'hicon.svg'"></visitor-account>
		</uni-card>

		<uni-card title="上官子涵" extra="身份证：9098******8778" margin="0 0 20rpx 0" shadow="none" :border="false" padding="24rpx" class="">
			<visitor-account :thumb="cssUrl+'hicon.svg'" errmsg="4周未看病，请及时复诊"></visitor-account>
		</uni-card>

		<uni-card title="上官子涵" extra="身份证：9098******8778" margin="0 0 20rpx 0" shadow="none" :border="false" padding="24rpx" class="">
			<visitor-account :thumb="cssUrl+'hicon.svg'" errmsg="4周未看病，请及时复诊"></visitor-account>
			<visitor-account :thumb="cssUrl+'hicon.svg'" errmsg="4周未看病，请及时复诊"></visitor-account>
		</uni-card> -->


		<view class="bt btPadding"></view>

	</view>
</template>

<script>
	import visitorList from '@/components/visitorList.vue'
	import visitorAccount from '@/components/visitorAccount.vue'

	export default {
		data() {
			return {
				collapseValue:0,
				html:'就诊须知',
				cssUrl:this.cssUrl,
				depart_id:0,
				hospital_depart_name:'',
				visitor_list:false,
				value:'',
				visitor_id:0,
				type: 0,
				types: [{
					text: '等医生叫号',
					value: 0
				}, {
					text: '找床位候诊',
					value: 1
				}],
			}
		},
		components:{
			visitorList,
			visitorAccount
		},
		onLoad(option) {
		},
		onReady() {
			this.pageInit()
		},
		methods: {
			pageInit() {
				this.$refs.visitors.getVisitors()
			},
			changeCollapse(e) {
				console.log(e);
			},
			setVisitorListData(e) {
				this.visitor_list = e
			},
			getVisitorListData(visitor_id){
				this.visitor_id = visitor_id
				console.log(visitor_id)
			}
		}
	}
</script>

<style lang="scss" scoped>
.waiting-method-page{
	overflow: hidden;
	::v-deep {
		.uni-card{
			border-radius: 0;
			padding: 34rpx 42rpx !important;
			margin-bottom: 20rpx !important;
			.uni-collapse-item__title-arrow{
				margin-right: 0;
			}
			.uni-collapse-item{
				background: #F9FAFB;
			}

			&.empty{
				.uni-card__content{
					display: none;
				}
			}
			.uni-collapse-item__title-wrap{
				width: calc(100% - 40rpx);
			}
			.uni-card__content{
				padding: 0 !important;
				background: white;
			}
			.uni-collapse-item__title{
				background: #F9FAFB;
				&.uni-collapse-item-border{
					border: none;
				}
			}
			.uni-collapse-item__title-img{
				width: 32rpx;
				height: 32rpx;
				margin-right: 12rpx;
			}
			.uni-collapse-item__title-box{
				padding: 0;
				background: #F9FAFB;
				height: 39rpx;
				line-height: 39rpx;
				color: #333333;
				font-size: 28rpx;
				letter-spacing: 2rpx;
				font-weight: 600;
			}
			@supports (-webkit-touch-callout: none) {
				.uni-collapse-item__title-box{
					font-weight: 500;
				}
			}
			.uni-card__header{
				border: none;
				padding: 0;
				.uni-card__header-extra .uni-card__header-extra-text{
					font-size: 24rpx;
					font-weight: normal;
					line-height: normal;
					letter-spacing: 0.14rpx;
					color: #949699;
				}

				.uni-card__header-content .uni-card__header-content-title{
					font-weight: 600;
					line-height: 42rpx;
					font-size: 32rpx;
					color: #333333;
					&:before{
						content: '';
						display: inline-block;
						width: 8rpx;
						height: 34rpx;
						z-index: 0;
						border-radius: 10rpx;
						background: #58CA7F;
						position: relative;
						top: 5rpx;
						margin-right: 12rpx;
					}
				}
			}
		}
	}
	.h-name{
		padding: 36rpx 24rpx;
		box-sizing: border-box;
		width: 100%;
		height: 116rpx;
		margin-bottom: 20rpx;
		background: white;
		display: flex;
		align-items: center;
		font-size: 32rpx;
		color: #000000;
	}
	.title-wrap{
		width: 100%;
		height: 100rpx;
	}
	.submit{
		position: fixed;
		width: 100%;
		top: 82.41%;
		.submitbtn{
			width: 666rpx;
			margin: 0 auto;
		}
		.tip{
			text-align: center;
			font-size: 28rpx;
			color: #B3B4BC;
			margin-top: 33rpx;
		}
	}
}
</style>
