details.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="d-flex flex-col h-100vh">
  3. <SimplePageContentLoader :loader="loader">
  4. <template v-if="loader.content.value">
  5. <view class="banner">
  6. <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="2000" :duration="1000">
  7. <swiper-item v-for="(item, key) in loader.content.value.images" :key="key">
  8. <view class="item">
  9. <ImageWrapper :src="item" mode="aspectFill" width="750rpx" />
  10. </view>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="d-flex flex-col p-3">
  15. <view class="intro-block artifact-info">
  16. <HomeTitle :title="loader.content.value.title" />
  17. <view class="desc no-indent">
  18. <view class="navigation">
  19. <view class="address">
  20. <text class="iconfont icon-navigation"></text>
  21. <text>{{ loader.content.value.address }}</text>
  22. </view>
  23. <view class="link">
  24. 去这里 <text class="iconfont icon-go"></text>
  25. </view>
  26. </view>
  27. <view class="entry">
  28. <view class="label">开放时间:</view>
  29. <view class="value">{{ loader.content.value.openStatusText }}</view>
  30. </view>
  31. <view class="entry">
  32. <view class="label">年代:</view>
  33. <view class="value">{{ loader.content.value.age }} 年)</view>
  34. </view>
  35. <view class="entry">
  36. <view class="label">文物类型:</view>
  37. <view class="value">{{ loader.content.value.crTypeText }}</view>
  38. </view>
  39. <view class="entry">
  40. <view class="label">所属区域:</view>
  41. <view class="value">{{ loader.content.value.regionText }}</view>
  42. </view>
  43. <view class="entry">
  44. <view class="label">级别:</view>
  45. <view class="value">{{ loader.content.value.levelText }}</view>
  46. </view>
  47. <view class="entry">
  48. <view class="label">保护范围:</view>
  49. <view class="value">
  50. </view>
  51. </view>
  52. <u-parse :content="loader.content.value.protectedArea" :tagStyle="commonParserStyle"></u-parse>
  53. </view>
  54. </view>
  55. <view class="intro-block">
  56. <view class="title">
  57. <view class="line"></view>
  58. <text class="sm">简介</text>
  59. </view>
  60. <view class="desc">
  61. <u-parse :content="loader.content.value.intro" :tagStyle="commonParserStyle"></u-parse>
  62. </view>
  63. <view class="sub-title">详情</view>
  64. <view class="desc">
  65. <u-parse :content="loader.content.value.value" :tagStyle="commonParserStyle"></u-parse>
  66. </view>
  67. </view>
  68. <HomeTitle title="更多人气好去处" showMore />
  69. <view class="rec-list">
  70. <swiper class="swiper" :autoplay="false" :circular="false" :duration="500"
  71. :next-margin="'145rpx'">
  72. <swiper-item v-for="item in loader.content.value.associationMeList" :key="item.id" @click="goDetails(item)">
  73. <view class="item">
  74. <image :src="item.image" mode="aspectFill"></image>
  75. <view class="name">
  76. <text>{{ item.title }}</text>
  77. </view>
  78. </view>
  79. </swiper-item>
  80. </swiper>
  81. </view>
  82. <HomeTitle title="本地吃透透" showMore />
  83. <view class="food-list">
  84. <view class="item" v-for="item in foodList" :key="item.id">
  85. <image :src="item.image" mode="aspectFill"></image>
  86. <view class="info">
  87. <view class="name">{{ item.name }}</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. </SimplePageContentLoader>
  94. </view>
  95. </template>
  96. <script setup lang="ts">
  97. import type { GetContentDetailItem } from "@/api/CommonContent";
  98. import { useSimplePageContentLoader } from "@/common/composeabe/SimplePageContentLoader";
  99. import { onLoad } from "@dcloudio/uni-app";
  100. import { navTo } from "@/common/utils/PageAction";
  101. import UnmoveableContent from "@/api/inheritor/UnmoveableContent";
  102. import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
  103. import ImageWrapper from "@/common/components/ImageWrapper.vue";
  104. import HomeTitle from "@/pages/parts/HomeTitle.vue";
  105. import commonParserStyle from "@/common/style/commonParserStyle";
  106. import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
  107. const loader = useSimplePageContentLoader<
  108. GetContentDetailItem,
  109. { id: number }
  110. >(async (params) => {
  111. if (!params)
  112. throw new Error("!params");
  113. return await UnmoveableContent.getContentDetail(params.id);
  114. });
  115. useLoadQuerys({ id : 0, }, (p) => loader.loadData(p));
  116. function goDetails(item: any) {
  117. navTo('inherit_artifact_details', { id: item.id })
  118. }
  119. const foodList = [
  120. {
  121. id: 1,
  122. image: 'https://lucheng.app4lh.cn/static/tmp/static/tmp/food1.png',
  123. name: '沙茶面',
  124. },
  125. {
  126. id: 2,
  127. image: 'https://lucheng.app4lh.cn/static/tmp/static/tmp/food2.png',
  128. name: '碗糕',
  129. },
  130. {
  131. id: 3,
  132. image: 'https://lucheng.app4lh.cn/static/tmp/static/tmp/food1.png',
  133. name: '姜母鸭',
  134. },
  135. {
  136. id: 4,
  137. image: 'https://lucheng.app4lh.cn/static/tmp/static/tmp/food2.png',
  138. name: '炸枣',
  139. }
  140. ];
  141. </script>
  142. <style lang="scss" scoped>
  143. page {
  144. background: #FFF3E1;
  145. }
  146. .food-list {
  147. display: flex;
  148. justify-content: space-between;
  149. flex-wrap: wrap;
  150. .item {
  151. width: calc(50% - 15rpx);
  152. margin-bottom: 53rpx;
  153. image {
  154. width: 100%;
  155. height: 360rpx;
  156. display: block;
  157. }
  158. .info {
  159. text-align: center;
  160. padding-top: 20rpx;
  161. font-weight: bold;
  162. font-size: 30rpx;
  163. color: #312520;
  164. }
  165. }
  166. }
  167. .rec-list {
  168. swiper {
  169. height: 300rpx;
  170. }
  171. .item {
  172. width: 514rpx;
  173. height: 300rpx;
  174. position: relative;
  175. border-radius: 20rpx;
  176. overflow: hidden;
  177. background-color: #eaeaea;
  178. image {
  179. width: 100%;
  180. height: 100%;
  181. }
  182. .name {
  183. position: absolute;
  184. bottom: 34rpx;
  185. right: 22rpx;
  186. color: #fff;
  187. font-weight: 600;
  188. font-size: 28rpx;
  189. }
  190. }
  191. }
  192. .intro-block {
  193. margin-bottom: 38rpx;
  194. .title{
  195. .sm{
  196. font-size: 30rpx;
  197. }
  198. }
  199. &.artifact-info{
  200. .desc{
  201. line-height: inherit;
  202. padding-bottom: 10rpx;
  203. }
  204. }
  205. .entry {
  206. display: flex;
  207. flex-direction: row;
  208. justify-content: space-between;
  209. margin-bottom: 10rpx;
  210. .label {
  211. color: #666666;
  212. font-weight: 400;
  213. font-size: 28rpx;
  214. }
  215. .value {
  216. font-size: 28rpx;
  217. color: #312520;
  218. font-weight: 400;
  219. }
  220. }
  221. .sub-title{
  222. margin-left: 20rpx;
  223. margin-top: 10rpx;
  224. font-size: 30rpx;
  225. font-weight: 600;
  226. }
  227. .desc{
  228. padding:30rpx;
  229. }
  230. .navigation{
  231. display: flex;
  232. align-items: center;
  233. margin-bottom: 28rpx;
  234. .address{
  235. flex:1;
  236. height: auto;
  237. background: #F9F6EB;
  238. border-radius: 28rpx;
  239. font-weight: 400;
  240. font-size: 24rpx;
  241. color: #000000;
  242. line-height: 48rpx;
  243. padding-left: 30rpx;
  244. display: flex;
  245. align-items: center;
  246. text.iconfont{
  247. display: inline-block;
  248. font-size: 36rpx;
  249. margin-right: 8rpx;
  250. }
  251. }
  252. .link{
  253. margin-left: 20rpx;
  254. color:#FF8719;
  255. }
  256. }
  257. }
  258. .banner {
  259. margin-top: 0;
  260. .swiper {
  261. border-radius: 0;
  262. height: 504rpx;
  263. }
  264. }
  265. </style>