IntrodView.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <!-- 文化常识页 -->
  3. <div class="main-background main-background-type0">
  4. <!-- 轮播 -->
  5. <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
  6. <Slide class="main-header-box small">
  7. <img src="@/assets/images/introduction/Banner.jpg" />
  8. </Slide>
  9. <template #addons>
  10. <Navigation />
  11. <Pagination />
  12. </template>
  13. </Carousel>
  14. <!-- 历史和地理背景 -->
  15. <section class="main-section main-background pb-0">
  16. <div class="content">
  17. <div class="title">
  18. <h2>历史和地理背景</h2>
  19. </div>
  20. <LeftRightBox
  21. title="闽南历史和地理背景"
  22. :desc="overviewsLoader.content.value?.[0]"
  23. :image="Image1"
  24. :rightItems="historyData.content.value"
  25. @rightItemDefaultClick="(item) => navTo('/news/detail', { id: item.id })"
  26. @moreClick="navTo('/introduction/history')"
  27. />
  28. </div>
  29. </section>
  30. <!-- 闽南方言 -->
  31. <section class="main-section main-background pb-0">
  32. <div class="content">
  33. <div class="title">
  34. <h2>闽南方言</h2>
  35. </div>
  36. <LeftRightBox
  37. title="闽南方言"
  38. :desc="overviewsLoader.content.value?.[1]"
  39. :image="Image2"
  40. left
  41. :rightItems="languageData.content.value"
  42. @rightItemDefaultClick="(item) => navTo('/news/detail', { id: item.id })"
  43. @moreClick="navTo('/introduction/language')"
  44. />
  45. </div>
  46. </section>
  47. <!-- 文化专题 -->
  48. <section class="main-section main-background">
  49. <div class="content">
  50. <div class="title">
  51. <h2>文化专题</h2>
  52. </div>
  53. <ThreeImageList :list="list" />
  54. </div>
  55. </section>
  56. </div>
  57. </template>
  58. <script setup lang="ts">
  59. import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
  60. import IndexContent from '@/api/introduction/IndexContent';
  61. import Image1 from '@/assets/images/introduction/Image1.jpg';
  62. import Image2 from '@/assets/images/introduction/Image2.jpg';
  63. import CategoryImage1 from '@/assets/images/introduction/CategoryImage1.jpg';
  64. import CategoryImage2 from '@/assets/images/introduction/CategoryImage2.jpg';
  65. import CategoryImage3 from '@/assets/images/introduction/CategoryImage3.jpg';
  66. import CategoryImage4 from '@/assets/images/introduction/CategoryImage4.jpg';
  67. import CategoryImage5 from '@/assets/images/introduction/CategoryImage5.jpg';
  68. import CategoryImage6 from '@/assets/images/introduction/CategoryImage6.jpg';
  69. import CategoryImage7 from '@/assets/images/introduction/CategoryImage7.jpg';
  70. import LeftRightBox from '@/components/parts/LeftRightBox.vue';
  71. import ThreeImageList from '@/components/parts/ThreeImageList.vue';
  72. import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
  73. import { GetColumListParams, GetContentListParams } from '@/api/CommonContent';
  74. import { NO_CONTENT_STRING } from '@/common/ConstStrings';
  75. import { usePageAction } from '@/composeable/PageAction';
  76. import HistoryContent from '@/api/introduction/HistoryContent';
  77. import LanguageContent from '@/api/introduction/LanguageContent';
  78. const { navTo } = usePageAction();
  79. const carouselConfig = {
  80. itemsToShow: 1,
  81. wrapAround: true,
  82. autoPlay: 5000,
  83. }
  84. const list = [
  85. {
  86. title: '历史人物',
  87. desc: '让文化因传承而永存',
  88. image: CategoryImage1,
  89. onClick: () => navTo('/introduction/character'),
  90. },
  91. {
  92. title: '民间习俗',
  93. desc: '让文化因传承而永存',
  94. image: CategoryImage2,
  95. onClick: () => navTo('/introduction/custom'),
  96. },
  97. {
  98. title: '艺术特色',
  99. desc: '让文化因传承而永存',
  100. image: CategoryImage3,
  101. onClick: () => navTo('/introduction/feature'),
  102. },
  103. {
  104. title: '建筑文化',
  105. desc: '让文化因传承而永存',
  106. image: CategoryImage4,
  107. onClick: () => navTo('/introduction/building'),
  108. },
  109. {
  110. title: '饮食文化',
  111. desc: '让文化因传承而永存',
  112. image: CategoryImage5,
  113. onClick: () => navTo('/introduction/victuals'),
  114. },
  115. {
  116. title: '海洋文化',
  117. desc: '让文化因传承而永存',
  118. image: CategoryImage6,
  119. onClick: () => navTo('/introduction/sea'),
  120. },
  121. {
  122. title: '闽南文化百科',
  123. desc: '让文化因传承而永存',
  124. image: CategoryImage7,
  125. onClick: () => navTo('/introduction/book'),
  126. }
  127. ]
  128. const historyData = useSimpleDataLoader(async () =>
  129. (await HistoryContent.getContentList(new GetContentListParams().setMainBodyColumnId([ 233, 250, 251 ]), 1, 6)).list
  130. )
  131. const languageData = useSimpleDataLoader(async () =>
  132. (await LanguageContent.getContentList(new GetContentListParams(), 1, 6)).list
  133. )
  134. const overviewsLoader = useSimpleDataLoader(async () => {
  135. return [
  136. (await IndexContent.getColumList(
  137. new GetColumListParams()
  138. .setModelId(14)
  139. .setMainBodyColumnId(233)
  140. )).list[0]?.overview || NO_CONTENT_STRING,
  141. (await IndexContent.getColumList(
  142. new GetColumListParams()
  143. .setModelId(5)
  144. .setMainBodyColumnId(235)
  145. )).list[0]?.overview || NO_CONTENT_STRING,
  146. ]
  147. });
  148. </script>