hot-consult.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view>
  3. <view class="container">
  4. <view class="flex justify-between">
  5. <block>
  6. <view class="flex flex-direction justify-center align-center text-bold"
  7. style="width: 120rpx;padding-left: 20rpx;">
  8. <view :style="{color:title1.color}"
  9. style="font-family:Arial, Helvetica, sans-serif;font-size: 32rpx;">
  10. {{title1.text}}
  11. </view>
  12. <view :style="{color:title2.color}"
  13. style="font-family:Arial, Helvetica, sans-serif;font-size: 32rpx;">
  14. {{title2.text}}
  15. </view>
  16. </view>
  17. <!-- <view class="cu-avatar text-font" style="background-image:url(http://139.9.103.171:1888/miniofile/app/notice.png);"></view> -->
  18. <view class="margin-top-xs" style="width: 680rpx">
  19. <swiper :circular="true" class="swiper" autoplay="true" vertical="true" interval="5000"
  20. next-margin="46rpx">
  21. <swiper-item v-for="(item, index) in swiperTexts" :key="index" @click="detailTap(item)">
  22. <view class="swiper-item">
  23. <text :style="{color:title1.color}"
  24. class="text-bold cuIcon-title padding-right-sm"></text>
  25. <text>{{item.title}} : {{item.notice | formatHtml}}</text>
  26. </view>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. </block>
  31. <view class="flex align-center justify-center" style="width: 100rpx;" @click="onTap">
  32. <text class="cuIcon-right"></text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. props: {
  41. swiperTexts: {
  42. type: Array,
  43. default: () => {
  44. return []
  45. }
  46. },
  47. title1: {
  48. type: Object,
  49. default: () => {
  50. return {
  51. text: '园区',
  52. color: '#5064eb'
  53. }
  54. }
  55. },
  56. title2: {
  57. type: Object,
  58. default: () => {
  59. return {
  60. text: '公告',
  61. color: ''
  62. }
  63. }
  64. },
  65. },
  66. filters: {
  67. formatHtml(str) {
  68. str = decodeURIComponent(str)
  69. return str.replace(/<[^>]+>/g, "");
  70. }
  71. },
  72. methods: {
  73. onTap() {
  74. this.$emit('onTap');
  75. },
  76. detailTap(item) {
  77. this.$emit('detailTap', item);
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .container {
  84. background-color: #ffffff;
  85. height: 110rpx;
  86. }
  87. .swiper {
  88. height: 90rpx;
  89. }
  90. .swiper-item {
  91. font-size: 24rpx;
  92. color: #323232;
  93. text-overflow: ellipsis;
  94. white-space: nowrap;
  95. overflow: hidden;
  96. height: 40rpx;
  97. margin: 6rpx 0rpx;
  98. }
  99. .text-font {
  100. width: 100rpx;
  101. height: 100rpx;
  102. margin: 10rpx 10rpx 10rpx 20rpx;
  103. }
  104. </style>