<template>
    <div class="hesuan">
        <div class="userInfo">
            <div class="title">个人信息</div>
            <div class="info">
                <div class="name">姓名：{{this.name}}</div>
                <div class="idCard">身份证号：{{this.idCard}}</div>
            </div>
        </div>
        <div class="cardContent">
            <div class="card" v-if="this.mockData.hsjcsj">
                <div class="date">
                    <img class="dateImg" src="./img/date.png" alt="">
                    <div class="dateText">{{mockData.hsjcsj}}</div>
                </div>
                <div class="check">
                    <div class="jigou">
                        检测机构：<span>{{mockData.hsjcjgmc}}</span>
                    </div>
                    <div class="jieguo" v-if="mockData.hsjcjg == '阴性'">
                        检测结果：<span class="yinxing">{{mockData.hsjcjg}}</span>
                    </div>
                    <div class="jieguo" v-if="mockData.hsjcjg == '阳性'">
                        检测结果：<span class="yangxing">{{mockData.hsjcjg}}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import axios from "axios"
import { encryptByDES } from "@/utils/utils";
export default {
    data() {
        return {
            name: this.$route.query.name,
            idCard: this.$route.query.idCard,
            mockData: {}
        }
    },
    created() {
        this.init()
    },
    methods: {
        init() {
            axios({
                url: 'https://appointment.smart-zj.cn/applet/applet/epidemic/queryExamineResult',
                method: 'get',
                headers: {
                    'Content-Type': "application/json",
                },
                params: {
                    idCard: encryptByDES(this.$route.query.idCard, "MnuYbhGv"),
                    name: this.$route.query.name
                }
            }).then((res) => {
                if (res.data.status == 100) {
                    this.mockData = res.data.data
                }
            }).catch({})
        }
    },
}
</script>

<style lang="stylus" scoped>
.hesuan{
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #F3F6F9;
    .userInfo{
		background: url('./img/hesuanBg.png');
		background-size: 100% 100%;
		width: 100%;
		height: 340px;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		padding: 0 30px;
		box-sizing: border-box;
        .title{
            font-size: 32px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #FFFFFF;
        }
        .info{
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: space-around;
            font-size: 28px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #FFFFFF;
            margin: 20px 0;
            .name{
                margin: 20px 0;
            }
            .idcard{
                margin-bottom: 20px;
            }
        }
	}
    .cardContent{
		width: 96%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
        .card{
            width: 100%;
            background-color: #FFFFFF;
            padding: 0 30px;
            box-sizing: border-box;
            margin-top: 20px;
            font-size: 28px;
            .date{
                display: flex;
                align-items: center;
                padding: 30px 0;
                border-bottom: 1px solid #DDDDDD;
                .dateImg{
                    width: 40px;
                    height: 40px;
                }
                .dateText{
                    font-size: 32px;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #333333;
                    margin-left: 10px;
                }
            }
            .check{
                display: flex;
                flex-direction: column;
                .jigou{
                    margin: 20px 0;
                }
                .jieguo{
                    margin-bottom: 30px;
                }
                .yinxing{
                    font-size: 30px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #29A400;
                }
                .yangxing{
                    font-size: 30px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #ED0000;
                }
            }
        }
	}
}
</style>