reportItem.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="container-report-item global_card_content" @click="goDetail(list)">
  3. <image v-if="list.CategoryId == '0'" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/Research_normal.png" class="yan-xuan-tag"></image>
  4. <view class="global_title" 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="global_content" v-if="!list.Body[0]">{{ list.ArticleResponse == 4 ? "核心观点" : "核心结论" }}:</text>
  15. <view class="global_content 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. .yan-xuan-tag {
  73. width: 160rpx;
  74. height: 48rpx;
  75. margin: -20rpx 0 0 -20rpx;
  76. // &::before {
  77. // content: "";
  78. // position: absolute;
  79. // top: 6rpx;
  80. // background-image: url(https://hzstatic.hzinsights.com/cygx/icon/Research_normal.png);
  81. // background-size: 100% 100%;
  82. // background-repeat: no-repeat;
  83. // left: 0;
  84. // width: 73rpx;
  85. // height: 30rpx;
  86. // }
  87. }
  88. // .item-content,
  89. // .item-rich-text {
  90. // font-size: 26rpx;
  91. // font-weight: 400;
  92. // color: #666666;
  93. // }
  94. .item-content {
  95. margin-top: 10rpx;
  96. }
  97. .item-rich-text {
  98. margin-bottom: 20rpx;
  99. }
  100. .item-image {
  101. height: 238rpx;
  102. margin: 15rpx 0;
  103. image {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. }
  108. .item-abstract {
  109. font-size: 22rpx;
  110. font-weight: 400;
  111. color: #333333;
  112. line-height: 30rpx;
  113. -webkit-line-clamp: 3;
  114. line-clamp: 3;
  115. margin-bottom: 20rpx;
  116. }
  117. .text-Line {
  118. text-overflow: -o-ellipsis-lastline;
  119. overflow: hidden;
  120. text-overflow: ellipsis;
  121. display: -webkit-box;
  122. -webkit-box-orient: vertical;
  123. word-wrap: break-word;
  124. word-break: break-all;
  125. }
  126. .item-time {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. color: #999;
  131. font-size: 22rpx;
  132. line-height: 30rpx;
  133. .item-examine {
  134. display: flex;
  135. align-items: center;
  136. image {
  137. width: 30rpx;
  138. height: 16rpx;
  139. margin: 0 10rpx 0 15rpx;
  140. }
  141. }
  142. }
  143. }
  144. </style>