touGaoXiangQing.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="投稿详情" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view style="width: 92%; margin: auto">
  5. <u-swiper
  6. @click="clickImg"
  7. :list="[list.image]"
  8. imgMode="aspectFill"
  9. :height="160"
  10. :indicator="true"
  11. radius="5"
  12. :autoplay="true"
  13. :circular="true"
  14. indicatorStyle="bottom: 10px"
  15. indicatorMode="dot"
  16. indicatorActiveColor="#fff"
  17. indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
  18. ></u-swiper>
  19. </view>
  20. <view class="" style="width: 92%; margin: auto">
  21. <view style="display: flex; justify-content: space-between; align-items: center; margin-top: 30rpx">
  22. <view lines="1" class="text_4">{{ list.title }}</view>
  23. <view class="text_25">{{ list.publish_at }}</view>
  24. </view>
  25. <view v-if="list.content != null" class="text_5">
  26. <u-parse :content="list.content"></u-parse>
  27. </view>
  28. <!-- <view v-else class="">
  29. <u-empty text="暂无介绍" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  30. </view> -->
  31. <view class="">
  32. <view style="display: flex; align-items: center; margin-top: 40rpx">
  33. <view style="display: flex; align-items: center">
  34. <uni-icons type="cloud-download" size="22" color="#000000"></uni-icons>
  35. <view class="item_tit">关联文物</view>
  36. </view>
  37. </view>
  38. <view class="jj_btm">
  39. <view @click="$common.navigateTo('/index_fenbao/GuanLi/XiangQing?id=' + item.id)" class="container" v-for="(item, index) in association" :key="item.index">
  40. <view class="mn_box">
  41. <image style="border-radius: 10rpx; width: 100%; height: 100%" :lazy-load="true" :src="item.image"></image>
  42. </view>
  43. <view class="mn_text">{{ item.title }}</view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. let that;
  52. export default {
  53. data() {
  54. return {
  55. association: [],
  56. list: {}
  57. };
  58. },
  59. onLoad(o) {
  60. that = this;
  61. this.getContentDetail(o.id);
  62. },
  63. methods: {
  64. getContentDetail(id) {
  65. this.$api.getContentDetail({ main_body_id: 1, id: id }, function (res) {
  66. console.log(res, '风采详情');
  67. if (res.code == 1) {
  68. that.list = res.data;
  69. let aa = Object.values(res.data.association_me_list);
  70. that.association = aa.filter((item) => item.title !== '文保牌' && item.main_body_column_name !== '我和文物的故事');
  71. // if (res.data.images.length > 0) {
  72. // that.imageList = res.data.images;
  73. // }
  74. }
  75. });
  76. },
  77. // 图片预览
  78. clickImg(index) {
  79. // console.log(index, 555);
  80. var imgs = this.list.images;
  81. let temp = [imgs[index]];
  82. // console.log('temp', temp);
  83. uni.previewImage({
  84. urls: imgs,
  85. current: index,
  86. success: function (data) {
  87. console.log(data);
  88. },
  89. fail: function (err) {
  90. console.log(err.errMsg);
  91. }
  92. });
  93. }
  94. }
  95. };
  96. </script>
  97. <style>
  98. .box {
  99. width: 100%;
  100. padding-bottom: 50rpx;
  101. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xy_bgt.png');
  102. background-size: 100% 100%;
  103. background-attachment: fixed;
  104. background-repeat: repeat-y;
  105. min-height: 100%;
  106. height: auto;
  107. /* background-color: #fff9e9; */
  108. }
  109. .text_4 {
  110. width: 112rpx;
  111. height: 28rpx;
  112. overflow-wrap: break-word;
  113. color: rgba(49, 37, 32, 1);
  114. font-size: 32rpx;
  115. font-family: SourceHanSansCN-Bold;
  116. font-weight: 700;
  117. text-align: left;
  118. white-space: nowrap;
  119. line-height: 28rpx;
  120. }
  121. .text_5 {
  122. height: 400rpx;
  123. font-size: 28rpx;
  124. overflow: scroll;
  125. font-weight: normal;
  126. text-align: justifyLeft;
  127. line-height: 48rpx;
  128. margin: 44rpx 0 0 16rpx;
  129. text-indent: 2rem;
  130. }
  131. /deep/.u-swiper-indicator__wrapper__dot--active {
  132. width: 5px !important;
  133. }
  134. .text_25 {
  135. font-size: 26rpx;
  136. color: #727070;
  137. margin-top: 10rpx;
  138. font-weight: 400;
  139. }
  140. .jj_btm {
  141. width: 92%;
  142. margin: auto;
  143. display: flex;
  144. margin-top: 20rpx;
  145. flex-wrap: wrap;
  146. justify-content: space-between;
  147. }
  148. .item_tit {
  149. font-size: 32rpx;
  150. line-height: 48rpx;
  151. font-weight: 700;
  152. }
  153. .mn_box {
  154. width: 300rpx;
  155. height: 200rpx;
  156. }
  157. .mn_text {
  158. width: 298rpx;
  159. font-size: 28rpx;
  160. text-align: center;
  161. color: #ffffff;
  162. position: absolute;
  163. top: 160rpx;
  164. left: 2rpx;
  165. line-height: 40rpx;
  166. background: rgba(0, 0, 0, 0.3);
  167. border-radius: 0px 0rpx 10rpx 10rpx;
  168. }
  169. .container {
  170. position: relative;
  171. margin-top: 20rpx;
  172. /* width: 260rpx;
  173. height: 182rpx; */
  174. }
  175. </style>