reportItem.vue 4.5 KB

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