Blame view

src/views/newssection.vue 3.92 KB
2241e670   liuqimichale   消息
1
  <template>
9598d2c1   liuqimichale   消息
2
    <div >
2241e670   liuqimichale   消息
3
      <titlesection title="消息"></titlesection>
adf82b69   liuqimichale   调取接口
4
5
      <div class="content">
        <ul class="news-wrap">
6858abb9   liuqimichale   订单中心 停车场
6
          <li class="orderNum">车牌号</li>
adf82b69   liuqimichale   调取接口
7
8
9
10
11
12
          <li class="orderPark">停车场</li>
          <li class="orderMoney">收费金额</li>
        </ul>
        <div class="nwwest-roll  news-wrap" id="nwwest-roll">
          <ul id="roll-ul" class="roll-ul" :style="{ top }">
            <li v-for="(item,index) in list" ref="rollul"  :key="index">
6858abb9   liuqimichale   订单中心 停车场
13
              <div :title="item.carNumber">{{item.carNumber}}</div>
adf82b69   liuqimichale   调取接口
14
15
              <div :title="item.plName">{{item.plName}}</div>
              <div :title="item.orderActFee">{{item.orderActFee|formatMoney}}</div>
9598d2c1   liuqimichale   消息
16
17
18
            </li>
          </ul>
        </div>
adf82b69   liuqimichale   调取接口
19
      </div>
2241e670   liuqimichale   消息
20
21
22
23
24
    </div>
  </template>
  
  <script>
  import titlesection from '../components/titlesection'
adf82b69   liuqimichale   调取接口
25
  import { msgAddress } from '../api/api'
2241e670   liuqimichale   消息
26
27
28
29
30
31
32
33
  
  export default {
    name: 'newssection',
    components: {
      titlesection
    },
    data() {
      return {
adf82b69   liuqimichale   调取接口
34
35
36
37
38
39
40
41
42
43
        orderList:"",//公告列表
        //marqueeHeight: '100%',
        name: '订单公告',
        activeIndex: 0,
        intnum: undefined,
        list: []
      }
    },
    computed: {
      top() {
6858abb9   liuqimichale   订单中心 停车场
44
        return - this.activeIndex * 31 + 'px';
2241e670   liuqimichale   消息
45
46
47
      }
    },
    created() {
adf82b69   liuqimichale   调取接口
48
      this.onLoad()
2241e670   liuqimichale   消息
49
50
    },
    methods: {
adf82b69   liuqimichale   调取接口
51
52
53
54
55
      onLoad() {
        msgAddress({
          orgIds: this.GLOBAL.paramsvariables
        }).then((response)=>{
          let  data = response.data.data
6858abb9   liuqimichale   订单中心 停车场
56
          console.log(data)
adf82b69   liuqimichale   调取接口
57
58
59
60
61
62
63
64
65
66
          this.list = data;
          var that = this
          this.intnum = setInterval(_ => {
            that.list.push(that.list[this.activeIndex]);
            this.activeIndex += 1;
          }, 1000);
        }).catch((response)=>{
          console.log(response);
        })
      },
9598d2c1   liuqimichale   消息
67
      scroll() {
9598d2c1   liuqimichale   消息
68
69
70
71
72
        this.animate = !this.animate;
        var that = this; // 在异步函数中会出现this的偏移问题,此处一定要先保存好this的指向
        setTimeout(function () {
          that.list.push(that.list[0]);
          that.list.shift();
9598d2c1   liuqimichale   消息
73
74
75
          that.animate = !that.animate;  // 这个地方如果不把animate 取反会出现消息回滚的现象,此时把ul 元素的过渡属性取消掉就可以完美实现无缝滚动的效果了
        }, 0)
      }
adf82b69   liuqimichale   调取接口
76
77
78
79
80
    },
    filters:{
      formatMoney: function (value) {
        return (value/100).toFixed(2)+' 元'
      }
2241e670   liuqimichale   消息
81
82
83
84
    }
  }
  </script>
  
9598d2c1   liuqimichale   消息
85
  <style lang="scss" scoped>
adf82b69   liuqimichale   调取接口
86
87
88
89
90
      .content{
        height: calc(100% - 30px);
      }
      .theme-card{
        height: 100%;
feb955a5   liuqimichale   车流量section
91
      }
adf82b69   liuqimichale   调取接口
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
      .news-wrap{
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        .roll-ul{
          height: 100%;
          position: relative;
          transition: top 0.5s;
        }
        li{
          height: 40px;
          float: left;
          padding-left: 0;
          padding-left: 30px;
          background-size: 14px 14px;
          background-position: 10px center;
          background-repeat: no-repeat;
          list-style: none;
          overflow: hidden;
          color: #fff;
        }
        .orderNum{
6858abb9   liuqimichale   订单中心 停车场
114
          width: 90px;
adf82b69   liuqimichale   调取接口
115
116
117
          background-image: url(../assets/img/orderNum.svg) ;
        }
        .orderMoney{
6858abb9   liuqimichale   订单中心 停车场
118
          width: 70px;
adf82b69   liuqimichale   调取接口
119
120
121
          background-image: url(../assets/img/orderMoney.svg) ;
        }
        .orderPark{
6858abb9   liuqimichale   订单中心 停车场
122
          width: calc(100% - 170px);
adf82b69   liuqimichale   调取接口
123
124
125
126
          background-image: url(../assets/img/orderPark.svg) ;
        }
  
      }
9598d2c1   liuqimichale   消息
127
128
      .nwwest-roll {
        width: 100%;
adf82b69   liuqimichale   调取接口
129
        height: calc(100% - 60px);
9598d2c1   liuqimichale   消息
130
131
132
        overflow: hidden;
        transition: all 0.5s;
        li{
adf82b69   liuqimichale   调取接口
133
          width: 100%;
9598d2c1   liuqimichale   消息
134
135
136
          height: 26px;
          line-height: 26px;
          font-size: 12px;
adf82b69   liuqimichale   调取接口
137
          padding-left: 10px;
9598d2c1   liuqimichale   消息
138
          color: #fff;
9598d2c1   liuqimichale   消息
139
          background:rgba(255,255,255,.1);
6858abb9   liuqimichale   订单中心 停车场
140
          margin-bottom: 5px;
adf82b69   liuqimichale   调取接口
141
142
143
144
145
146
          div{
            float: left;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            &:nth-of-type(1){
6858abb9   liuqimichale   订单中心 停车场
147
              width: 90px;
adf82b69   liuqimichale   调取接口
148
149
            }
            &:nth-of-type(2){
6858abb9   liuqimichale   订单中心 停车场
150
              width: calc(100% - 160px);
adf82b69   liuqimichale   调取接口
151
152
            }
            &:nth-of-type(3){
6858abb9   liuqimichale   订单中心 停车场
153
              width: 70px;
adf82b69   liuqimichale   调取接口
154
155
            }
  
9598d2c1   liuqimichale   消息
156
157
158
          }
        }
      }
adf82b69   liuqimichale   调取接口
159
160
    .anim {
       transition: all 0.5s;
2241e670   liuqimichale   消息
161
  
adf82b69   liuqimichale   调取接口
162
    }
2241e670   liuqimichale   消息
163
  </style>