reportItem.vue 3.5 KB

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