activeTeamCom.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="growth-module">
  3. <view v-if="active === 2" class="cell-1" @click="playVideo">
  4. <view class="image">
  5. <image :src="module.headAppBanner" mode=""></image>
  6. </view>
  7. <view class="content text-line">
  8. {{ module.title }}
  9. </view>
  10. </view>
  11. <view v-else class="cell-2" @click="handlerTramp(module)">
  12. <view class="image">
  13. <image :src="module.headAppBanner" mode=""></image>
  14. </view>
  15. <view class="content">
  16. <view class="title">
  17. {{ module.title }}
  18. </view>
  19. <view class="cont text-line" v-if="module.content" v-html="module.content.replace(/<[^>]+>/g, '').replace(/[ ]|[&nbsp;]/g, '')"></view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. module: {
  28. type: Object,
  29. default: () => ({})
  30. },
  31. active: {
  32. type: Number,
  33. default: () => 1
  34. }
  35. },
  36. methods: {
  37. handlerTramp($event) {
  38. let data = $event.content.replace(/<img/g, '<img style="width: 100%;height: 200px"')
  39. data = data.replace(/\<figure/g, '<div')
  40. data = data.replace(/\<\/figure/g, '<\/div')
  41. uni.setStorageSync('artForm', data)
  42. uni.navigateTo({
  43. url: '/pages/login/supplier_information'
  44. })
  45. },
  46. // 视频播放
  47. playVideo() {
  48. this.$emit('playVideo', this.module)
  49. },
  50. // 视频关闭
  51. closeVideo() {
  52. this.showVideo = false
  53. },
  54. }
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .growth-module {
  59. width: 322rpx;
  60. height: 328rpx;
  61. border: 1px solid #EAEAEA;
  62. box-sizing: border-box;
  63. .cell-1 {
  64. .image {
  65. height: 185rpx;
  66. image {
  67. width: 100%;
  68. height: 100%;
  69. }
  70. }
  71. .content {
  72. height: calc(100% - 220rpx);
  73. font-size: 26rpx;
  74. color: #333333;
  75. line-height: 40rpx;
  76. box-sizing: border-box;
  77. padding: 30rpx 18rpx 0 18rpx;
  78. }
  79. }
  80. .cell-2 {
  81. .image {
  82. height: 193rpx;
  83. image {
  84. width: 100%;
  85. height: 100%;
  86. }
  87. }
  88. .content {
  89. height: calc(100% - 193rpx);
  90. padding: 17rpx 0;
  91. font-size: 22rpx;
  92. color: #666666;
  93. box-sizing: border-box;
  94. .title {
  95. border-left: 4rpx solid #FF5B00;
  96. padding-left: 20rpx;
  97. color: #333333;
  98. font-size: 28rpx;
  99. }
  100. .cont {
  101. padding-left: 20rpx;
  102. line-height: 32rpx;
  103. }
  104. }
  105. }
  106. }
  107. .text-line {
  108. overflow: hidden;
  109. text-overflow: ellipsis;
  110. display: -webkit-box;
  111. -webkit-line-clamp: 2;
  112. -webkit-box-orient: vertical;
  113. box-sizing: border-box;
  114. }
  115. </style>