<template>
    <div style="background:#fff">
        <div class="HeadContent" :style="{height:isLogin?'119px':'100px',lineHeight:isLogin?'119px':'100px'}">
            <div class="Head">
                <img class="logo" @click="goIndex" src="../assetsPre/logo.png" alt="">
                <div class="line">
                    |
                </div>
                <div class="welcome">
                    {{title?title:'欢迎登陆'}}
                </div>
            </div>

        </div>
    </div>

</template>

<script>
import logo from '../components/Logo'
export default {
    name: 'page404',
    data() {
        return {
            title: ''
        }
    },
    created() {
        if (this.$route.name == 'login') {
            this.isLogin = true
            this.title = ''
        } else if (this.$route.query.title) {
            this.isLogin = false
            this.title = this.$route.query.title
            document.title = this.$route.query.title
        }
        else {
            this.isLogin = false
            this.title = this.$route.meta.title
        }
    },
    watch: {
        $route() {
            if (this.$route.name == 'login') {
                this.isLogin = true
                this.title = ''
            } else if (this.$route.query.title) {
                this.isLogin = false
                this.title = this.$route.query.title
                document.title = this.$route.query.title
            }
            else {
                this.isLogin = false
                this.title = this.$route.meta.title
            }
        }
    },
    computed: {

    },
    methods: {
        goIndex() {
            this.$router.push('/index')
        }
    },
    components: {
        logo
    }
}
</script>

<style lang="less" scoped>
.HeadContent {
    box-shadow: 0px 1px 2px 0px rgba(199, 199, 199, 0.5);
    width: 100%;
}
.Head {
    width: 1183px;
    margin: auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 1);
    height: 100%;
    font-size: 0;

    .logo {
        width: 300px;
        height: 54px;
        vertical-align: middle;
        display: inline-block;
        cursor: pointer;
    }

    .line {
        font-size: 30px;
        font-family: PingFangSC-Regular;
        color: rgba(102, 102, 102, 1);
        line-height: 42px;
        margin: 8px 0 8px 22px;
        vertical-align: middle;
        display: inline-block;
    }
    .welcome {
        line-height: 40px;
        font-size: 30px;
        font-family: MicrosoftYaHei;
        color: rgba(102, 102, 102, 1);
        margin: 9px 0 9px 14px;
        vertical-align: middle;
        display: inline-block;
    }
}
</style>
