reportItem.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="container-report-item" @click="goDetail(list)">
  3. <view class="item-title"
  4. :class="list.CategoryId == '0'?'yan-xuan-tag':'front-vertical-line'" v-if="list.Title" >
  5. <mp-html :content="richTextClamp(3) + list.Title + '</div>'" />
  6. </view>
  7. <view class="item-image" v-if="list.BodyHtml">
  8. <image :src="list.BodyHtml"></image>
  9. </view>
  10. <view class="item-image" v-if="list.Cover">
  11. <image :src="list.Cover"></image>
  12. </view>
  13. <block v-if="(list.Annotation || list.Body[0]) && !list.Cover">
  14. <text class="item-content" v-if="!list.Body[0]">{{ list.ArticleResponse == 4 ? "核心观点" : "核心结论" }}:</text>
  15. <view class="item-rich-text">
  16. <mp-html :content="richTextClamp(7) + (list.Annotation || list.Body[0]) + '</div>'" />
  17. </view>
  18. </block>
  19. <view class="item-abstract text-Line" v-if="list.Abstract && list.ArticleResponse != 1"> 摘要:{{ list.Abstract }} </view>
  20. <view class="item-time">
  21. <text>{{ list.PublishDate }}</text>
  22. <view class="item-examine" v-if="list.IsResearch">
  23. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
  24. <text>{{ list.Pv }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue";
  31. export default {
  32. name: "",
  33. components: { mpHtml },
  34. props: {
  35. list: {
  36. type: Object,
  37. default: {},
  38. required: true,
  39. },
  40. },
  41. data() {
  42. return {};
  43. },
  44. computed: {},
  45. watch: {},
  46. created() {},
  47. mounted() {},
  48. methods: {
  49. goDetail(item) {
  50. if (item.HomeType !== 1) {
  51. /* 无需授权且已绑定 检验是或否有权限 */
  52. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  53. }
  54. },
  55. richTextClamp(val) {
  56. return `<div style="${
  57. val == 7 ? "min-height: 50px;" : ""
  58. }line-clamp: ${val};-webkit-line-clamp: ${val};text-overflow: -o-ellipsis-lastline;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-box-orient: vertical;word-wrap: break-word;word-break: break-all;">`;
  59. },
  60. },
  61. };
  62. </script>
  63. <style scoped lang="scss">
  64. .container-report-item {
  65. width: 100%;
  66. background: #ffffff;
  67. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  68. border-radius: 8rpx;
  69. padding: 20rpx;
  70. margin-bottom: 20rpx;
  71. overflow: hidden;
  72. .item-title {
  73. position: relative;
  74. font-size: 32rpx;
  75. font-weight: 500;
  76. color: #333333;
  77. line-height: 38rpx;
  78. text-indent: 20rpx;
  79. }
  80. .front-vertical-line{
  81. &::before {
  82. content: "";
  83. position: absolute;
  84. top: 6rpx;
  85. left: 4rpx;
  86. width: 6rpx;
  87. height: 31rpx;
  88. background-color: #3385ff;
  89. }
  90. }
  91. .yan-xuan-tag{
  92. text-indent: 82rpx;
  93. &::before {
  94. content: "";
  95. position: absolute;
  96. top: 6rpx;
  97. background-image: url(https://hzstatic.hzinsights.com/cygx/icon/Research_Points.png);
  98. background-size: 100% 100%;
  99. background-repeat: no-repeat;
  100. left: 0;
  101. width: 73rpx;
  102. height: 30rpx;
  103. }
  104. }
  105. .item-content,
  106. .item-rich-text {
  107. font-size: 26rpx;
  108. font-weight: 400;
  109. color: #666666;
  110. }
  111. .item-content {
  112. margin-top: 10rpx;
  113. }
  114. .item-rich-text {
  115. margin-bottom: 20rpx;
  116. }
  117. .item-image {
  118. height: 242rpx;
  119. margin: 15rpx 0;
  120. image {
  121. width: 100%;
  122. height: 100%;
  123. }
  124. }
  125. .item-abstract {
  126. font-size: 28rpx;
  127. font-weight: 400;
  128. color: #333333;
  129. line-height: 33rpx;
  130. -webkit-line-clamp: 3;
  131. line-clamp: 3;
  132. margin-bottom: 20rpx;
  133. }
  134. .text-Line {
  135. text-overflow: -o-ellipsis-lastline;
  136. overflow: hidden;
  137. text-overflow: ellipsis;
  138. display: -webkit-box;
  139. -webkit-box-orient: vertical;
  140. word-wrap: break-word;
  141. word-break: break-all;
  142. }
  143. .item-time {
  144. display: flex;
  145. align-items: center;
  146. justify-content: space-between;
  147. color: #acacac;
  148. font-size: 24rpx;
  149. line-height: 28rpx;
  150. .item-examine {
  151. display: flex;
  152. align-items: center;
  153. image {
  154. width: 30rpx;
  155. height: 24rpx;
  156. margin: 0 10rpx 0 15rpx;
  157. }
  158. }
  159. }
  160. }
  161. </style>