ItemContent.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="morning-item global_card_content" @click="isGoDetalisOfDlgHandler(list)">
  3. <block v-if="list.Source == 'meetingreviewchapt'">
  4. <view class="global_title" v-if="list.IndustryName">
  5. <mp-html :content="richTextClamp(3) + `【${list.IndustryName}】晨会精华 ` + '</div>'" />
  6. </view>
  7. <view class="item-rich-text global_content">
  8. <mp-html :content="richTextClamp(10) + list.Content + '</div>'" />
  9. </view>
  10. <view class="item-time">
  11. <text>{{ list.PublishTime }}</text>
  12. </view>
  13. </block>
  14. <block v-else>
  15. <view class="global_title" v-if="list.Title">
  16. <mp-html :content="richTextClamp(3) + list.Title + '</div>'" />
  17. </view>
  18. <view class="item-rich-text global_content" v-if="list.MarketStrategy">
  19. <mp-html :content="richTextClamp(10) + list.MarketStrategy + '</div>'" />
  20. </view>
  21. <view class="item-rich-text global_content" v-else-if="list.Source == 'productinterior'">
  22. <mp-html :content="richTextClamp(10) + list.Body + '</div>'" />
  23. </view>
  24. <view class="item-rich-text global_content" v-else>
  25. <mp-html :content="richTextClamp(10) + list.Abstract + '</div>'" />
  26. </view>
  27. <view class="item-time">
  28. <text>{{ list.Source == "productinterior" ? list.PublishTime : list.PublishDate }}</text>
  29. <view class="item-examine">
  30. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
  31. <text>{{ list.Pv }}</text>
  32. </view>
  33. </view>
  34. </block>
  35. </view>
  36. </template>
  37. <script>
  38. /*
  39. Source 字段的分别代表
  40. researchsummary 本周研究汇总
  41. minutessummary 上周纪要汇总
  42. meetingreviewchapt 晨会精华
  43. productnterior 产品内测
  44. */
  45. export default {
  46. name: "",
  47. props: {
  48. list: {
  49. type: Object,
  50. default: {},
  51. required: true,
  52. },
  53. },
  54. methods: {
  55. // 判断是跳转本周||上周||晨会弹框
  56. isGoDetalisOfDlgHandler(item) {
  57. // 判断是晨会文章、弹出弹框 通过传统方式进行操控兄弟之间传值
  58. if (item.Source == "meetingreviewchapt") {
  59. this.$emit("showMorningDialog", item);
  60. } else if (item.Source == "productinterior") {
  61. // 跳转产品内测详情
  62. uni.navigateTo({
  63. url: "/reportPages/internalDetials/internalDetials?id=" + item.ProductInteriorId,
  64. });
  65. } else if (item.Source == "reportselection") {
  66. uni.navigateTo({
  67. url: "/reportPages/keyCompany/keyCompany?id=" + item.ArticleId,
  68. });
  69. } else {
  70. let isType = item.Source == "researchsummary" ? 2 : 3;
  71. this.$store.dispatch("checkHandle", "/reportPages/reportSecretDetail/reportSecretDetail?type=" + isType + "&id=" + item.ArticleId);
  72. }
  73. },
  74. // 对返回的文本进行处理 多少行进行省略
  75. richTextClamp(val) {
  76. return `<div style="${
  77. val >= 7 ? "min-height: 50px;" : ""
  78. }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;">`;
  79. },
  80. },
  81. };
  82. </script>
  83. <style scoped lang="scss">
  84. .morning-item {
  85. width: 100%;
  86. background: #ffffff;
  87. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  88. border-radius: 8rpx;
  89. padding: 20rpx;
  90. margin-bottom: 20rpx;
  91. overflow: hidden;
  92. .item-title {
  93. position: relative;
  94. font-size: 32rpx;
  95. font-weight: 500;
  96. color: #333333;
  97. line-height: 38rpx;
  98. text-indent: 0.5em;
  99. &::before {
  100. content: "";
  101. position: absolute;
  102. top: 5rpx;
  103. left: 0;
  104. width: 6rpx;
  105. height: 31rpx;
  106. background-color: #376cbb;
  107. }
  108. }
  109. .item-rich-text {
  110. margin: 10rpx 0;
  111. }
  112. .item-time {
  113. display: flex;
  114. align-items: center;
  115. justify-content: space-between;
  116. color: #999;
  117. font-size: 22rpx;
  118. line-height: 30rpx;
  119. .item-examine {
  120. display: flex;
  121. align-items: center;
  122. image {
  123. width: 30rpx;
  124. height: 30rpx;
  125. margin: 0 10rpx 0 15rpx;
  126. }
  127. }
  128. }
  129. }
  130. </style>