您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

notice-bar.vue 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <!-- 通告栏 -->
  3. <view class="noticeBar">
  4. <swiper class="list" circular="true" vertical="true" autoplay="true" interval="3000" duration="1000">
  5. <swiper-item v-for="item in noticeList" :key="item.id">
  6. <view class="content" @click="emits('noticeClick', item)">
  7. <view class="icon-notice">●</view>
  8. <view class="notice-txt">
  9. {{ item.title }}
  10. </view>
  11. <view class="right">
  12. <view class="label">去办理</view>
  13. <image class="arror" :src="`${$imgUrl}common/arror-right.png`" mode="aspectFill" />
  14. </view>
  15. </view>
  16. </swiper-item>
  17. </swiper>
  18. </view>
  19. </template>
  20. <script setup>
  21. import {
  22. ref
  23. } from "vue";
  24. const emits = defineEmits(["noticeClick"]);
  25. defineProps({
  26. //公告栏列表
  27. noticeList: {
  28. type: Array,
  29. default: () => {
  30. return [];
  31. },
  32. },
  33. });
  34. </script>
  35. <style lang="scss" scoped>
  36. .noticeBar {
  37. padding-left: 30rpx;
  38. padding-right: 20rpx;
  39. height: 88rpx;
  40. line-height: 88rpx;
  41. background: #ffffff;
  42. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  43. border-radius: 20rpx;
  44. color: #172843;
  45. font-size: 26rpx;
  46. display: flex;
  47. .list {
  48. width: 100%;
  49. height: 100%;
  50. .content {
  51. display: flex;
  52. align-items: center;
  53. .icon-notice {
  54. font-size: 18rpx;
  55. color: #172843;
  56. }
  57. .notice-txt {
  58. flex: 1;
  59. font-size: 26rpx;
  60. color: #172843;
  61. padding-left: 20rpx;
  62. overflow: hidden;
  63. text-overflow: ellipsis;
  64. white-space: nowrap;
  65. margin-right: 10rpx;
  66. }
  67. .right {
  68. display: flex;
  69. flex-direction: row;
  70. justify-content: center;
  71. align-items: center;
  72. .arror {
  73. width: 30rpx;
  74. height: 30rpx;
  75. }
  76. .label {
  77. font-size: 24rpx;
  78. color: #00b38b;
  79. line-height: 36rpx;
  80. margin-right: 10rpx;
  81. }
  82. }
  83. }
  84. }
  85. }
  86. </style>