diff --git a/src/components/global.vue b/src/components/global.vue index 304cda4..c9d7f4e 100644 --- a/src/components/global.vue +++ b/src/components/global.vue @@ -23,7 +23,8 @@
-
{{ state.name }}
+
{{ state.name }}
+
{{ state.name2 }}
@@ -99,6 +100,7 @@ import { getAdvertisement, getDeviceByCode } from '@/api/resultApi' import VueQr from 'vue-qr' import { getDeviceCode } from '@/api/bdResultApi' +import alert from '../utils/alert' export default { name: 'global', @@ -195,7 +197,7 @@ this.cite.loadingSta = { sta: false } - }) + }).catch(error => {alert(error,this)}) }, load() { if (this.cite.facility === '') { @@ -206,9 +208,13 @@ this.initMqtt() setInterval(() => { if (!this.state.sta && this.cite.state.sta) { + let time = 3000 + if(this.cite.state.name2) { + time = 6000 + } setTimeout(() => { this.cite.state.sta = false - }, 3000) + }, time) } this.state = this.cite.state }, 1000) @@ -302,7 +308,7 @@ }) getDeviceByCode({ code: this.code }).then(res => { this.cite.facility = res - }) + }).catch(error => {alert(error,this)}) } } } else if (data.taskStatus == 'INTERRUPT') { @@ -343,7 +349,7 @@ console.log(res) this.cite.facility = res this.getAdvertisement() - }) + }).catch(error => {alert(error,this)}) } }, // 获取广告链接 @@ -355,7 +361,7 @@ getAdvertisement({ deviceId: this.cite.facility.id, screen: name }).then(res => { // console.log(res) this.cite.advertisement = res || '' - }) + }).catch(error => {alert(error,this)}) }, play() { console.log(this.$refs.audio)