notice.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="notice-list" :class="'terminal'+terminal" :style="{backgroundColor:componentContent.bgColor}">
  3. <swiper class="swiper-wrapper" :circular="true" :indicator-dots="false" :autoplay="true" :vertical="true">
  4. <swiper-item class="swiper-slide" v-for="(item,index) in noticesList" :key="index">
  5. <div class="a-link" @click="jumpNoticeDetail(item)" :style="{color:componentContent.titColor}"><span>{{item.noticeTitle}}</span></div>
  6. </swiper-item>
  7. </swiper>
  8. </div>
  9. </template>
  10. <script>
  11. import api from '../config/api'
  12. import { funMixin } from '../config/mixin'
  13. import { directive, Swiper, SwiperSlide } from 'vue-awesome-swiper'
  14. // import 'swiper/css/swiper.css'
  15. export default {
  16. name: "noticeComponent",
  17. mixins: [funMixin],
  18. data () {
  19. return {
  20. noticesList: [],
  21. }
  22. },
  23. props: {
  24. terminal: {
  25. type: Number,
  26. default: 4
  27. },
  28. componentContent: {
  29. type: Object
  30. }
  31. },
  32. mounted() {
  33. this.getData()
  34. },
  35. methods: {
  36. getData() {
  37. const _ = this
  38. let _url = `${api.getNotices}`
  39. const params = {
  40. method: 'GET',
  41. url: _url,
  42. }
  43. this.sendReq(params, (res) => {
  44. _.noticesList = res.data
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .notice-list{
  52. height: 60upx;
  53. line-height: 60upx;
  54. overflow: hidden;
  55. .a-link{
  56. // display: block;
  57. cursor: pointer;
  58. overflow: hidden;
  59. text-overflow:ellipsis;
  60. white-space: nowrap;
  61. margin: 0 20upx;
  62. span{
  63. display: inline-block;
  64. padding-left: 50upx;
  65. font-size: 24upx;
  66. background: url("../static/images/notice/ico_notice2.png") no-repeat left center;
  67. background-size: 30upx 30upx;
  68. }
  69. }
  70. &.terminal4{
  71. height: 50upx;
  72. line-height: 50upx;
  73. padding: 0;
  74. .swiper-container{
  75. height: 100%;
  76. width: 1200upx;
  77. max-width: 100%;
  78. margin: 0 auto;
  79. }
  80. .a-link{
  81. cursor: pointer;
  82. display: block;
  83. text-align: left;
  84. margin: 0 20upx;
  85. span{
  86. display: block;
  87. padding-left: 25upx;
  88. font-size: 14upx;
  89. background: url("../static/images/notice/ico_notice.png") no-repeat left center;
  90. }
  91. }
  92. }
  93. }
  94. </style>