123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <div class="main">
- <div class="left">
- <!-- post -->
- <n-carousel
- dot-placement="bottom"
- style="width: 100%; height: 100%"
- autoplay
- draggable
- >
- <img
- class="carousel-img"
- style="width: 100%; height: 100%; object-fit: cover"
- src="img/show_banner.png"
- />
- <template v-for="item in posters">
- <img
- class="carousel-img"
- style="width: 100%; height: 100%; object-fit: cover"
- :src="domain + item.filePath"
- />
- </template>
- </n-carousel>
- </div>
- <div class="right">
- <div class="home_logo">
- <img :src="Logo" />
- </div>
- <n-space class="navigate" justify="flex-start" align="center">
- <n-button class="btn btn_1" @click="push('/info')" text>
- 场馆资讯</n-button
- >
- <n-button class="btn btn_2" @click="push('/exhibition')" text>
- 展厅导览</n-button
- >
- <n-button class="btn btn_3" @click="push('/collect')" text>
- 馆藏精品
- </n-button>
- <n-button class="btn btn_4" @click="push('/survey')" text>
- 问卷调查</n-button
- >
- <n-button class="btn btn_5" @click="push('/feedback')" text>
- 留言反馈</n-button
- >
- </n-space>
- </div>
- </div>
- </template>
- <script setup>
- import { computed, onBeforeMount, onMounted, ref } from "vue";
- import { useRoute, useRouter } from "vue-router";
- import { useInfoStore } from "../store/info";
- import Logo from "../assets/logo.png";
- const { push } = useRouter();
- const InfoStore = useInfoStore();
- const posters = computed(() => InfoStore.poster.data || []);
- const domain = ref(import.meta.env.VITE_DOMAIN_URL);
- onMounted(async () => {
- await InfoStore.getPoster();
- });
- </script>
- <style>
- .main {
- --main-home-left-background: #e2caa3;
- --main-home-right-background: #910000;
- --main-right-border: 10px;
- --main-right-bg-img: url("/img/h_banner_bg.png");
- --main-right-bg-btn1: url("/img/guide_1.png");
- --main-right-bg-btn2: url("/img/guide_2.png");
- --main-right-bg-btn3: url("/img/guide_3.png");
- --main-right-bg-btn4: url("/img/guide_4.png");
- --main-right-bg-btn5: url("/img/guide_5.png");
- --main-navigate-btn-width: 11.3125rem;
- --main-navigate-btn-height: 6.3125rem;
- }
- </style>
- <style lang="scss" scoped>
- .main {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: row;
- }
- .left {
- flex: 1 1 70%;
- background-color: var(--main-home-left-background);
- }
- .right {
- flex: 0 0 416px;
- width: 416px;
- // background-color: var(--main-home-right-background);
- border-top: var(--main-right-border) solid var(--main-home-right-background);
- border-bottom: var(--main-right-border) solid
- var(--main-home-right-background);
- background-image: var(--main-right-bg-img);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: bottom right;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- position: relative;
- .home_logo {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- img {
- display: block;
- margin-top: 46px;
- height: 4.5rem;
- }
- }
- .navigate {
- margin-top: 30px;
- width: calc(var(--main-navigate-btn-width) * 2 + 16px);
- }
- :deep(.btn) {
- color: transparent;
- width: var(--main-navigate-btn-width);
- height: var(--main-navigate-btn-height);
- background-size: contain;
- background-repeat: no-repeat;
- padding: 0;
- margin: 0;
- &:hover {
- border: none;
- }
- &.btn_1 {
- background-image: var(--main-right-bg-btn1);
- }
- &.btn_2 {
- background-image: var(--main-right-bg-btn2);
- }
- &.btn_3 {
- background-image: var(--main-right-bg-btn3);
- }
- &.btn_4 {
- background-image: var(--main-right-bg-btn4);
- }
- &.btn_5 {
- background-image: var(--main-right-bg-btn5);
- }
- }
- }
- :deep(.n-carousel .n-carousel__dots.n-carousel__dots--dot .n-carousel__dot) {
- width: 3.25rem;
- border-radius: 10px;
- --n-dot-color: #c5c5c5;
- --n-dot-color-active: var(--main-primary-color);
- }
- </style>
|