|
@@ -2,7 +2,7 @@
|
2
|
2
|
<div class="projectIndex">
|
3
|
3
|
<img src="../assets/images/bg.jpg" class="centerLabel cover bg" alt>
|
4
|
4
|
<div class="content flex-h">
|
5
|
|
- <div class="left flex-v" v-if="pageDetail !== null">
|
|
5
|
+ <div class="left flex-v" v-if="pageDetail !== null && (pageDetail.detail.noticeShow || pageDetail.detail.weatherShow)">
|
6
|
6
|
<div class="weather">
|
7
|
7
|
<div class="date flex-h">
|
8
|
8
|
<span>{{currentDate}}</span>
|
|
@@ -63,7 +63,7 @@
|
63
|
63
|
</transition-group>
|
64
|
64
|
<div v-if="audios.length > 0" :hidden="true">
|
65
|
65
|
<div v-for="(audio, k) in audios" :key="k">
|
66
|
|
- <audio v-if="audio.isShow" @ended="audioEnd(k)">
|
|
66
|
+ <audio v-if="audio.isShow" @ended="audioEnd(k)" autoplay>
|
67
|
67
|
<source :src="audio.url">
|
68
|
68
|
</audio>
|
69
|
69
|
</div>
|
|
@@ -117,7 +117,7 @@ export default {
|
117
|
117
|
return this.$refs.mySwiper.swiper
|
118
|
118
|
},
|
119
|
119
|
weatherDetail () {
|
120
|
|
- let target = JSON.parse(this.pageDetail.weather)
|
|
120
|
+ let target = this.pageDetail.weather ? JSON.parse(this.pageDetail.weather) : undefined
|
121
|
121
|
return !target ? undefined : target.forecasts[0].casts[0]
|
122
|
122
|
},
|
123
|
123
|
tempRange () {
|
|
@@ -135,15 +135,17 @@ export default {
|
135
|
135
|
swiperSlide
|
136
|
136
|
},
|
137
|
137
|
created () {
|
138
|
|
- const _that = this
|
|
138
|
+ // const _that = this
|
139
|
139
|
window.setInterval(() => {
|
140
|
|
- let dels = _that.users.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
|
141
|
|
- dels.map(x => {
|
142
|
|
- _that.users.splice(this.users.findIndex(i => i.createdata === x.createdata), 1)
|
|
140
|
+ let dels = this.users.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
|
|
141
|
+ dels.forEach(x => {
|
|
142
|
+ const inx = this.users.findIndex(i => i.createdata === x.createdata)
|
|
143
|
+ this.users.splice(inx, 1)
|
143
|
144
|
})
|
144
|
|
- let delaudios = _that.audios.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
|
145
|
|
- delaudios.map(x => {
|
146
|
|
- _that.audios.splice(this.audios.findIndex(i => i.createdata === x.createdata), 1)
|
|
145
|
+ let delaudios = this.audios.filter(x => Date.parse(new Date()) - x.createdata > this.diffM)
|
|
146
|
+ delaudios.forEach(x => {
|
|
147
|
+ const inx = this.audios.findIndex(i => i.createdata === x.createdata)
|
|
148
|
+ this.audios.splice(inx, 1)
|
147
|
149
|
})
|
148
|
150
|
}, 100)
|
149
|
151
|
this.ws = new XWebSocket({
|
|
@@ -195,11 +197,11 @@ export default {
|
195
|
197
|
}
|
196
|
198
|
},
|
197
|
199
|
audioEnd (index) {
|
198
|
|
- let as = this.audios
|
199
|
|
- this.audios = as.map((x, i) => {
|
|
200
|
+ this.audios = this.audios.slice().map((x, i) => {
|
200
|
201
|
if (i === index) {
|
201
|
202
|
x.isShow = false
|
202
|
203
|
}
|
|
204
|
+ return x
|
203
|
205
|
})
|
204
|
206
|
},
|
205
|
207
|
receviedMsg (e) {
|