<template>
	<div>
		<common @asynCallBack="asynCallBack"></common>
		<top-header :pageTitle="pageTitle" :rightLink="rightLink" :doRightLink="doRightLink"></top-header>

		<div class="mui-content fyy-detail-content mui-fullscreen">
			<div class="mui-content-padded fyynew-detail">
				<div class="fyynew-detail-photo">
					<div class="fyynew-detail-region">
						<img :src="detail.faceImage">
					</div>
				</div>
				<div class="fyynew-detail-title" :style="detail.fever?'background: rgba(254,97,108,0.6);':'background: rgba(5,200,175,0.6);'"
				 v-text="detail.fever?'检测异常':'检测正常'"></div>
				<div class="fyynew-detail-wendu" :style="'background-color:'+detail.fever?'#fe616c':'#05c8af'" v-text="detail.temperature"></div>
				<div class="fyynew-detail-text">
					<h4 v-text="detail.personName"></h4>
					<ul class="mui-table-view fyy-view">
						<li class="mui-table-view-cell">
							<label>检测时间</label>
							<span v-text="detail.recordTime"></span>
						</li>
						<li class="mui-table-view-cell">
							<label>设备名称</label>
							<span v-text="detail.deviceName"></span>
						</li>
					</ul>
				</div>
			</div>
		</div>

		<loading :visible="isLoading"></loading>
	</div>
</template>

<script>
	import * as API_Health from '@/apis/Common/health'
	import Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: 'CommonHealthTemperatureInfo',
		components: {
			Common,
			Loading,
			TopHeader
		},
		data() {
			return {
				pageTitle: '详情',

				isLoading: false,

				rightLink: {
					show: true,
					icon: 'icon-tongji',
					style: 'font-size:14px',
					title: '健康统计'
				},

				detail: {},

				subForm: {
					id: this.$route.query.id
				},
			}
		},
		created() {

		},
		methods: {
			//获取详情
			getInfo() {
				this.isLoading = true;
				API_Health.getTemperatureInfo(this.subForm).then(response => {
					this.detail = response;
					this.isLoading = false;
				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			//右上角点击事件
			doRightLink() {
				this.$router.push({
					name: 'CommonHealthCert',
					query: {}
				})
			},
			asynCallBack() {},
		},
		mounted() {
			this.getInfo();
		},
		destroyed() {},
		computed: {
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
				company_data: 'company_data',
			})
		}
	}
</script>

<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style scoped src="$project/assets/css/sczpfyy.css"></style>
<style scoped src="$project/assets/css/iconfont.css"></style>
<style scoped>
</style>
