<template>
    <div class="qrWrapper">
        <vueQr class="qr" :text="JSON.stringify(signInInfo)" :callback="test" @click="caleImage" ref="vueQr"> </vueQr>
        <div @click="caleImage" class="qrWra"></div>
        <div>点击二维码可放大</div>
        <div v-if="toggle"  @click="toggle = !toggle" class="bigQr">
            <!-- <div class="closeImage" @click="toggle = !toggle">X</div> -->
            <img width="400px" height="400px" class="imgInfo" :src="qrImage" alt="" />
        </div>
    </div>
</template>

<script>
import vueQr from 'vue-qr'
export default {
    props: {
        signInInfo: String,
    },
    components: {
        vueQr,
    },
    computed: {},
    created() {
    },
    data() {
        return {
            countDown: 300,
            toggle: false,
            openTime: '',
            qrImage: '',
        }
    },
    computed: {
        countDownShow() {
            return (5 * 60 * 1000 - this.countDown / (60 * 1000)).toFixed(1)
        },
    },
    methods: {
        test(a, b) {
            this.qrImage = a
        },
        caleImage() {
            this.toggle = !this.toggle
        },
    },
}
</script>

<style scoped>
.closeImage {
    position: absolute;
    right: 30px;
    top: 10px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}
.qrWrapper {
    width: 100%;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-items: center;
    align-items: center;
}

.qr {
    height: 200px;
    width: 200px;
}
.bqr {
    width: 600px;
    height: 600px;
}
.scle {
    color: aqua;
    cursor: pointer;
}
.bigQr {
    position: fixed;
    z-index: 3;
    width: 100%;
    height: 100%;
    top: 0;
    display: flex;
    background-color: rgba(17, 17, 17, 0.63);
}
.qrWra {
    width: 200px;
    height: 200px;
    position: absolute;
    top: 70px;
    z-index: 2;
}
.imgInfo{
    margin-left: 50%;
    transform: translateX(-50%);
    margin-top: 100px;
}
</style>