ItemContent.vue 3.3 KB

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