activeTeamCom.vue 3.2 KB

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