index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div ref="layoutRef" class="layout" @scroll="scrollEvent">
  3. <!-- 顶部 -->
  4. <div class="layout-header" :style="{ background: $route.meta.navBgColor }">
  5. <img
  6. class="layout-header__menu"
  7. src="./images/mean.png"
  8. @click="sidebarVisible = true"
  9. />
  10. <img
  11. class="layout-header__logo"
  12. src="@/assets/images/logo.png"
  13. @click="$router.push({ name: 'Home' })"
  14. />
  15. <div class="layout-header__right">
  16. <img src="./images/zhong.png" @click="goToCNWeb" />
  17. <img src="./images/search.png" @click="searchVisible = true" />
  18. </div>
  19. </div>
  20. <div v-if="noticeVisible" class="notice">
  21. <VanNoticeBar
  22. mode="closeable"
  23. left-icon="volume-o"
  24. color="#ffffff"
  25. :delay="3"
  26. background="rgb(116, 18, 11)"
  27. text="Due to permanent exhibition refurbishment, our museum has been closed since October 7, 2023. We have also temporarily closed the reservation channel. The specific reopening time will be announced separately. We apologize for any inconvenience this may cause."
  28. @close="noticeVisible = false"
  29. />
  30. </div>
  31. <RouterView />
  32. <!-- 回到顶部 -->
  33. <div class="toTop" v-show="srocllShow" @click="toTop">
  34. <VanIcon name="back-top" />
  35. </div>
  36. <!-- 底部 -->
  37. <div class="layout-bottom">
  38. <img
  39. class="layout-bottom__logo"
  40. src="@/assets/images/logo.png"
  41. @click="$router.push({ name: 'Home' })"
  42. />
  43. <div class="layout-bottom__qrcode">
  44. <img src="./images/erwei1.png" alt="" />
  45. <img src="./images/erwei2.png" alt="" />
  46. </div>
  47. <p>
  48. Capital Museum. China 16 Fuxingmenwai Street, Xicheng District, Beijing
  49. 100045, P.R.China.
  50. </p>
  51. <ul class="layout-bottom__link">
  52. <li>
  53. <RouterLink :to="{ name: 'Use' }">Terms of Use</RouterLink>
  54. </li>
  55. <li>
  56. <RouterLink :to="{ name: 'Events' }">Events</RouterLink>
  57. </li>
  58. <li>
  59. <RouterLink :to="{ name: 'Employment' }">Employment</RouterLink>
  60. </li>
  61. </ul>
  62. </div>
  63. </div>
  64. <Sidebar
  65. v-model:visible="sidebarVisible"
  66. @goToCNWeb="goToCNWeb"
  67. @openSearch="searchVisible = true"
  68. />
  69. <Search v-model:visible="searchVisible" @confirm="sidebarVisible = false" />
  70. </template>
  71. <script lang="ts" setup>
  72. import { ref } from "vue";
  73. import { debounce } from "lodash-unified";
  74. import Sidebar from "./components/Sidebar/index.vue";
  75. import Search from "./components/Search/index.vue";
  76. const layoutRef = ref();
  77. const noticeVisible = ref(false);
  78. const sidebarVisible = ref(false);
  79. const searchVisible = ref(false);
  80. const srocllShow = ref(false);
  81. const toTop = () => {
  82. const dom = layoutRef.value;
  83. dom.scrollTo({ top: 0, behavior: "smooth" });
  84. };
  85. const scrollEvent = debounce(() => {
  86. const dom = layoutRef.value;
  87. if (dom.scrollTop > 400) srocllShow.value = true;
  88. else srocllShow.value = false;
  89. }, 200);
  90. const goToCNWeb = () => {
  91. window.open("https://www.capitalmuseum.org.cn/", "_blank");
  92. };
  93. </script>
  94. <style lang="scss">
  95. @import "./index.scss";
  96. </style>