details.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <DetailTabPage
  3. :load="load"
  4. :extraTabs="[
  5. {
  6. id: 5,
  7. name: '获得奖项',
  8. visible: true,
  9. },
  10. {
  11. id: 6,
  12. name: '非遗项目',
  13. visible: true,
  14. },
  15. {
  16. id: 7,
  17. name: '传习所',
  18. visible: true,
  19. }
  20. ]"
  21. :showHead="false"
  22. >
  23. <template #extraTabs="{ content, tabCurrentId }">
  24. <template v-if="tabCurrentId==5">
  25. <!-- 获得奖项 -->
  26. <u-parse :content="content.prize" :tagStyle="commonParserStyle"></u-parse>
  27. </template>
  28. <template v-else-if="tabCurrentId==6">
  29. <!-- 非遗项目 -->
  30. <CommonListPage
  31. :showSearch="false"
  32. :hasBg="false"
  33. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
  34. detailsPage="/pages/inhert/intangible/details"
  35. :detailsParams="{
  36. mainBodyColumnId: ProjectsContent.mainBodyColumnId,
  37. modelId: ProjectsContent.modelId,
  38. }"
  39. />
  40. </template>
  41. <template v-else-if="tabCurrentId==6">
  42. <!-- 传习所 -->
  43. <CommonListPage
  44. :showSearch="false"
  45. :hasBg="false"
  46. :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
  47. detailsPage="/pages/inhert/intangible/details"
  48. :detailsParams="{
  49. mainBodyColumnId: SeminarContent.mainBodyColumnId,
  50. modelId: SeminarContent.modelId,
  51. }"
  52. />
  53. </template>
  54. </template>
  55. <template #title="{ content }">
  56. <view class="d-flex flex-col">
  57. <view class="d-flex flex-row justify-between">
  58. <view class="d-flex flex-col">
  59. <text class="size-lll font-bold color-text-content">{{ content.title }}</text>
  60. <text class="size-base color-text-content-second mt-2">{{ content.birthplace || content.desc }}</text>
  61. <RoundTags
  62. :tags="content.tags"
  63. :tags2="[
  64. content.age as string,
  65. content.nation as string
  66. ]"
  67. />
  68. </view>
  69. <image
  70. class="width-150 height-150 radius-base flex-shrink-0"
  71. :src="content.image" mode="aspectFill"
  72. />
  73. </view>
  74. </view>
  75. </template>
  76. <template #titleExtra="{ content }">
  77. <IntroBlock
  78. small
  79. :descItems="[
  80. {
  81. label: '民族',
  82. value: content.nation,
  83. },
  84. {
  85. label: '性别',
  86. value: content.gender == '1'? '男' : '女',
  87. },
  88. {
  89. label: '出生日期',
  90. value: content.dateBirth,
  91. },
  92. {
  93. label: '出生地区',
  94. value: content.birthplace,
  95. },
  96. {
  97. label: '单位',
  98. value: content.unit,
  99. },
  100. {
  101. label: '传承项目',
  102. value: content.associationMeList[0]?.title,
  103. },
  104. {
  105. label: '传承人级别',
  106. value: content.levelText,
  107. },
  108. {
  109. label: '公布批次',
  110. value: content.batchText,
  111. },
  112. ]"
  113. />
  114. </template>
  115. </DetailTabPage>
  116. </template>
  117. <script setup lang="ts">
  118. import type { TabControlItem } from "@/common/composeabe/TabControl";
  119. import type { Ref } from "vue";
  120. import RoundTags from "@/pages/parts/RoundTags.vue";
  121. import commonParserStyle from "@/common/style/commonParserStyle";
  122. import SeminarContent from "@/api/inheritor/SeminarContent";
  123. import InheritorContent from "@/api/inheritor/InheritorContent";
  124. import ProjectsContent from "@/api/inheritor/ProjectsContent";
  125. import IntroBlock from "@/pages/article/common/IntroBlock.vue";
  126. import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
  127. import CommonListPage from "@/pages/article/common/CommonListPage.vue";
  128. async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
  129. const d = await InheritorContent.getContentDetail(id);
  130. tabsArray.value[4].visible = Boolean(d.prize);
  131. tabsArray.value[5].visible = Boolean(d.associationMeList && d.associationMeList.length > 0);
  132. tabsArray.value[6].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
  133. return d;
  134. }
  135. async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
  136. const list = (content[subList] as any[] || [])
  137. .slice((page - 1) * pageSize, page * pageSize);
  138. list.forEach((p) => {
  139. p.bottomTags = [
  140. p.levelText,
  141. p.ichTypeText,
  142. p.batchText
  143. ];
  144. });
  145. return {
  146. list,
  147. total: list.length,
  148. }
  149. }
  150. </script>
  151. <style lang="scss">
  152. </style>