Blame view

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