industrialsource.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="container-report-item" @click="goDetail(list)">
  3. <view class="item-title" v-if="list.IndustryName">
  4. <mp-html :content="richTextClamp(3) + list.IndustryName + isSourceText(list) + '</div>'" />
  5. </view>
  6. <view class="item-lable">
  7. <view class="lable-list" v-for="item in list.IndustrialSubjectList" :key="item.IndustrialSubjectId">{{ item.SubjectName }}</view>
  8. </view>
  9. <view class="item-time">
  10. <text>{{ list.PublishDate }} &nbsp;&nbsp;更新</text>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import mpHtml from "@/uni_modules/mp-html/components/mp-html/mp-html.vue";
  16. export default {
  17. name: "",
  18. components: { mpHtml },
  19. props: {
  20. list: {
  21. type: Object,
  22. default: {},
  23. required: true,
  24. },
  25. },
  26. data() {
  27. return {};
  28. },
  29. computed: {},
  30. watch: {},
  31. created() {},
  32. mounted() {},
  33. methods: {
  34. goDetail(item) {
  35. if (item.HomeType !== 1) {
  36. /* 无需授权且已绑定 检验是或否有权限 */
  37. uni.navigateTo({ url: "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustrialManagementId });
  38. }
  39. },
  40. isSourceText(list) {
  41. let str = list.Source == 1 ? "(弘则资源包)" : list.Source == 2 ? "(买方研选主题)" : "";
  42. return str;
  43. },
  44. richTextClamp(val) {
  45. return `<div style="${
  46. val == 7 ? "min-height: 50px;" : ""
  47. }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;">`;
  48. },
  49. },
  50. };
  51. </script>
  52. <style scoped lang="scss">
  53. .container-report-item {
  54. width: 100%;
  55. background: #ffffff;
  56. box-shadow: 0rpx 3rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
  57. border-radius: 8rpx;
  58. padding: 20rpx;
  59. margin-bottom: 20rpx;
  60. overflow: hidden;
  61. .item-title {
  62. position: relative;
  63. font-size: 32rpx;
  64. font-weight: 500;
  65. color: #333333;
  66. line-height: 38rpx;
  67. text-indent: 0.5em;
  68. &::before {
  69. content: "";
  70. position: absolute;
  71. top: 5rpx;
  72. left: 0;
  73. width: 6rpx;
  74. height: 31rpx;
  75. background-color: #3385ff;
  76. }
  77. }
  78. .item-lable {
  79. margin-top: 20rpx;
  80. height: 290rpx;
  81. display: flex;
  82. flex-direction: column;
  83. flex-wrap: wrap;
  84. overflow: hidden;
  85. overflow-x: auto;
  86. .lable-list {
  87. width: 185rpx;
  88. height: 42rpx;
  89. border-radius: 39rpx;
  90. margin-bottom: 30rpx;
  91. margin-right: 30rpx;
  92. text-align: center;
  93. line-height: 39rpx;
  94. background: url(~@/static/img/report_bg.png) no-repeat;
  95. background-size: 100% 100%;
  96. text-indent: 0em;
  97. }
  98. }
  99. .text-Line {
  100. text-overflow: -o-ellipsis-lastline;
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. display: -webkit-box;
  104. -webkit-box-orient: vertical;
  105. word-wrap: break-word;
  106. word-break: break-all;
  107. }
  108. .item-time {
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. color: #acacac;
  113. font-size: 24rpx;
  114. line-height: 28rpx;
  115. }
  116. }
  117. </style>