jianZhuXQ.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="body">
  3. <u-navbar :autoBack="true" :title="list.title" bgColor="rgba(255,255,255,0.3)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
  4. <view>
  5. <u-swiper
  6. :list="imageList"
  7. imgMode="aspectFill"
  8. :height="200"
  9. :indicator="true"
  10. :autoplay="true"
  11. :circular="true"
  12. indicatorStyle="bottom: 25px"
  13. @click="bannerClick"
  14. indicatorMode="dot"
  15. indicatorActiveColor="#fff"
  16. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  17. ></u-swiper>
  18. </view>
  19. <view class="box">
  20. <view class="" style="display: flex; align-items: center; color: #640000; font-size: 24rpx; margin-left: 28rpx; margin-top: 30rpx">
  21. <view style="margin-right: 20rpx; font-weight: 700; font-size: 36rpx">
  22. {{ list.title }}
  23. </view>
  24. <view
  25. class=""
  26. style="
  27. display: flex;
  28. align-items: center;
  29. justify-content: space-evenly;
  30. height: 40rpx;
  31. width: 100rpx;
  32. border-radius: 30rpx;
  33. background-color: rgb(253 0 0 / 60%);
  34. "
  35. @click="likeBtn"
  36. >
  37. <uni-icons v-if="list.is_like > 0" type="heart-filled" color="red" size="20"></uni-icons>
  38. <uni-icons v-else type="heart-filled" color="#f8f8f8" size="20"></uni-icons>
  39. <text style="font-size: 28rpx">{{ list.likes }}</text>
  40. </view>
  41. </view>
  42. <view class="info">
  43. <view style="width: 40%">始建年代:{{ list.age }}</view>
  44. <view style="width: 40%">文物类型:{{ list.cr_type }}</view>
  45. <view style="width: 40%">文物等级:{{ list.level }}</view>
  46. <view style="width: 40%">所属区域:{{ list.region }}</view>
  47. </view>
  48. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  49. <view style="font-weight: 700; font-size: 36rpx">地址</view>
  50. </view>
  51. <view
  52. class=""
  53. style="
  54. display: flex;
  55. justify-content: space-between;
  56. align-items: center;
  57. height: 80rpx;
  58. margin-left: 30rpx;
  59. margin-top: 15rpx;
  60. color: green;
  61. background-color: #ffffff;
  62. "
  63. >
  64. <view class="text flex" style="background-color: aliceblue">{{ list.address }}</view>
  65. <view class="">
  66. <uni-icons type="location" size="20"></uni-icons>
  67. </view>
  68. </view>
  69. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  70. <view style="font-weight: 700; font-size: 18px">保护区域</view>
  71. </view>
  72. <view class="u-info">
  73. <u-parse :content="list.protected_area"></u-parse>
  74. </view>
  75. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  76. <view style="font-weight: 700; font-size: 18px">介绍</view>
  77. </view>
  78. <view class="text">
  79. <u-parse :content="list.intro"></u-parse>
  80. </view>
  81. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  82. <view style="font-weight: 700; font-size: 18px">建筑环境</view>
  83. </view>
  84. <view class="text">
  85. <u-parse :content="list.environment"></u-parse>
  86. </view>
  87. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  88. <view style="font-weight: 700; font-size: 18px">建筑描述</view>
  89. </view>
  90. <view class="text">
  91. <u-parse :content="list.description ? list.description : '暂无描述'"></u-parse>
  92. </view>
  93. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  94. <view style="font-weight: 700; font-size: 18px">文物价值</view>
  95. </view>
  96. <view class="text">
  97. <u-parse :content="list.description.value ? list.description.value : '暂无评估'"></u-parse>
  98. </view>
  99. <view style="color: #940000; font-size: 24rpx; margin-left: 24rpx; display: flex; align-items: center; margin-top: 40rpx">
  100. <view style="font-weight: 700; font-size: 18px">文物责任人</view>
  101. </view>
  102. <view class="text">
  103. <u-parse :content="list.director ? list.director : '暂无责任人'"></u-parse>
  104. </view>
  105. </view>
  106. </view>
  107. </template>
  108. <script>
  109. let that = this;
  110. export default {
  111. data() {
  112. return {
  113. main_body_id: '',
  114. list: [],
  115. imageList: [
  116. // 'https://huli-app.wenlvti.net/app_static/minnanhun/image/sy_lbt2.png',
  117. // 'https://huli-app.wenlvti.net/app_static/minnanhun/image/sy_lbt1.png',
  118. // 'https://huli-app.wenlvti.net/app_static/minnanhun/image/sy_lbt3.jpg',
  119. // 'https://huli-app.wenlvti.net/app_static/minnanhun/image/sy_lbt4.jpg',
  120. // 'https://huli-app.wenlvti.net/app_static/minnanhun/image/sy_lbt5.png'
  121. ]
  122. };
  123. },
  124. onLoad(e) {
  125. that = this;
  126. console.log(e);
  127. this.main_body_id = this.$db.get('main_body_id');
  128. this.getContentDetails(e.id);
  129. },
  130. methods: {
  131. // 详情
  132. getContentDetails(id) {
  133. this.$api.getContentDetails(
  134. {
  135. main_body_id: this.main_body_id,
  136. id: id
  137. },
  138. function (res) {
  139. that.list = res.data;
  140. that.imageList = res.data.images;
  141. }
  142. );
  143. },
  144. // 点赞
  145. likeBtn(i) {
  146. if (this.list.is_like == 0) {
  147. this.$api.like(
  148. {
  149. main_body_id: this.main_body_id,
  150. content_id: this.list.id
  151. },
  152. function (res) {
  153. that.list.is_like = 1;
  154. that.list.likes++;
  155. that.$common.successToShow('成功点赞');
  156. }
  157. );
  158. } else {
  159. that.$api.unLike(
  160. {
  161. main_body_id: that.main_body_id,
  162. content_ids: that.list.id
  163. },
  164. function (res) {
  165. that.list.is_like = 0;
  166. that.list.likes--;
  167. that.$common.successToShow('取消点赞');
  168. }
  169. );
  170. }
  171. }
  172. }
  173. };
  174. </script>
  175. <style>
  176. /deep/.u-swiper-indicator__wrapper__dot--active {
  177. width: 5px !important;
  178. }
  179. .box {
  180. height: auto;
  181. width: 100%;
  182. background-image: url('https://huli-app.wenlvti.net/app_static/wuyuan/static/shouhu/wyj-feiyi3-001.png');
  183. background-size: 100% 100%;
  184. background-attachment: fixed;
  185. border-radius: 32rpx 32rpx 0 0;
  186. position: relative;
  187. top: -40rpx;
  188. padding-top: 10rpx;
  189. }
  190. .u-info {
  191. margin: 20rpx;
  192. }
  193. .text {
  194. margin: 20rpx;
  195. }
  196. .info {
  197. display: flex;
  198. justify-content: space-between;
  199. flex-wrap: wrap;
  200. margin: 20rpx;
  201. margin-top: 16rpx;
  202. }
  203. .info > view {
  204. margin-top: 20rpx;
  205. font-size: 28rpx;
  206. margin-left: 8rpx;
  207. color: #940000;
  208. }
  209. </style>