columnListContent.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="column-list-content-detail">
  3. <view class="introduce-content">
  4. <view class="introduce"></view>
  5. <view :class="['introduce-detail', item.isExpand && 'expand']" :style="{ height: isExpand ? 'auto' : richTextHeight + 'px' }">
  6. {{ content }}
  7. <view class="expan-btn-sl" v-if="isShowBtn && !isExpand">......</view>
  8. </view>
  9. <view class="expan-btn" @click.stop="handleExpand" v-if="isShowBtn">{{ isExpand ? "收起" : "展开" }}</view>
  10. </view>
  11. <view class="content-item">
  12. <view class="type-time">
  13. <view class="type"> 笔 记</view>
  14. <view class="time"> 2023.08.24 13:13:13</view>
  15. </view>
  16. <view class="title-item"> 标题标题标题标题标题标题标题标题标题标题标题标题</view>
  17. <view class="text-conten">
  18. 有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录
  19. 内容详情页面也需要登录后才查看,登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查专栏介绍:有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,
  20. </view>
  21. <view class="look-all"> 查看全文 </view>
  22. <view class="file-item"> 文档名称.docx </view>
  23. <view class="image-conten">
  24. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png" @click="previewImageMediahandler"></image>
  25. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"></image>
  26. </view>
  27. <view class="lable-conten">
  28. <text>石头科技</text>
  29. <text>公司调研电话会</text>
  30. </view>
  31. <view class="collect-conten">
  32. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_icon.png"></image>
  33. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image> 88
  34. </view>
  35. <view class="introduce-detail-one" v-show="showText">
  36. 有专栏详情页面,情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查容详情页面也需要登录后
  37. </view>
  38. </view>
  39. <view v-show="loadTimeLine" class="loadTimeLine"></view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. loadTimeLine: true, //时间线的遮罩
  47. richTextHeight: 1000,
  48. isExpand: true,
  49. isShowBtn: true,
  50. showText: true,
  51. content:
  52. "情页面,有专栏详情页面,内容详情页面,有专栏详情页面,内容详情页面,有专栏详情页面,内容详情页面,暂时都不设置行业权限。专栏详情页未登录也可查看,收藏操作需先登录,内容详情页面也需要登录后才查容详情页面也需要登录后",
  53. };
  54. },
  55. mounted() {
  56. const queryOne = wx.createSelectorQuery().in(this).selectAll(".introduce-detail-one").boundingClientRect();
  57. queryOne.exec((res) => {
  58. this.richTextHeight = res[0][0].height;
  59. this.showText = false;
  60. this.getConentsHeight();
  61. });
  62. },
  63. methods: {
  64. previewImageMediahandler() {
  65. uni.previewImage({
  66. urls: ["https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/Maskgroupbg.png"], //查看图片的数组
  67. });
  68. },
  69. // 去往文章详情的
  70. async handleExpand() {
  71. this.isExpand = !this.isExpand;
  72. },
  73. getConentsHeight() {
  74. const query = wx.createSelectorQuery().in(this);
  75. query.selectAll(".introduce-detail").boundingClientRect();
  76. query.exec((res) => {
  77. console.log(res[0][0].height);
  78. if (res[0][0].height > this.richTextHeight) {
  79. this.isExpand = false;
  80. this.isShowBtn = true;
  81. } else {
  82. this.isExpand = true;
  83. this.isShowBtn = false;
  84. }
  85. setTimeout(() => {
  86. this.loadTimeLine = false;
  87. }, 300);
  88. });
  89. },
  90. },
  91. };
  92. </script>
  93. <style lang="scss" scope>
  94. .column-list-content-detail {
  95. position: relative;
  96. padding: 50rpx 40rpx;
  97. background: #fff;
  98. .loadTimeLine {
  99. top: 0;
  100. bottom: 0;
  101. left: 0;
  102. right: 0;
  103. position: absolute;
  104. background-color: #fff;
  105. z-index: 6;
  106. }
  107. .introduce-content {
  108. padding-bottom: 50rpx;
  109. border-bottom: 1px solid #f0f1f3;
  110. .introduce {
  111. width: 100%;
  112. height: 53rpx;
  113. text-align: center;
  114. line-height: 53rpx;
  115. background-color: #fff6de;
  116. color: #928563;
  117. font-weight: 500;
  118. margin-bottom: 40rpx;
  119. }
  120. }
  121. .introduce-detail {
  122. overflow: hidden;
  123. text-overflow: ellipsis;
  124. text-align: justify;
  125. // display: -webkit-box;
  126. -webkit-line-clamp: 4;
  127. -webkit-box-orient: vertical;
  128. position: relative;
  129. &.expand {
  130. -webkit-line-clamp: 999;
  131. height: auto;
  132. }
  133. .expan-btn-sl {
  134. position: absolute;
  135. bottom: 0;
  136. right: 0;
  137. background-color: #fff;
  138. padding: 2rpx 0 2rpx 8rpx;
  139. z-index: 9;
  140. }
  141. }
  142. .expan-btn {
  143. margin-top: 15rpx;
  144. color: #2c83ff;
  145. text-align: right;
  146. position: relative;
  147. &.pos {
  148. padding: 0 0 0 40rpx;
  149. background-color: rgba(255, 255, 255, 0.882);
  150. position: absolute;
  151. right: 0;
  152. bottom: 0;
  153. }
  154. }
  155. .content-item {
  156. padding: 40rpx 0;
  157. border-bottom: 1px solid #f0f1f3;
  158. .type-time {
  159. display: flex;
  160. align-items: center;
  161. justify-content: space-between;
  162. color: #666666;
  163. .type {
  164. width: 110rpx;
  165. height: 42rpx;
  166. line-height: 42rpx;
  167. text-align: center;
  168. border-radius: 38rpx;
  169. color: #928563;
  170. background-color: #fff6de;
  171. font-weight: 500;
  172. }
  173. }
  174. .title-item {
  175. margin: 10rpx 0 20rpx;
  176. color: #333;
  177. font-size: 32rpx;
  178. font-weight: 500;
  179. line-height: 46rpx;
  180. }
  181. .file-item {
  182. width: 100%;
  183. height: 42rpx;
  184. margin: 20rpx 0;
  185. display: flex;
  186. align-items: center;
  187. background-color: #f8f8fa;
  188. color: #376cbb;
  189. }
  190. .image-conten {
  191. display: flex;
  192. flex-wrap: wrap;
  193. image {
  194. width: 144rpx;
  195. height: 144rpx;
  196. margin-right: 20rpx;
  197. }
  198. }
  199. .lable-conten {
  200. display: flex;
  201. margin: 20rpx 0;
  202. font-size: 24rpx;
  203. text {
  204. height: 34rpx;
  205. border-radius: 44rpx;
  206. padding: 3rpx 35rpx 3rpx 35rpx;
  207. background-color: #f0f1f3;
  208. margin-right: 20rpx;
  209. }
  210. }
  211. .collect-conten {
  212. display: flex;
  213. justify-content: flex-end;
  214. align-items: center;
  215. color: #666666;
  216. image {
  217. width: 27rpx;
  218. height: 26rpx;
  219. margin-right: 8rpx;
  220. }
  221. }
  222. .look-all {
  223. float: right;
  224. width: 108rpx;
  225. height: 42rpx;
  226. border-radius: 150rpx;
  227. text-align: center;
  228. line-height: 42rpx;
  229. font-size: 21rpx;
  230. color: #fff;
  231. background-color: #376cbb;
  232. margin: 20rpx 0;
  233. }
  234. }
  235. }
  236. </style>