|
@@ -1,41 +1,33 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="welcomePage">
|
3
|
3
|
<div class="welcome-con">
|
4
|
|
- <img v-if="!users.length" class="welcome-img" src="../assets/images/welcome/text.png" alt="">
|
|
4
|
+ <img :hidden="!!users.length" class="welcome-img" src="../assets/images/welcome/text.png" alt="">
|
5
|
5
|
<div class="content flex-h">
|
6
|
|
- <div class="flex-item">
|
7
|
|
- <div v-if="users.length">
|
8
|
|
- <!-- <transition-group class="centerLabel userList" tag="ul" name="fade">
|
|
6
|
+ <!-- <p class="font">黄先生,欢迎光临银城.原溪</p> -->
|
|
7
|
+ <div :hidden="!users.length" >
|
|
8
|
+ <transition-group class="centerLabel userList" tag="ul" name="fade">
|
9
|
9
|
<li v-for="(user, k) in users" :key="k+'li'" class="fade-item">
|
10
|
10
|
<span>{{user.name}}</span>
|
11
|
11
|
<span>{{user.words}}</span>
|
12
|
12
|
</li>
|
13
|
|
- </transition-group> -->
|
14
|
|
- <ul class="centerLabel userList">
|
|
13
|
+ </transition-group>
|
|
14
|
+ <!-- <ul class="centerLabel userList">
|
15
|
15
|
<li v-for="(user, k) in users" :key="k+'li'" class="fade-item">
|
16
|
16
|
<span>{{user.name}}</span>
|
17
|
17
|
<span>{{user.words}}</span>
|
18
|
18
|
</li>
|
19
|
|
- </ul>
|
20
|
|
- </div>
|
21
|
|
- <!-- <div v-if="audios.length > 0" :hidden="true">
|
22
|
|
- <div v-for="(audio, k) in audios" :key="k+'audio'">
|
23
|
|
- <audio v-if="audio.isShow" @ended="audioEnd(k)" autoplay>
|
24
|
|
- <source :src="audio.url">
|
25
|
|
- </audio>
|
26
|
|
- </div>
|
27
|
|
- </div> -->
|
28
|
|
- <div >
|
|
19
|
+ </ul> -->
|
|
20
|
+ <div v-if="audios" :hidden="true">
|
29
|
21
|
<div v-for="(audio, k) in audios" :key="k+'audio'">
|
30
|
22
|
<audio @ended="audioEnd(k)" autoplay>
|
31
|
23
|
<source :src="audio.url">
|
32
|
24
|
</audio>
|
33
|
25
|
</div>
|
34
|
|
- </div>
|
35
|
26
|
</div>
|
|
27
|
+ </div>
|
36
|
28
|
</div>
|
37
|
29
|
</div>
|
38
|
|
- <x-maquee class="marquee" v-if="pageDetail !== null && (pageDetail.detail.noticeShow || pageDetail.detail.weatherShow)">
|
|
30
|
+ <x-maquee class="marquee" v-if="weatherInfo !== null">
|
39
|
31
|
<ul>
|
40
|
32
|
<li v-if="weatherDetail">
|
41
|
33
|
<span class="shares-name font24">{{currentDate}}</span>
|
|
@@ -95,10 +87,10 @@ export default {
|
95
|
87
|
},
|
96
|
88
|
computed: {
|
97
|
89
|
...mapPageState({
|
98
|
|
- pageDetail: x => x.pageDetail
|
|
90
|
+ weatherInfo: x => x.weatherInfo
|
99
|
91
|
}),
|
100
|
92
|
weatherDetail () {
|
101
|
|
- let target = this.pageDetail.weather ? JSON.parse(this.pageDetail.weather) : undefined
|
|
93
|
+ let target = this.weatherInfo
|
102
|
94
|
|
103
|
95
|
if (!target) return undefined
|
104
|
96
|
|
|
@@ -121,7 +113,6 @@ export default {
|
121
|
113
|
created () {
|
122
|
114
|
this.assetdir = this.$route.query.assets || this.assetdir
|
123
|
115
|
this.city = this.$route.query.city || this.city
|
124
|
|
-
|
125
|
116
|
getShares().then(dt => (this.sharesData = dt))
|
126
|
117
|
window.setInterval(() => {
|
127
|
118
|
getShares().then(dt => (this.sharesData = dt))
|
|
@@ -146,8 +137,6 @@ export default {
|
146
|
137
|
autoConnect: true
|
147
|
138
|
})
|
148
|
139
|
|
149
|
|
- // window.console.log(this.$route.query.id, this.$route.query)
|
150
|
|
-
|
151
|
140
|
// const wsURI = `${window.location.origin.replace('http', 'ws')}/api/ws/${this.$route.query.id}`
|
152
|
141
|
this.ws.connect('ws://192.168.0.67:8080/ws/screen/113')
|
153
|
142
|
this.init()
|
|
@@ -172,28 +161,11 @@ export default {
|
172
|
161
|
},
|
173
|
162
|
methods: {
|
174
|
163
|
...mapPageActions([
|
175
|
|
- 'getNewIndex'
|
|
164
|
+ 'getWeather'
|
176
|
165
|
]),
|
177
|
166
|
...mapPageMutations([
|
178
|
|
- 'emptyPageDetail'
|
|
167
|
+ 'emptyWeatherInfo'
|
179
|
168
|
]),
|
180
|
|
- newData (info) {
|
181
|
|
- if (info.classId - 0 === 1 && this.users.filter(x => x.classId - 0 === 1).length > 0) {
|
182
|
|
- this.users = this.users.map((x) => {
|
183
|
|
- if (x.classId - 0 === 1) {
|
184
|
|
- return { ...x, createdata: Date.parse(new Date()) }
|
185
|
|
- } else {
|
186
|
|
- return x
|
187
|
|
- }
|
188
|
|
- })
|
189
|
|
- } else {
|
190
|
|
- if (this.users.length >= 3) {
|
191
|
|
- this.users.splice(0, 1)
|
192
|
|
- }
|
193
|
|
- this.users = [...this.users, { ...info, createdata: Date.parse(new Date()) }]
|
194
|
|
- this.audios = [...this.audios, { ...info, isShow: true, createdata: Date.parse(new Date()) }]
|
195
|
|
- }
|
196
|
|
- },
|
197
|
169
|
audioEnd (index) {
|
198
|
170
|
this.audios = this.audios.slice().map((x, i) => {
|
199
|
171
|
if (i === index) {
|
|
@@ -208,6 +180,7 @@ export default {
|
208
|
180
|
return
|
209
|
181
|
}
|
210
|
182
|
const res = JSON.parse(e.data)
|
|
183
|
+ console.log(res, 'res11111')
|
211
|
184
|
if (res.type && res.type === 'cmd') {
|
212
|
185
|
// 如果这种类型的消息, 说明是行为控制
|
213
|
186
|
switch (res.data) {
|
|
@@ -219,6 +192,7 @@ export default {
|
219
|
192
|
break
|
220
|
193
|
}
|
221
|
194
|
} else {
|
|
195
|
+ console.log(res, 'res2222')
|
222
|
196
|
this.newData({
|
223
|
197
|
name: !res.person.words ? '' : res.person.words,
|
224
|
198
|
classId: res.person.typeId,
|
|
@@ -227,10 +201,28 @@ export default {
|
227
|
201
|
})
|
228
|
202
|
}
|
229
|
203
|
},
|
|
204
|
+ newData (info) {
|
|
205
|
+ if (info.classId - 0 === 1) {
|
|
206
|
+ // if (info.classId - 0 === 1 && this.users.filter(x => x.classId - 0 === 1).length > 0) {
|
|
207
|
+ this.users = this.users.map((x) => {
|
|
208
|
+ if (x.classId - 0 === 1) {
|
|
209
|
+ return { ...x, createdata: Date.parse(new Date()) }
|
|
210
|
+ } else {
|
|
211
|
+ return x
|
|
212
|
+ }
|
|
213
|
+ })
|
|
214
|
+ } else {
|
|
215
|
+ if (this.users.length >= 3) {
|
|
216
|
+ this.users.splice(0, 1)
|
|
217
|
+ }
|
|
218
|
+ this.users = [...this.users, { ...info, createdata: Date.parse(new Date()) }]
|
|
219
|
+ this.audios = [...this.audios, { ...info, isShow: true, createdata: Date.parse(new Date()) }]
|
|
220
|
+ }
|
|
221
|
+ },
|
230
|
222
|
init () { // 初始化
|
231
|
|
- this.emptyPageDetail()
|
|
223
|
+ this.emptyWeatherInfo()
|
232
|
224
|
this.getDate()
|
233
|
|
- this.getNewIndex({ id: this.$route.query.id, city: this.city })
|
|
225
|
+ this.getWeather({ city: this.city })
|
234
|
226
|
},
|
235
|
227
|
getDate () { // 获取当前时间
|
236
|
228
|
let currentTime = Date.now()
|
|
@@ -257,15 +249,16 @@ export default {
|
257
|
249
|
background: url('../assets/images/welcome/bg.jpg') no-repeat center ;
|
258
|
250
|
background-size: 100% 100%;
|
259
|
251
|
.fade-item {
|
260
|
|
- transition: all 0.5s;
|
261
|
252
|
display: inline-block;
|
262
|
253
|
}
|
263
|
|
- .fade-enter,
|
264
|
|
- .fade-leave-to {
|
|
254
|
+ .fade-enter,.fade-leave-to{
|
265
|
255
|
opacity: 0;
|
|
256
|
+ }
|
|
257
|
+ .fade-enter-to,.fade-leave{
|
|
258
|
+ opacity: 1;
|
266
|
259
|
}
|
267
|
|
- .fade-leave-active {
|
268
|
|
- position: absolute;
|
|
260
|
+ .fade-enter-active,.fade-leave-active{
|
|
261
|
+ transition: all 0.5s;
|
269
|
262
|
}
|
270
|
263
|
.welcome-con{
|
271
|
264
|
width: 100%;
|
|
@@ -281,6 +274,11 @@ export default {
|
281
|
274
|
.content{
|
282
|
275
|
width: 100%;
|
283
|
276
|
height: 100%;
|
|
277
|
+ .font{
|
|
278
|
+ font-size: 5vw;
|
|
279
|
+ font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
|
|
280
|
+ font-weight: 900;
|
|
281
|
+ }
|
284
|
282
|
.userList{
|
285
|
283
|
width: 100%;
|
286
|
284
|
height: 100%;
|