Commit cd36de4dcaa1d727fa11cda42b4ce7264e193cab
1 parent
91c75868
滚动播报
Showing
2 changed files
with
28 additions
and
42 deletions
src/components/device/index.vue
... | ... | @@ -35,44 +35,6 @@ |
35 | 35 | </td> |
36 | 36 | </tr> |
37 | 37 | </table> |
38 | - <!--<table class="deviceTb">--> | |
39 | - <!--<tr>--> | |
40 | - <!--<td>--> | |
41 | - <!--<div class="deviceBg eleVerHorCenter-box">--> | |
42 | - <!--<table class="PDAcontent">--> | |
43 | - <!--<tr><td><span>{{PDANum}}</span> </td></tr>--> | |
44 | - <!--<tr><td><div>PDA</div></td></tr>--> | |
45 | - <!--</table>--> | |
46 | - <!--</div>--> | |
47 | - <!--</td>--> | |
48 | - <!--<td>--> | |
49 | - <!--<div class="deviceBg eleVerHorCenter-box">--> | |
50 | - <!--<table class="diCicontent">--> | |
51 | - <!--<tr><td><span>{{diCiNum}}</span> </td></tr>--> | |
52 | - <!--<tr><td><div>地磁</div></td></tr>--> | |
53 | - <!--</table>--> | |
54 | - <!--</div>--> | |
55 | - <!--</td>--> | |
56 | - <!--</tr>--> | |
57 | - <!--<tr>--> | |
58 | - <!--<td>--> | |
59 | - <!--<div class="deviceBg eleVerHorCenter-box">--> | |
60 | - <!--<table class="daoZhacontent">--> | |
61 | - <!--<tr><td><span>{{daoZha}}</span> </td></tr>--> | |
62 | - <!--<tr><td><div>道闸</div></td></tr>--> | |
63 | - <!--</table>--> | |
64 | - <!--</div>--> | |
65 | - <!--</td>--> | |
66 | - <!--<td>--> | |
67 | - <!--<div class="deviceBg eleVerHorCenter-box">--> | |
68 | - <!--<table class="youDaocontent">--> | |
69 | - <!--<tr><td><span>{{youDaoNum}}</span> </td></tr>--> | |
70 | - <!--<tr><td><div>诱导屏</div></td></tr>--> | |
71 | - <!--</table>--> | |
72 | - <!--</div>--> | |
73 | - <!--</td>--> | |
74 | - <!--</tr>--> | |
75 | - <!--</table>--> | |
76 | 38 | </div> |
77 | 39 | </div> |
78 | 40 | </div> |
... | ... | @@ -102,13 +64,18 @@ import { deviceAddress } from '../../api/api' |
102 | 64 | onLoad() { |
103 | 65 | deviceAddress({orgIds: this.GLOBAL.paramsvariables}).then((response)=>{ |
104 | 66 | let data = response.data.data |
67 | + console.log(data) | |
105 | 68 | this.PDANum = data[0].num |
106 | 69 | this.PDAName = data[0].deviceName |
107 | 70 | this.diCiNum = data[1].num |
108 | 71 | this.diCiName = data[1].deviceName |
109 | 72 | this.daoZhaNum = data[2].num |
73 | + | |
110 | 74 | this.daoZhaName = data[2].deviceName |
111 | 75 | this.youDaoNum = data[3].num |
76 | + if(this.youDaoNum == 0){ | |
77 | + this.youDaoNum = '-' | |
78 | + } | |
112 | 79 | this.youDaoName = data[3].deviceName |
113 | 80 | }).catch((response)=>{ |
114 | 81 | console.log(response); | ... | ... |
src/components/orderMessage/index.vue
... | ... | @@ -10,8 +10,8 @@ |
10 | 10 | <li class="orderMoney">收费金额</li> |
11 | 11 | </ul> |
12 | 12 | <div class="nwwest-roll news-wrap" id="nwwest-roll"> |
13 | - <ul id="roll-ul"> | |
14 | - <li v-for="(item,index) in list" ref="rollul" :class="{anim:animate==true}" :key="index"> | |
13 | + <ul id="roll-ul" class="roll-ul" :style="{ top }"> | |
14 | + <li v-for="(item,index) in list" ref="rollul" :key="index"> | |
15 | 15 | <div :title="item.orderId">{{item.orderId}}</div> |
16 | 16 | <div :title="item.plName">{{item.plName}}</div> |
17 | 17 | <div :title="item.orderActFee">{{item.orderActFee|formatMoney}}</div> |
... | ... | @@ -32,10 +32,16 @@ |
32 | 32 | orderList:"",//公告列表 |
33 | 33 | //marqueeHeight: '100%', |
34 | 34 | name: '订单公告', |
35 | - animate: true, | |
35 | + activeIndex: 0, | |
36 | + intnum: undefined, | |
36 | 37 | list: [] |
37 | 38 | } |
38 | 39 | }, |
40 | + computed: { | |
41 | + top() { | |
42 | + return - this.activeIndex * 26 + 'px'; | |
43 | + } | |
44 | + }, | |
39 | 45 | created() { |
40 | 46 | this.onLoad() |
41 | 47 | }, |
... | ... | @@ -46,7 +52,15 @@ |
46 | 52 | }).then((response)=>{ |
47 | 53 | let data = response.data.data |
48 | 54 | this.list = data; |
49 | - setInterval(this.scroll, 2000) | |
55 | + var that = this | |
56 | + this.intnum = setInterval(_ => { | |
57 | + if (this.activeIndex < this.list.length) { | |
58 | + this.activeIndex += 1; | |
59 | + that.list.push(that.list[0]); | |
60 | + } else { | |
61 | + this.activeIndex = 0; | |
62 | + } | |
63 | + }, 1000); | |
50 | 64 | }).catch((response)=>{ |
51 | 65 | console.log(response); |
52 | 66 | }) |
... | ... | @@ -82,6 +96,11 @@ |
82 | 96 | height: 40px; |
83 | 97 | line-height: 40px; |
84 | 98 | font-size: 14px; |
99 | + .roll-ul{ | |
100 | + height: 100%; | |
101 | + position: relative; | |
102 | + transition: top 0.5s; | |
103 | + } | |
85 | 104 | li{ |
86 | 105 | height: 40px; |
87 | 106 | float: left; | ... | ... |