inheritor.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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/inheritor/Banner.jpg" />
  8. </Slide>
  9. <template #addons>
  10. <Navigation />
  11. <Pagination />
  12. </template>
  13. </Carousel>
  14. <!-- 数据统计 -->
  15. <section class="main-section main-background main-background-type2">
  16. <div class="content">
  17. <div class="title">
  18. <h2>数据统计</h2>
  19. </div>
  20. <SimplePageContentLoader :loader="statsData">
  21. <div class="d-flex row">
  22. <div
  23. class="col-12 col-md-6 col-lg-4 col-xl-4"
  24. v-for="(stat,key) in statsData.content.value"
  25. :key="key"
  26. >
  27. <div :class="`main-card-box type${stat.type}`">
  28. <div class="content">
  29. <h4>{{ stat.title || '\u200b' }}</h4>
  30. <div class="descs">
  31. <div
  32. v-for="(data, key2) in stat.datas"
  33. :key="key2"
  34. @click="data.onClick"
  35. >
  36. <h5>{{ data.title }}</h5>
  37. <p>{{ data.value }}</p>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </SimplePageContentLoader>
  45. </div>
  46. </section>
  47. <!-- 非遗传承 -->
  48. <section class="main-section pb-0">
  49. <div class="content">
  50. <div class="title">
  51. <h2>非遗传承</h2>
  52. </div>
  53. <ThreeImageList :list="list1" />
  54. </div>
  55. </section>
  56. <!-- 世界文化遗产 -->
  57. <section class="main-section pb-0">
  58. <div class="content">
  59. <div class="title">
  60. <h2>世界文化遗产</h2>
  61. </div>
  62. <LeftRightBox
  63. title="世界文化遗产"
  64. :desc="overviewsLoader.content.value?.[0]"
  65. :image="Image9"
  66. :showExpand="false"
  67. :rightItems="heritageData.content.value"
  68. @rightItemDefaultClick="(item) => navTo('/news/detail', { id: item.id })"
  69. @moreClick="navTo('/inheritor/heritage')"
  70. />
  71. </div>
  72. </section>
  73. <!-- 重要相关文物古迹 -->
  74. <section class="main-section pb-0">
  75. <div class="content">
  76. <div class="title">
  77. <h2>重要相关文物古迹</h2>
  78. </div>
  79. <ThreeImageList :list="list2" />
  80. </div>
  81. </section>
  82. <!-- 历史文化街区 -->
  83. <section class="main-section pb-0">
  84. <div class="content">
  85. <div class="title">
  86. <h2>历史文化街区</h2>
  87. </div>
  88. <LeftRightBox
  89. title="历史文化街区"
  90. :desc="overviewsLoader.content.value?.[1]"
  91. :image="Image11"
  92. :showExpand="false"
  93. left
  94. :rightItems="areaData.content.value"
  95. @rightItemDefaultClick="(item) => navTo('/news/detail', { id: item.id })"
  96. @moreClick="navTo('/inheritor/block')"
  97. />
  98. </div>
  99. </section>
  100. <!-- 重要闽南记忆遗产 -->
  101. <section class="main-section">
  102. <div class="content">
  103. <div class="title">
  104. <h2>重要闽南记忆遗产</h2>
  105. </div>
  106. <LeftRightBox
  107. title="重要闽南记忆遗产"
  108. :desc="overviewsLoader.content.value?.[3]"
  109. :image="Image10"
  110. :showExpand="false"
  111. :rightItems="minnanyuLoader.content.value"
  112. @rightItemDefaultClick="(item) => navTo('/news/detail', { id: item.id })"
  113. @moreClick="navTo('/inheritor/language')"
  114. />
  115. </div>
  116. </section>
  117. </div>
  118. </template>
  119. <script setup lang="ts">
  120. import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
  121. import { onMounted, ref } from 'vue';
  122. import Image1 from '@/assets/images/inheritor/Image1.jpg'
  123. import Image2 from '@/assets/images/inheritor/Image2.jpg'
  124. import Image3 from '@/assets/images/inheritor/Image3.jpg'
  125. import Image4 from '@/assets/images/inheritor/Image4.jpg'
  126. import Image5 from '@/assets/images/inheritor/Image5.jpg'
  127. import Image7 from '@/assets/images/inheritor/Image7.jpg'
  128. import Image8 from '@/assets/images/inheritor/Image8.jpg'
  129. import Image9 from '@/assets/images/inheritor/Image9.jpg'
  130. import Image10 from '@/assets/images/inheritor/Image10.jpg'
  131. import Image11 from '@/assets/images/inheritor/Image11.jpg'
  132. import LeftRightBox from '@/components/parts/LeftRightBox.vue';
  133. import ThreeImageList from '@/components/parts/ThreeImageList.vue';
  134. import { usePageAction } from '@/composeable/PageAction';
  135. import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
  136. import CommonContent, { GetColumListParams, GetContentListParams } from '@/api/CommonContent';
  137. import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
  138. import IndexContent from '@/api/introduction/IndexContent';
  139. import SeminarContent from '@/api/inheritor/SeminarContent';
  140. import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
  141. const NO_CONTENT_STRING = '';
  142. const { navTo } = usePageAction();
  143. const carouselConfig = {
  144. itemsToShow: 1,
  145. wrapAround: true,
  146. autoPlay: 5000,
  147. }
  148. const list1 = [
  149. {
  150. title: '非遗项目',
  151. desc: '让文化因传承而永存',
  152. image: Image1,
  153. onClick: () => navTo('/inheritor/projects'),
  154. },
  155. {
  156. title: '非遗传承人',
  157. desc: '让文化因传承而永存',
  158. image: Image2,
  159. onClick: () => navTo('/inheritor/inheritor'),
  160. },
  161. /* {
  162. title: '非遗作品',
  163. desc: '让文化因传承而永存',
  164. image: Image3,
  165. onClick: () => navTo('/inheritor/products'),
  166. },
  167. {
  168. title: '非遗活动',
  169. desc: '让文化因传承而永存',
  170. image: Image4,
  171. onClick: () => navTo('/inheritor/activity'),
  172. }, */
  173. {
  174. title: '非遗传习所',
  175. desc: '让文化因传承而永存',
  176. image: Image5,
  177. onClick: () => navTo('/inheritor/seminar'),
  178. },
  179. ]
  180. const list2 = [
  181. {
  182. title: '不可移动文物',
  183. desc: '让文化因传承而永存',
  184. image: Image7,
  185. onClick: () => navTo('/inheritor/unmoveable'),
  186. },
  187. {
  188. title: '可移动文物',
  189. desc: '让文化因传承而永存',
  190. image: Image8,
  191. onClick: () => navTo('/inheritor/moveable'),
  192. },
  193. {
  194. title: '',
  195. desc: '',
  196. image: ''
  197. },
  198. ]
  199. const areaData = useSimpleDataLoader(async () =>
  200. (await CommonContent.getContentList(new GetContentListParams()
  201. .setModelId(17)
  202. .setMainBodyColumnId(286)
  203. , 1, 6)).list
  204. )
  205. const heritageData = useSimpleDataLoader(async () =>
  206. (await CommonContent.getContentList(new GetContentListParams()
  207. .setModelId(17)
  208. .setMainBodyColumnId(310)
  209. , 1, 6)).list
  210. )
  211. const blockData = useSimpleDataLoader(async () =>
  212. (await CommonContent.getContentList(new GetContentListParams()
  213. .setModelId(17)
  214. .setMainBodyColumnId(286)
  215. , 1, 6)).list
  216. )
  217. const minnanyuLoader = useSimpleDataLoader(async () =>
  218. (await CommonContent.getContentList(new GetContentListParams()
  219. .setModelId(18)
  220. .setMainBodyColumnId(318)
  221. , 1, 6)).list
  222. )
  223. const overviewsLoader = useSimpleDataLoader(async () => {
  224. return [
  225. (await IndexContent.getColumList(
  226. new GetColumListParams()
  227. .setModelId(17)
  228. .setMainBodyColumnId(310)
  229. )).list[0]?.overview || NO_CONTENT_STRING,
  230. (await IndexContent.getColumList(
  231. new GetColumListParams()
  232. .setModelId(17)
  233. .setMainBodyColumnId(286)
  234. )).list[0]?.overview || NO_CONTENT_STRING,
  235. (await IndexContent.getColumList(
  236. new GetColumListParams()
  237. .setModelId(17)
  238. .setMainBodyColumnId(235)
  239. )).list[0]?.overview || NO_CONTENT_STRING,
  240. (await IndexContent.getColumList(
  241. new GetColumListParams()
  242. .setModelId(18)
  243. .setMainBodyColumnId(318)
  244. )).list[0]?.overview || NO_CONTENT_STRING,
  245. ]
  246. });
  247. const statsData = useSimpleDataLoader(async () => {
  248. const data = (await IndexContent.getStats());
  249. const semiCount = (await SeminarContent.getContentList(new GetContentListParams(), 1, 1)).total;
  250. const unmoveableCount = (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 1)).total;
  251. return [
  252. {
  253. title: '非遗代表性项目',
  254. type: '1',
  255. datas: data.ichData.filter((p: any) => [ '人类非遗', '国家级', '省级', '市级' ].includes(p.level_text)).map((item: any) => {
  256. return {
  257. title: item.level_text,
  258. value: item.total,
  259. onClick: () => {
  260. navTo('/inheritor/projects', { level: item.level });
  261. },
  262. }
  263. })
  264. },
  265. {
  266. title: '非遗代表性传承人',
  267. type: '2',
  268. datas: data.inheritorData.filter((p: any) => [ '国家级', '省级', '市级'/* , '区县级' */ ].includes(p.title)).map((item: any) => {
  269. return {
  270. title: item.title,
  271. value: item.total,
  272. onClick: () => {
  273. navTo('/inheritor/inheritor', { level: item.level });
  274. },
  275. }
  276. })
  277. },
  278. {
  279. title: '其他传承项目',
  280. type: '1',
  281. datas: [
  282. {
  283. title: '传习所',
  284. value: semiCount,
  285. onClick: () => navTo('/inheritor/seminar'),
  286. },
  287. {
  288. title: '传统村落',
  289. value: data.villageData[0]?.total ?? 0,
  290. onClick: () => navTo('/village/index'),
  291. },
  292. {
  293. title: '文物古迹',
  294. value: unmoveableCount,
  295. onClick: () => navTo('/inheritor/unmoveable'),
  296. },
  297. ],
  298. },
  299. /* {
  300. title: '不可移动文物',
  301. type: '3',
  302. datas: data.crData.map((item: any) => {
  303. return {
  304. title: item.title,
  305. value: item.total
  306. }
  307. })
  308. },
  309. {
  310. title: '传习中心',
  311. type: '3',
  312. datas: data.ichCenter.map((item: any) => {
  313. return {
  314. title: item.title,
  315. value: item.total
  316. }
  317. })
  318. },
  319. {
  320. title: '闽南文化重要相关文物古迹',
  321. type: '2',
  322. datas: data.minnanCr.map((item: any) => {
  323. return {
  324. title: item.title,
  325. value: item.total
  326. }
  327. })
  328. },
  329. {
  330. title: '重要相关历史风貌区',
  331. type: '1',
  332. datas: data.historyData.map((item: any) => {
  333. return {
  334. title: item.title,
  335. value: item.total
  336. }
  337. })
  338. }, */
  339. ]
  340. });
  341. const carousel3Config = ref({
  342. itemsToShow: 4,
  343. mouseWheel: true,
  344. wrapAround: true,
  345. autoplay: 3000,
  346. });
  347. onMounted(() => {
  348. if (window.innerWidth <= 435) {
  349. carousel3Config.value.itemsToShow = 1;
  350. } else if (window.innerWidth <= 768) {
  351. carousel3Config.value.itemsToShow = 2;
  352. }
  353. })
  354. </script>
  355. <style lang="scss">
  356. @media (max-width: 425px) {
  357. }
  358. </style>