details.vue 6.9 KB

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