home.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="home-container page-home d-flex flex-col bg-base">
  3. <image
  4. class="w-100 position-absolute"
  5. src="/static/images/home/BackgroundBanner.jpg"
  6. mode="widthFix"
  7. />
  8. <image
  9. class="w-60 position-absolute title"
  10. src="/static/images/home/Title.png"
  11. mode="widthFix"
  12. />
  13. <view class="content d-flex flex-col wing-l">
  14. <!-- 分栏 -->
  15. <view class="shadow-l radius-l bg-base p-3">
  16. <image
  17. class="w-100"
  18. src="/static/images/home/MainBanner.jpg"
  19. mode="widthFix"
  20. @click="navTo('home/introduction')"
  21. />
  22. <view class="position-relative d-flex flex-row flex-wrap justify-between mt-3">
  23. <view
  24. v-for="(tab, k) in subTabs1"
  25. :key="k"
  26. class="d-flex flex-column align-center width-1-5 mt-2"
  27. @click="tab.onClick"
  28. >
  29. <image class="width-100" :src="tab.icon" mode="widthFix" />
  30. <text class="color-second-text mt-2">{{ tab.name }}</text>
  31. </view>
  32. <Box1AudioPlay class="w-100 mt-3 mb-3" title="里厚吖:你好呀" />
  33. <view
  34. v-for="(tab, k) in subTabs2"
  35. :key="k"
  36. class="d-flex flex-column align-center width-1-5 mt-2"
  37. @click="tab.onClick"
  38. >
  39. <image class="width-100" :src="tab.icon" mode="widthFix" />
  40. <text class="color-second-text mt-2">{{ tab.name }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. <!-- 文化地图
  45. <HomeTitle title="文化地图" />
  46. <view class="position-relative radius-l overflow-hidden">
  47. <map
  48. class="w-100 height-400"
  49. />
  50. <view class="position-absolute map-tags d-flex flex-row">
  51. <view class="active">
  52. <text class="iconfont icon-read" />
  53. 文物
  54. </view>
  55. <view>
  56. <text class="iconfont icon-task-trip" />
  57. 非遗
  58. </view>
  59. <view>
  60. <text class="iconfont icon-tougao-01" />
  61. 传习所
  62. </view>
  63. </view>
  64. </view> -->
  65. <!-- 近期活动 -->
  66. <HomeTitle title="近期活动" />
  67. <SimplePageContentLoader :loader="activityLoader">
  68. <view
  69. class="d-flex flex-col shadow-l radius-l bg-base p-3"
  70. v-for="(item, k) in activityLoader.content.value"
  71. :key="k"
  72. >
  73. <image
  74. class="w-100 radius-base"
  75. :src="item.image"
  76. mode="widthFix"
  77. />
  78. <view class="d-flex flex-row justify-between mt-3">
  79. <text class="color-primary size-l">{{ item.title }}</text>
  80. <text class="color-primary">剩余名额:{{item.count}}</text>
  81. </view>
  82. <view class="d-flex flex-row justify-between align-center mt-3">
  83. <view class="d-flex flex-one flex-col">
  84. <view class="d-flex flex-row align-center">
  85. <image :src="IconLocation" class="width-30 height-30 mr-3" />
  86. <text class="color-second size-l">{{ item.location }}</text>
  87. </view>
  88. <text class="color-second">
  89. <text class="iconfont icon-time mr-2" />
  90. {{ item.time }}
  91. </text>
  92. </view>
  93. <view class="width-1-5">
  94. <u-button shape="circle" type="primary">立即报名</u-button>
  95. </view>
  96. </view>
  97. </view>
  98. </SimplePageContentLoader>
  99. <!-- 精彩推荐 -->
  100. <HomeTitle title="精彩推荐" />
  101. <SimplePageContentLoader :loader="recommendLoader">
  102. <view class="d-flex flex-row justify-between flex-wrap">
  103. <view
  104. v-for="(tab, k) in recommendLoader.content.value"
  105. :key="k"
  106. class="grid4-item position-relative mb-3"
  107. >
  108. <text
  109. class="tag bg-mask-white color-primary radius-l p-2 position-absolute size-s"
  110. >
  111. {{ tab.title }}
  112. </text>
  113. <image
  114. class="w-100 radius-base"
  115. :src="tab.image"
  116. mode="widthFix"
  117. />
  118. </view>
  119. </view>
  120. </SimplePageContentLoader>
  121. </view>
  122. </view>
  123. <tabbar :current="0"></tabbar>
  124. </template>
  125. <script setup lang="ts">
  126. import Tabbar from '@/common/components/tabs/tabbar.vue';
  127. import MainBoxIcon1 from '/static/images/home/MainBoxIcon1.png';
  128. import MainBoxIcon2 from '/static/images/home/MainBoxIcon2.png';
  129. import MainBoxIcon3 from '/static/images/home/MainBoxIcon3.png';
  130. import MainBoxIcon4 from '/static/images/home/MainBoxIcon4.png';
  131. import MainBoxIcon5 from '/static/images/home/MainBoxIcon5.png';
  132. import MainBoxIcon6 from '/static/images/home/MainBoxIcon6.png';
  133. import MainBoxIcon7 from '/static/images/home/MainBoxIcon7.png';
  134. import MainBoxIcon8 from '/static/images/home/MainBoxIcon8.png';
  135. import ImageTest from '/static/images/home/ImageTest.jpg';
  136. import HomeTitle from '@/pages/parts/HomeTitle.vue';
  137. import IconLocation from '/static/images/inhert/IconLocation.png';
  138. import Box1AudioPlay from '@/pages/parts/Box1AudioPlay.vue';
  139. import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
  140. import { navTo } from '@/common/utils/PageAction';
  141. import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
  142. import CommonContent, { GetContentListParams } from '@/api/CommonContent';
  143. const subTabs1 = [
  144. {
  145. name: '闽南语',
  146. icon: MainBoxIcon1,
  147. onClick: () => navTo('/pages/article/common/list', {
  148. title: '闽南语',
  149. mainBodyColumnId: 0,
  150. modelId: 0,
  151. itemType: 'article-common',
  152. detailsPage: '/pages/video/details',
  153. })
  154. },
  155. {
  156. name: '古早味',
  157. icon: MainBoxIcon2,
  158. onClick: () => navTo('/pages/article/common/list', {
  159. title: '古早味',
  160. mainBodyColumnId: 0,
  161. modelId: 0,
  162. itemType: 'article-common',
  163. detailsPage: '/pages/article/details',
  164. })
  165. },
  166. { name: '先贤列传', icon: MainBoxIcon3, onClick: () => navTo('/pages/introduction/character') },
  167. {
  168. name: '民俗活动',
  169. icon: MainBoxIcon4,
  170. onClick: () => navTo('/pages/article/common/list', {
  171. title: '民俗活动',
  172. mainBodyColumnId: 0,
  173. modelId: 0,
  174. itemType: 'article-common',
  175. detailsPage: '/pages/article/details',
  176. })
  177. },
  178. ]
  179. const subTabs2 = [
  180. {
  181. name: '红砖厝韵',
  182. icon: MainBoxIcon5 ,
  183. onClick: () => navTo('/pages/article/common/list', {
  184. title: '红砖厝韵',
  185. mainBodyColumnId: 0,
  186. modelId: 0,
  187. itemType: 'article-common',
  188. detailsPage: '/pages/article/details',
  189. })
  190. },
  191. {
  192. name: '薪传匠艺',
  193. icon: MainBoxIcon6 ,
  194. onClick: () => navTo('/pages/article/common/list', {
  195. title: '薪传匠艺',
  196. mainBodyColumnId: 0,
  197. modelId: 0,
  198. itemType: 'article-common',
  199. detailsPage: '/pages/article/details',
  200. })
  201. },
  202. {
  203. name: '工夫茶道',
  204. icon: MainBoxIcon7 ,
  205. onClick: () => navTo('/pages/article/common/list', {
  206. title: '工夫茶道',
  207. mainBodyColumnId: 0,
  208. modelId: 0,
  209. itemType: 'article-common',
  210. detailsPage: '/pages/article/details',
  211. })
  212. },
  213. {
  214. name: '文化地图',
  215. icon: MainBoxIcon8 ,
  216. onClick: () => navTo('/pages/article/common/list', {
  217. title: '文化地图',
  218. mainBodyColumnId: 0,
  219. modelId: 0,
  220. itemType: 'article-common',
  221. detailsPage: '/pages/article/details',
  222. })
  223. },
  224. ]
  225. const activityLoader = useSimpleDataLoader(async () => {
  226. //TODO: 活动接口
  227. return [
  228. {
  229. title: '茶艺传承工坊',
  230. image: ImageTest,
  231. count: 8,
  232. content: '这是一个活动的内容',
  233. time: '2025年06月16日 12:00',
  234. location: '湖里创新园',
  235. link: '/pages/article/details',
  236. }
  237. ]
  238. })
  239. const recommendLoader = useSimpleDataLoader(async () => {
  240. return (await CommonContent.getContentList(new GetContentListParams().setSelfValues({
  241. flag: 'recommend',
  242. }), 1, 6)).list
  243. });
  244. </script>
  245. <style lang="scss">
  246. .page-home {
  247. .map-tags {
  248. left: 0;
  249. top: 0;
  250. padding: 20rpx;
  251. view {
  252. border-radius: 40rpx;
  253. padding: 10rpx 20rpx;
  254. background-color: #f7f3e8;
  255. color: #d9492e;
  256. margin-right: 10rpx;
  257. &.active {
  258. background-color: #d9492e;
  259. color: #f7f3e8;
  260. }
  261. }
  262. }
  263. .grid4-item {
  264. width: 320rpx;
  265. .tag {
  266. top: 2rpx;
  267. right: 2rpx;
  268. }
  269. }
  270. }
  271. </style>