<template>
	<view class="app">
		<view class="item">
			<view class="text">
				患者姓名：{{item.patientName?item.patientName:''}}
			</view>
			<view class="text">
				患者电话：
				{{item.patientPhone?item.patientPhone:''}}
			</view>
			<view class="text">
				家属电话：
				{{item.familyMemberPhone?item.familyMemberPhone:''}}
			</view>
			<view class="text">
				身份证号：
				{{item.cardNo?item.cardNo:''}}
			</view>
			<view class="text">
				年龄：
				{{item.age?item.age:''}}
			</view>
			<view class="text">
				是否签约：
				{{item.signStatus?item.signStatus:''}}
			</view>
			<view class="text">
				签约时间：
				{{item.signTime?item.signTime:''}}
			</view>
			<view class="text">
				主治医生：
				{{item.attendingPhysicianName?item.attendingPhysicianName:''}}
			</view>
			<view class="text">
				就诊医院：
				{{item.hospitalAgencyName?item.hospitalAgencyName:''}}
			</view>
			<view class="text">
				就诊科室：
				{{item.departmentName?item.departmentName:''}}
			</view>
			<view class="text">
				就诊时间：
				{{item.visitDate?item.visitDate:''}}
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getHealthRecordInfoById
	} from '@/api/healthRecords/index.js'
	import {
		parseTime
	} from '@/api/time.js'
	export default {
		data() {
			return {
				item: {}
			};
		},
		onLoad(options) {
			this.info(options.id)
		},
		methods: {
			info(id) {
				getHealthRecordInfoById(id).then(res => {
					this.item = res.data
					this.item.visitDate ? this.item.visitDate = parseTime(this.item.visitDate,
						'{y}-{m}-{d} {h}:{i}:{s}') : ''
					this.item.signTime ? this.item.signTime = parseTime(this.item.signTime,
						'{y}-{m}-{d} {h}:{i}:{s}') : ''
				})
			},
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #F4F5F7;
	}

	.app {
		.item {
			background-color: #fff;
			width: 95%;
			margin: 20rpx auto;
			border-radius: 10rpx;
			padding: 30rpx;

			.text {
				line-height: 70rpx;
			}
		}
	}
</style>