<template>
	<view class="flex gap-16 info">
		<view class="police-info-avatar">
			<net-image :filepath="people.avatarUrl" v-if="people.avatarUrl" />
			<image src="/static/police.png" v-else></image>
		</view>
		<view style="width: calc(100% - 168rpx)">
			<view>
				<view class="row">
					<view class="col col-12">
						<view class="label">姓名：</view>
						<view class="content">{{ people.name }}</view>
					</view>
					<view class="col col-12">
						<view class="label">警号：</view>
						<view class="content">{{ people.empNo }}</view>
					</view>
					<view class="col col-12">
						<view class="label">所属单位：</view>
						<view class="content">{{ people.departName }}</view>
					</view>
					<view class="col col-12">
						<view class="label">职位：</view>
						<view class="content">{{ people.position }}</view>
					</view>
					<view class="col col-24">
						<view class="label">联系电话：</view>
						<view class="content">
							<view v-if="people.mobile" @tap.stop="callPhone(people.mobile)">{{ people.mobile }}</view>
							<view v-else>/</view>
						</view>
					</view>
				</view>

			</view>
		</view>
	</view>
	<view class="container">
		<view class="row">
			<view class="col col-24">
				<view class="label">测酒时间：</view>
				<view class="content">{{ people.testingTime }}</view>
			</view>
			<view class="col col-12">
				<view class="label">检测情况：</view>
				<view class="content">
					<view v-if="people.testingResult === '未检测'" style="color: var(--danger-color)">{{ people.testingResult }}</view>
					<view v-else>{{ people.testingResult }}</view>
				</view>
			</view>
			<view class="col col-12">
				<view class="label">是否饮酒：</view>
				<view class="content">
					<uni-tag :text="people.drinkResult" type="success" v-if="people.drinkResult === '未饮酒'" />
					<uni-tag :text="people.drinkResult" type="error" v-else />
				</view>
			</view>
			<view class="col col-12" v-if="people.alcoholContent">
				<view class="label">酒精含量：</view>
				<view class="content">{{ people.alcoholContent }}</view>
			</view>
			<view class="col col-24" v-if="people.unTestingDesc">
				<view class="label">未检测原因：</view>
				<view class="content">{{ people.unTestingDesc }}</view>
			</view>
			<view class="col col-24" v-if="people.isIllegalBanquet">
				<view class="label">是否违规宴请：</view>
				<view class="content">{{ people.isIllegalBanquet }}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import store from '@/store'
	
	import {
		updateTestingAlcoholPeople
	} from '@/api/testingAlcohol'
	
	let _this;
	export default {
		data() {
			return {
				people: JSON.parse(this.$page.options.people)
			}
		},
		onLoad() {
			_this = this;
		},
		methods: {
			callPhone(phoneNumber) {
				uni.makePhoneCall({phoneNumber})
			}
		}
	}
</script>

<style lang="scss">
	.info {
		padding: 12px;
		box-shadow: inset 0 -1px 0 0 #eee;
	}
	.police-info-avatar {
		width: 136rpx;
		height: 205rpx;
		image {
			width: 100%;
			height: 100%;
		}
	}
</style>