<template>
    <div id="page">
        <header>
            <div class="header-box">
                <img src="@/assets/logo.png" alt="" class="logo" />
                <div class="menus">
                    <div
                        class="menu-item"
                        :class="{ active: routerPath === item.index }"
                        v-for="(item, index) in menus"
                        :key="index"
                        @click="goPath(item)"
                    >
                        <span>{{ item.label }}</span>
                    </div>
                </div>
            </div>
        </header>
        <main>
            <RouterView class="main" />
        </main>
        <footer>
            <div class="footer">
                <div class="footer-left">
                    <div class="text1">联系我们</div>
                    <div class="text2">
                        <img src="@/assets/phone.png" alt="" />
                        <span>电话: 13267002685 </span>
                    </div>
                    <div class="text2">
                        <img src="@/assets/email.png" alt="" />
                        <span>邮箱: 13267002685@qq.com </span>
                    </div>
                    <div class="text2">
                        <img src="@/assets/location.png" alt="" />
                        <span>地址 : 广东省深圳市南山区国人通信大厦A座2楼 </span>
                    </div>
                </div>
                <div class="footer-right">
                    <div class="code">
                        <img src="@/assets/icon1.png" alt="" />
                        <div class="text1">扫描二维码<br /><small>进入RAEX绿洲官网</small></div>
                    </div>
                    <div class="code">
                        <img src="@/assets/icon2.png" alt="" />
                        <div class="text1">扫描二维码<br /><small>关注RAEX绿洲QQ频道</small></div>
                    </div>
                    <div class="code">
                        <img src="@/assets/icon3.png" alt="" />
                        <div class="text1">扫描二维码<br /><small>关注RAEX绿洲公众号</small></div>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">Copyright @ 2023.huachu All rights reserved . 华储艺术品（深圳）</div>
        </footer>
    </div>
</template>

<script setup>
import { RouterView, useRoute, useRouter } from 'vue-router'
import { ref, computed } from 'vue'

const routerPath = computed(() => {
    return useRoute().path
})

const menus = ref([
    {
        label: '首页',
        index: '/home'
    },
    {
        label: '平台公告',
        index: '/news'
    },
    {
        label: '视频先导',
        index: '/video'
    },
    {
        label: '帮助中心',
        index: '/connect'
    },
    {
        label: '关于我们',
        index: '/about'
    }
])

const router = useRouter()
function goPath(info) {
    router.push({
        path: info.index
    })
}
</script>

<style lang="less" scoped>
#page {
    min-width: 1400px;
}
header {
    height: 169px;
    background-color: #0c151b;
    position: sticky;
    top: 0;
    z-index: 20;

    .header-box {
        .f();
        height: 169px;
        padding: 0 50px 0 135px;
        justify-content: space-between;
        .logo {
            width: 274px;
        }

        .menus {
            .f();
            .menu-item {
                font-size: 22px;
                color: #fff;
                width: 200px;
                cursor: pointer;
                text-align: center;
                span {
                    padding: 0 10px;
                    line-height: 75px;
                    position: relative;
                    display: inline-block;
                }

                &.active {
                    color: #00ff12;
                    font-weight: bold;
                    span {
                        &::after {
                            content: '';
                            position: absolute;
                            bottom: 0;
                            left: 0;
                            width: 100%;
                            height: 3px;
                            background: #00ff12;
                        }
                    }
                }
            }
        }
    }
}
.main {
    min-height: calc(100vh - 334px - 169px);
}
footer {
    background: #060e20;
    padding: 72px 380px 42px;
    color: #fff;
    .footer {
        height: 140px;
        width: 100%;
        justify-content: space-between;
        .f();
        .footer-left {
            .text1 {
                font-size: 24px;
                color: #ffffff;
                line-height: 24px;
                margin-bottom: 30px;
            }

            .text2 {
                .f();
                font-size: 16px;
                font-weight: lighter;
                color: #ffffff;
                line-height: 24px;
                img {
                    height: 20px;
                    margin-right: 9px;
                }
            }
            .text2 + .text2 {
                margin-top: 15px;
            }
        }

        .footer-right {
            .f();
            .code {
                margin-left: 13px;
                img {
                    width: 109px;
                    display: block;
                }
                .text1 {
                    font-size: 12px;
                    font-weight: bold;
                    color: #ffffff;
                    line-height: 12px;
                    text-align: center;
                    margin-top: 10px;
                }
            }
        }
    }

    .footer-bottom {
        font-size: 16px;
        font-weight: lighter;
        color: #adadad;
        line-height: 24px;
        padding-top: 63px;
        text-align: center;
    }
}

@media screen and(max-width:1600px) {
    header {
        .header-box {
            padding: 0 50px 0 70px;

            .menus {
                .menu-item {
                    width: 150px;
                    font-size: 18px;
                }
            }
        }
    }
    footer {
        padding: 72px 100px 42px;
    }
}
</style>
