discover.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <view class="home-container page-discover d-flex flex-col bg-base">
  3. <image
  4. class="position-absolute title"
  5. src="https://mncdn.wenlvti.net/app_static/minnan/images/discover/Title.png"
  6. mode="widthFix"
  7. />
  8. <view class="content d-flex flex-col wing-l">
  9. <!-- 文化百科 -->
  10. <HomeTitle title="文化百科" />
  11. <scroll-view scroll-x>
  12. <view class="d-flex flex-row">
  13. <view
  14. v-for="(item, i) in categories"
  15. :key="i"
  16. class="width-150 d-flex flex-col align-center flex-shrink-0"
  17. @click="item.onClick"
  18. >
  19. <image :src="item.icon" class="width-100 height-100" />
  20. <text class="width-130 text-align-center mt-2 color-primary size-s">{{ item.name }}</text>
  21. </view>
  22. </view>
  23. </scroll-view>
  24. <!-- 闽南语猜猜猜 -->
  25. <!-- <view class="home-title">
  26. <text>闽南语猜猜猜</text>
  27. </view>
  28. <Box2LinePlayRightArrow
  29. title="听语音猜词语"
  30. desc="每日更新,赢取积分"
  31. @click="navTo('/pages/article/web/ewebview', {
  32. url: 'https://mncdn.wenlvti.net/assets/addons/yunexamine/h5/#/pages/home/dashboard'
  33. })"
  34. /> -->
  35. <!-- 文化挑战 -->
  36. <HomeTitle title="文化挑战" />
  37. <!--
  38. 方言配音大赛隐藏
  39. <Box2LineRightSlot
  40. title="方言配音大赛"
  41. desc="参与人数:1,234"
  42. @click="navTo('/pages/answer/index')"
  43. >
  44. <image class="width-60 height-60 radius-base" src="https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconCup.png" mode="aspectFill" />
  45. </Box2LineRightSlot> -->
  46. <Box2LineRightSlot
  47. title="非遗百科问答"
  48. desc="可获积分:500"
  49. >
  50. <view class="width-1-5">
  51. <u-button shape="circle" type="primary" @click="navTo('/pages/article/web/ewebview', {
  52. url: 'https://mncdn.wenlvti.net/assets/addons/yunexamine/h5/#/pages/home/dashboard'
  53. })">立即报名</u-button>
  54. </view>
  55. </Box2LineRightSlot>
  56. <!-- 文化社区 -->
  57. <!-- <HomeTitle title="文化社区" />
  58. <SimplePageContentLoader :loader="communityData">
  59. <view class="d-flex w-100 flex-row flex-wrap align-stretch justify-between">
  60. <Box2LineLargeImageUserShadow
  61. v-for="(item, i) in communityData.content.value"
  62. :key="i"
  63. :title="item.title"
  64. :desc="item.desc"
  65. :image="item.thumbnail || item.image"
  66. :userName="item.userName"
  67. :userHead="item.userHead"
  68. :likes="item.likes"
  69. :comment="item.comment"
  70. />
  71. </view>
  72. </SimplePageContentLoader> -->
  73. <!-- 老照片 -->
  74. <HomeTitle title="老照片" showMore @clickMore="goImagesList" />
  75. <SimplePageContentLoader :loader="imagesData">
  76. <scroll-view scroll-x>
  77. <view class="d-flex flex-row">
  78. <view
  79. v-for="(item, i) in imagesData.content.value"
  80. :key="i"
  81. class="mr-2"
  82. @click="goImagesDetail(item.id)"
  83. >
  84. <image
  85. class="width-300 height-200 radius-base"
  86. :src="item.image"
  87. mode="aspectFill"
  88. />
  89. </view>
  90. </view>
  91. </scroll-view>
  92. </SimplePageContentLoader>
  93. <!-- 闽南文化资讯 -->
  94. <HomeTitle title="闽南文化资讯" showMore @clickMore="navTo('/pages/article/list')" />
  95. <SimplePageContentLoader :loader="cultureData">
  96. <view class="d-flex w-100 flex-row flex-wrap align-stretch justify-between">
  97. <Box2LineLargeImageUserShadow
  98. v-for="(item, i) in cultureData.content.value"
  99. :key="i"
  100. :title="item.title"
  101. :desc="item.desc"
  102. :image="item.thumbnail || item.image"
  103. fixSize
  104. @click="goCultureDetail(item.id)"
  105. />
  106. </view>
  107. </SimplePageContentLoader>
  108. <!-- 热门话题 -->
  109. <!-- <HomeTitle title="热门话题" />
  110. <SimplePageContentLoader :loader="topicsData">
  111. <view class="d-flex flex-col">
  112. <Box2LineRightShadow
  113. v-for="(item, i) in topicsData.content.value"
  114. :key="i"
  115. :title="item.title"
  116. :desc="item.desc"
  117. :right="item.right"
  118. />
  119. </view>
  120. </SimplePageContentLoader> -->
  121. </view>
  122. </view>
  123. <tabbar :current="1"></tabbar>
  124. </template>
  125. <script setup lang="ts">
  126. import Tabbar from '@/common/components/tabs/tabbar.vue';
  127. import Box2LineRightShadow from './parts/Box2LineRightShadow.vue';
  128. import Box2LinePlayRightArrow from './parts/Box2LinePlayRightArrow.vue';
  129. import Box2LineRightSlot from './parts/Box2LineRightSlot.vue';
  130. import Box2LineLargeImageUserShadow from './parts/Box2LineLargeImageUserShadow.vue';
  131. import HomeTitle from './parts/HomeTitle.vue';
  132. import { navTo } from '@/common/utils/PageAction';
  133. import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
  134. import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
  135. import { useHomePageMiniCommonListGoMoreAndGoDetail } from './article/common/CommonContent';
  136. import NewsIndexContent from '@/api/news/NewsIndexContent';
  137. import { onShareTimeline, onShareAppMessage } from '@dcloudio/uni-app';
  138. const CategoryIcon1 = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon1.png';
  139. const CategoryIcon2 = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon2.png';
  140. const CategoryIcon4 = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon4.png';
  141. const CategoryIcon5 = 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon5.png';
  142. const ImageTest2 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest2.jpg';
  143. const ImageTest3 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest3.jpg';
  144. const ImageTest4 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest4.jpg';
  145. const ImageTest5 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest5.jpg';
  146. const UserHead = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/UserHead.png';
  147. const categories = [
  148. {
  149. name: '建筑遗产',
  150. icon: CategoryIcon2 ,
  151. onClick: () => navTo('/pages/article/common/list', {
  152. title: '建筑遗产',
  153. mainBodyColumnId: 252,
  154. modelId: 3,
  155. itemType: 'article-common',
  156. detailsPage: '/pages/article/details',
  157. })
  158. },
  159. {
  160. name: '闽南美食',
  161. icon: CategoryIcon4 ,
  162. onClick: () => navTo('/pages/introduction/food/list')
  163. },
  164. {
  165. name: '戏剧曲艺',
  166. icon: 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon6.png',
  167. onClick: () => navTo('/pages/article/common/list', {
  168. title: '戏剧曲艺',
  169. mainBodyColumnId: '240,241',
  170. modelId: 3,
  171. itemType: 'article-common',
  172. detailsPage: '/pages/article/details',
  173. })
  174. },
  175. {
  176. name: '音乐舞蹈',
  177. icon: 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon7.png',
  178. onClick: () => navTo('/pages/article/common/list', {
  179. title: '音乐舞蹈',
  180. mainBodyColumnId: 239,
  181. modelId: 3,
  182. itemType: 'article-common',
  183. detailsPage: '/pages/article/details',
  184. })
  185. },
  186. {
  187. name: '美术技艺',
  188. icon: 'https://mncdn.wenlvti.net/app_static/minnan/images/discover/CategoryIcon8.png',
  189. onClick: () => navTo('/pages/article/common/list', {
  190. title: '美术技艺',
  191. mainBodyColumnId: 314,
  192. modelId: 3,
  193. itemType: 'article-common',
  194. detailsPage: '/pages/article/details',
  195. })
  196. },
  197. {
  198. name: '闽南民俗',
  199. icon: CategoryIcon1 ,
  200. onClick: () => navTo('/pages/introduction/custom/list')
  201. },
  202. {
  203. name: '海洋文化',
  204. icon: CategoryIcon5 ,
  205. onClick: () => navTo('/pages/article/common/list', {
  206. title: '海洋文化',
  207. mainBodyColumnId: 254,
  208. modelId: 3,
  209. itemType: 'article-common',
  210. detailsPage: '/pages/article/details',
  211. })
  212. },
  213. /* {
  214. name: '宗教信俗',
  215. icon: CategoryIcon5 ,
  216. onClick: () => navTo('/pages/article/common/list', {
  217. title: '宗教信俗',
  218. mainBodyColumnId: 248,
  219. modelId: 4,
  220. itemType: 'article-common',
  221. detailsPage: '/pages/article/details',
  222. })
  223. }, */
  224. ];
  225. const communityData = useSimpleDataLoader(async () => {
  226. return [
  227. {
  228. title: '茶艺传承作坊',
  229. desc: '',
  230. image: ImageTest4,
  231. likes: 123,
  232. comment: 66,
  233. userHead: UserHead,
  234. userName: 'Regular',
  235. },
  236. {
  237. title: '茶艺传承作坊',
  238. desc: '',
  239. image: ImageTest2,
  240. likes: 123,
  241. comment: 66,
  242. userHead: UserHead,
  243. userName: 'Regular',
  244. },
  245. {
  246. title: '茶艺传承作坊',
  247. desc: '',
  248. image: ImageTest3,
  249. likes: 123,
  250. comment: 66,
  251. userHead: UserHead,
  252. userName: 'Regular',
  253. },
  254. {
  255. title: '茶艺传承作坊',
  256. desc: '',
  257. image: ImageTest5,
  258. likes: 123,
  259. comment: 66,
  260. userHead: UserHead,
  261. userName: 'Regular',
  262. },
  263. ]
  264. });
  265. const {
  266. loader: cultureData,
  267. goDetail: goCultureDetail,
  268. } = useHomePageMiniCommonListGoMoreAndGoDetail({
  269. title: '闽南文化',
  270. mainBodyColumnId: [228/* , 298, 299 */],
  271. modelId: NewsIndexContent.modelId,
  272. itemType: 'article-common',
  273. detailsPage: '/pages/article/details',
  274. });
  275. const {
  276. loader: imagesData,
  277. goList: goImagesList,
  278. goDetail: goImagesDetail,
  279. } = useHomePageMiniCommonListGoMoreAndGoDetail({
  280. title: '老照片',
  281. mainBodyColumnId: 102,
  282. modelId: 8,
  283. itemType: 'image-large-2',
  284. detailsPage: '/pages/article/details',
  285. });
  286. const topicsData = useSimpleDataLoader(async () => {
  287. return [
  288. {
  289. title: '宗族文化探讨',
  290. desc: '关于闽南宗教的传承与发展',
  291. right: '234 人参与讨论',
  292. },
  293. {
  294. title: '宗族文化探讨',
  295. desc: '关于闽南宗教的传承与发展',
  296. right: '234 人参与讨论',
  297. },
  298. ]
  299. });
  300. onShareTimeline(() => {
  301. return {};
  302. })
  303. onShareAppMessage(() => {
  304. return {};
  305. })
  306. </script>
  307. <style lang="scss">
  308. .page-discover {
  309. > .content {
  310. margin-top: 10vh;
  311. }
  312. > .title {
  313. width: 100rpx;
  314. }
  315. .grid4-item {
  316. width: 330rpx;
  317. }
  318. }
  319. </style>