mobile.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <div class="gdmuseum">
  3. <div class="info" v-if="currentMuseum">
  4. <div class="title">
  5. <div>
  6. {{currentMuseum.name}}
  7. <img
  8. :class="isShowDesc ? 'expand' : 'collapse'" src="@/assets/images/icon/down_prompt.png" alt=""
  9. @click="onClickExpandBtn"
  10. >
  11. </div>
  12. </div>
  13. <p v-show="isShowDesc">
  14. {{currentMuseum.description || '暂无简介'}}
  15. </p>
  16. </div>
  17. <component
  18. :key="panelPage" class="limitwidth" :is="panelPage"
  19. :currentMuseumItem="currentMuseum"
  20. ></component>
  21. </div>
  22. <teleport to='body' >
  23. <vtab @handleTab="handleTab" :list="menu" class="tabcon" />
  24. </teleport>
  25. </template>
  26. <script setup>
  27. import { ref, reactive, onMounted, watch, computed, nextTick } from "vue";
  28. import vtab from "@/components/tab/mobile.vue";
  29. import { getMuseumDetail } from "@/config/api";
  30. import collections from "./exhibition/mobile/collections";
  31. import guide from "./exhibition/mobile/guide";
  32. import permanent from "./exhibition/mobile/permanent";
  33. import review from "./exhibition/mobile/review";
  34. import temporary from "./exhibition/mobile/temporary";
  35. const panelPage = ref(permanent)
  36. const currentMuseum = ref(null)
  37. const menu = ref([
  38. {
  39. name: "常设展览",
  40. id: "permanent",
  41. component: permanent
  42. },
  43. {
  44. name: "临时展览",
  45. id: "temporary",
  46. component: temporary
  47. },
  48. {
  49. name: "展览回顾",
  50. id: "review",
  51. component: review
  52. },
  53. {
  54. name: "藏品展示",
  55. id: "collections",
  56. component: collections
  57. },
  58. {
  59. name: "展馆导览",
  60. id: "guide",
  61. component: guide
  62. },
  63. ]);
  64. const isShowDesc = ref(true)
  65. let handleTab = (data) => {
  66. console.log(data, "data");
  67. panelPage.value = data.component
  68. };
  69. const onClickExpandBtn = () => {
  70. isShowDesc.value = !isShowDesc.value
  71. }
  72. onMounted(() => {
  73. getMuseumDetail({
  74. id: 1,
  75. }, data => {
  76. currentMuseum.value = data.data
  77. })
  78. })
  79. </script>
  80. <style lang="scss" scoped>
  81. .gdmuseum {
  82. background: #e8e3d1;
  83. overflow-y: auto;
  84. overflow-x: hidden;
  85. height: calc(100% - 60px);
  86. .info {
  87. padding-top: 20px;
  88. width: 90%;
  89. margin: 0 auto;
  90. > .title {
  91. font-size: 18px;
  92. font-weight: bold;
  93. color: var(--main-color);
  94. text-align: center;
  95. position: relative;
  96. text-align: center;
  97. > div {
  98. display: inline-block;
  99. > img {
  100. position: absolute;
  101. right: calc(-1 * (15px + 17px));
  102. top: 11px;
  103. width: 17px;
  104. height: 9px;
  105. &.collapse {
  106. transform: rotate(180deg);
  107. }
  108. }
  109. }
  110. }
  111. >p {
  112. width: 100%;
  113. line-height: 1.8;
  114. font-size: 16px;
  115. margin-top: 16px;
  116. text-indent: 32px;
  117. color: #333333;
  118. text-align: justify;
  119. }
  120. }
  121. }
  122. .tabcon {
  123. position: fixed;
  124. bottom: 20px;
  125. left: 5%;
  126. width: 30%;
  127. z-index: 9999;
  128. }
  129. </style>