Blame view

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