<template>
	<view class="head-base-info">
		<view class="base-one">
			<view class="patient-base">
				<text class="patient-base-icon">PID:</text>
				<text>{{patientInfo.patientId ? patientInfo.patientId : ''}}</text>
			</view>
		</view>
		<view class="base-two">
			<view class="patient-base">
				<uni-icons class="patient-base-icon" custom-prefix="iconfont" type="icon-gerenxinxi" size="20"
					color="#b6d8f6"></uni-icons>
				<text>{{patientInfo.patientName ? patientInfo.patientName : '-'}} / </text>
				<text> {{patientInfo.patientSex ? patientInfo.patientSex : '-'}} / </text>
				<text> {{patientInfo.patientBirthday ? patientInfo.patientBirthday : '-'}}</text>
			</view>
		</view>
		<view class="base-three">
			<uni-icons custom-prefix="iconfont" type="icon-shoushudao" size="20" color="#b6d8f6"></uni-icons>
			<view class="OD_OS" v-if="patientInfo.operaTypeList">
				<view class="shoushu-name" v-for="(item,index) in patientInfo.operaTypeList" :key="index">
					<text class="sy-text">{{item.eyeType}}:</text>
					<text class="shoushu-text" v-for="(itex,i) in item.operaEntityList"
						:key="i">{{itex.bieMing}}</text>
				</view>
			</view>
			
		</view>
		<view class="base-four">
			<view class="patient-base">
				<text class="patient-base-icon">主刀医师:</text>
				<text>{{patientInfo.mainDoctorName ? patientInfo.mainDoctorName : ''}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "headInfo",
		data() {
			return {
				patientInfo: {},
			};
		},
		created() {},
		methods: {
			async getPatientInfo(scanCodeData) {
				// 0:等待呼叫，1:呼叫中，2:术前，3:术中，4:术后，5离开
				const res = await this.$baseAPI.request(`${this.$portAdress.pda}/${scanCodeData.patientID}`)
				if (res.code === 0) {
					this.patientInfo = res.data
					console.log('--------',this.patientInfo);
				} else {
					uni.showToast({
						icon: 'none',
						title: res.msg
					})
				}
			},
		}
	}
</script>

<style lang="less" scoped>
	.head-base-info {
		background-color: #002648;
		padding: 16rpx 48rpx;
		color: #fff;

		.base-one,
		.base-two,
		.base-three{
			display: flex;
			border: 1px solid #4b657e;
			border-radius: 16rpx;
			margin-bottom:14rpx
		}

		.patient-base-icon {
			color: #b6d8f6;
			font-weight: 700;
			margin-right: 20rpx;
		}

		.patient-base {
			background-color: #12395a;
			border-radius: 20rpx;
			height: 78rpx;
			line-height: 78rpx;
		}
		.patient-base,
		.shoushu-name {
			flex: 1;
			padding-left: 28rpx;
			overflow: hidden;
			display: flex;

			.sy-text {
				width: 95rpx;
			}
		}

		.shoushu-name:nth-child(1) {
			margin-bottom: 10rpx
		}

		.base-three {
			background-color: #12395a;
			padding: 20rpx;
			border: 1px solid #4b657e;
			border-radius: 16rpx;
			display: flex;
			align-items: center;
		}

	}
</style>
