ItemContent.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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>
  30. </block>
  31. </view>
  32. </template>
  33. <script>
  34. /*
  35. Source 字段的分别代表
  36. researchsummary 本周研究汇总
  37. minutessummary 上周纪要汇总
  38. meetingreviewchapt 晨会精华
  39. productnterior 产品内测
  40. */
  41. export default {
  42. name: "",
  43. props: {
  44. list: {
  45. type: Object,
  46. default: {},
  47. required: true,
  48. },
  49. },
  50. methods: {
  51. // 判断是跳转本周||上周||晨会弹框
  52. isGoDetalisOfDlgHandler(item) {
  53. // 判断是晨会文章、弹出弹框 通过传统方式进行操控兄弟之间传值
  54. if (item.Source == "meetingreviewchapt") {
  55. this.$emit("showMorningDialog", item);
  56. } else if (item.Source == "productinterior") {
  57. // 跳转产品内测详情
  58. uni.navigateTo({
  59. url: "/reportPages/internalDetials/internalDetials?id=" + item.ProductInteriorId,
  60. });
  61. } else if (item.Source == "reportselection") {
  62. uni.navigateTo({
  63. url: "/reportPages/keyCompany/keyCompany?id=" + item.ArticleId,
  64. });
  65. } else {
  66. let isType = item.Source == "researchsummary" ? 2 : 3;
  67. this.$store.dispatch("checkHandle", "/reportPages/reportSecretDetail/reportSecretDetail?type=" + isType + "&id=" + item.ArticleId);
  68. }
  69. },
  70. // 对返回的文本进行处理 多少行进行省略
  71. richTextClamp(val) {
  72. return `<div style="${
  73. val >= 7 ? "min-height: 50px;" : ""
  74. }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;">`;
  75. },
  76. },
  77. };
  78. </script>
  79. <style scoped lang="scss">
  80. .morning-item {
  81. width: 100%;
  82. background: #ffffff;
  83. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  84. border-radius: 8rpx;
  85. padding: 20rpx;
  86. margin-bottom: 20rpx;
  87. overflow: hidden;
  88. .item-title {
  89. position: relative;
  90. font-size: 32rpx;
  91. font-weight: 500;
  92. color: #333333;
  93. line-height: 38rpx;
  94. text-indent: 0.5em;
  95. &::before {
  96. content: "";
  97. position: absolute;
  98. top: 5rpx;
  99. left: 0;
  100. width: 6rpx;
  101. height: 31rpx;
  102. background-color: #3385ff;
  103. }
  104. }
  105. .item-rich-text {
  106. margin: 10rpx 0;
  107. }
  108. .item-time {
  109. display: flex;
  110. align-items: center;
  111. color: #999;
  112. font-size: 22rpx;
  113. line-height: 30rpx;
  114. }
  115. }
  116. </style>