<template>
    <div class="alert-wrapper" v-if="showAlert">
        <div class="alert">
            <div class="wait-title">
                当前人气太旺了<br/>请您稍后再试试
            </div>
            <div class="wait-img">
                <img src="http://wechatapppro-1252524126.file.myqcloud.com/apppcHqlTPT3482/image/4a542df850eecfd23ca2961fec7afc83.png" alt="等待图片">
            </div>
            <div class="wait-button" @click="showAlert=false">知道了</div>
        </div>
    </div>
</template>

<script>
import EventBus from '../../libs/eventbus';

export default {
    data () {
        return {
            showAlert: false,
        };
    },
    created() {
        EventBus.$on('seckillWait', () => {
            this.showAlert = true;
        });
    },
};
</script>

<style scoped>
    .alert-wrapper {
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 21;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .alert {
        width: 5.6rem;
        height: 6.05rem;
        background: #fff;
        border-radius: 0.08rem;
        text-align: center;
        position: relative;
        font-size: 0.36rem;
    }
    .wait-title {
        margin-top: 0.5rem;
        line-height: 0.5rem;
    }
    .wait-img {
        width: 3rem;
        height: 2.5rem;
        margin: 0.54rem auto 0.6rem;
    }
    .wait-img > img {
        width: 100%;
        height: 100%;
    }
    .wait-button {
        height: 0.9rem; 
        line-height: 0.9rem;
        color: #2A75ED;
        border-top: 0.01rem solid rgba(229,229,229,1);
    }
</style>
