| | |
| | | <template> |
| | | <view class="index "> |
| | | |
| | | <view style="margin-top: 80px;position: fixed; z-index: 99999999999;"> |
| | | <view style="margin-top: 80px;position: fixed; z-index: 9999999999999999999999;"> |
| | | <view v-for="(item,index) in warnlist" :key="index" style="margin-top: 10px;"> |
| | | <u-alert :show="show" type="warning" :closable="true" :description="item"></u-alert> |
| | | </view> |
| | | </view> |
| | | <homeCom v-if="currentIndex == 0" :tabheight='tabBarHeight' :webHeight='webHeight' :topheight='topheight' |
| | | <homeCom v-if="currentIndex == 0 && !isceju" :tabheight='tabBarHeight' :webHeight='webHeight' :topheight='topheight' |
| | | :bottomheight='bottomheight'></homeCom> |
| | | <cejuCom v-if="currentIndex == 0 && isceju" :webHeight='webHeight' :topheight='topheight' |
| | | ></cejuCom> |
| | | <mainCom v-show="currentIndex == 1" ref="mainRef"></mainCom> |
| | | <equipmentCom v-show="currentIndex == 2"></equipmentCom> |
| | | <fenceCom v-show="currentIndex == 3"></fenceCom> |
| | |
| | | </view> |
| | | |
| | | <tn-skeleton :show="showSkeleton"></tn-skeleton> |
| | | <u-modal confirmText="去登录" title="您还未登录" content="请登录后查看更多内容!" cancelText="再看看" :show="showfaka" |
| | | @cancel="cancelfaka" @confirm="confirmfaka" ref="uModal" :showCancelButton="true" |
| | | :closeOnClickOverlay="false"> |
| | | |
| | | </u-modal> |
| | | <successCom ref="refSuccess"></successCom> |
| | | </view> |
| | | </template> |
| | |
| | | import webviewCom from './webview.vue'; |
| | | import webbCom from './webb.vue'; |
| | | import homeCom from './home.vue'; |
| | | import cejuCom from './ceju.vue'; |
| | | // import dituCom from './ditu.vue'; |
| | | import mainCom from './main.vue'; |
| | | import personCom from './person.vue'; |
| | |
| | | webbCom, |
| | | successCom, |
| | | homeCom, |
| | | cejuCom, |
| | | mainCom, |
| | | personCom, |
| | | alarmCom, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | showfaka: false, |
| | | show: true, |
| | | title: '登高望远', |
| | | description: '欲穷千里目,更上一层楼', |
| | |
| | | text: '分享' |
| | | }], |
| | | warnlist: [], |
| | | tabbarList: [{ |
| | | tabbarList: [{ |
| | | title: '首页', |
| | | activeIcon: '/static/tabbar/report_f_icon.png', |
| | | inactiveIcon: '/static/tabbar/report_l_icon.png', |
| | |
| | | onLoad() { |
| | | const systemInfo = uni.getSystemInfoSync() |
| | | this.tabBarHeight = systemInfo.windowBottom |
| | | console.log(this.tabBarHeight); |
| | | this.earlyWarning(); |
| | | this.findWarningNum(); |
| | | }, |
| | |
| | | }, |
| | | heHeight() { |
| | | let num = 0; |
| | | console.log(num); |
| | | return num; |
| | | } |
| | | }, |
| | |
| | | |
| | | }, |
| | | mounted() { |
| | | |
| | | this.getTabBarHeight(); |
| | | this.$nextTick(() => { |
| | | // 获取系统信息 |
| | | const systemInfo = uni.getSystemInfoSync() |
| | | this.skeletonHeight = systemInfo.safeArea.height |
| | | this.webHeight = this.skeletonHeight - this.tabBarHeight |
| | | |
| | | // this.vuex_status_bar_height = this.webHeight |
| | | this.currentIndex = 0 |
| | | }) |
| | | this.webHeight = this.skeletonHeight - this.vuex_custom_bar_height - this.tabBarHeight + this |
| | | .vuex_status_bar_height |
| | | // store.commit('$tStore', { |
| | | // name: 'webHeight', |
| | | // value: this.webHeight |
| | | // }) |
| | | this.topheight = this.vuex_custom_bar_height + 15 |
| | | this.bottomheight = this.tabBarHeight + 15 |
| | | store.commit('$tStore', { |
| | | name: 'bleHeight', |
| | | value: this.topheight |
| | | }) |
| | | // this.bottomheight = this.tabBarHeight + 15 |
| | | this.currentIndex = 0 |
| | | let indexHeight = 0 |
| | | // #ifdef MP-WEIXIN |
| | | // #ifdef MP-WEIXIN |
| | | this.marginTop = this.vuex_custom_bar_height |
| | | indexHeight = 40 |
| | | // #endif |
| | |
| | | }, 1000) |
| | | |
| | | }, |
| | | onReady() { |
| | | this.getTabBarHeight(); |
| | | }, |
| | | // onReady() { |
| | | // this.getTabBarHeight(); |
| | | // }, |
| | | methods: { |
| | | cancelfaka() { |
| | | this.showfaka = false |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }); |
| | | }, |
| | | confirmfaka() { |
| | | this.showfaka = false |
| | | uni.reLaunch({ |
| | | url: '/pages/index/login' |
| | | }); |
| | | }, |
| | | tabChange(index) { |
| | | uni.redirectTo({ |
| | | url: this.list[index]['pagePath'] |
| | |
| | | uni.createSelectorQuery().in(this).select('.tn-tabbar').boundingClientRect(data => { |
| | | if (data) { |
| | | this.tabBarHeight = data.height; |
| | | this.bottomheight = this.tabBarHeight + 15 |
| | | var allheight = this.skeletonHeight - this.tabBarHeight - 16 |
| | | store.commit('$tStore', { |
| | | name: 'vuex_custom_index_height', |
| | |
| | | return (hours * 3600) + (minutes * 60) + seconds; |
| | | }, |
| | | earlyWarning() { |
| | | if (this.vuex_is_login) { |
| | | earlyWarning().then((res) => { |
| | | var list = [] |
| | | // this.warnlist=res.data |
| | | if (res.data != null) { |
| | | res.data.forEach((e, i) => { |
| | | console.log("测试预警============》》》》》》》》》》》》》"); |
| | | const time2InSeconds = this.timeToSeconds(e.begtime); |
| | | const time1InSeconds = this.timeToSeconds(formatDate(new Date(), |
| | | 'hh:mm:ss')); |
| | | // 计算两个时间的秒数差 |
| | | const secondsDifference = Math.abs(time2InSeconds - time1InSeconds); |
| | | // 将秒数差转换为分钟数 |
| | | const minutesDifference = Math.floor(secondsDifference / 60); |
| | | |
| | | earlyWarning().then((res) => { |
| | | // console.log(res); |
| | | var list = [] |
| | | // this.warnlist=res.data |
| | | if (res.data != null) { |
| | | res.data.forEach((e, i) => { |
| | | console.log("测试预警============》》》》》》》》》》》》》"); |
| | | const time2InSeconds = this.timeToSeconds(e.begtime); |
| | | const time1InSeconds = this.timeToSeconds(formatDate(new Date(), 'hh:mm:ss')); |
| | | // 计算两个时间的秒数差 |
| | | const secondsDifference = Math.abs(time2InSeconds - time1InSeconds); |
| | | // 将秒数差转换为分钟数 |
| | | const minutesDifference = Math.floor(secondsDifference / 60); |
| | | |
| | | // this.warnlist.push( e.fencename + '还有' + minutesDifference + |
| | | // '分钟开始工作,预警内容:' + e.yjcontent + ',请尽快提前准备进入工作区域') |
| | | this.warnlist.push("系统预警:" + e.fencename + '开始工作,请尽快提前准备进入工作区域') |
| | | const message = e.fencename + '还有' + minutesDifference + '分钟开始工作,预警内容:' + e |
| | | .yjcontent + ',请尽快提前准备进入工作区域'; |
| | | }) |
| | | } |
| | | }) |
| | | // this.warnlist.push( e.fencename + '还有' + minutesDifference + |
| | | // '分钟开始工作,预警内容:' + e.yjcontent + ',请尽快提前准备进入工作区域') |
| | | this.warnlist.push("系统预警:" + e.fencename + '开始工作,请尽快提前准备进入工作区域') |
| | | const message = e.fencename + '还有' + minutesDifference + '分钟开始工作,预警内容:' + e |
| | | .yjcontent + ',请尽快提前准备进入工作区域'; |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | setTimeout(() => { |
| | | //5秒播放一次 |
| | | this.earlyWarning(); |
| | |
| | | const params = { |
| | | company: this.company, |
| | | } |
| | | findWarningNum(params).then((res) => { |
| | | if (res.code == 0) { |
| | | this.tabbarList[1].count = res.data |
| | | } else { |
| | | this.$refs.refSuccess.showBox({ |
| | | type: 'error', |
| | | txt: res.msg |
| | | }); |
| | | } |
| | | }) |
| | | if (this.vuex_is_login) { |
| | | findWarningNum(params).then((res) => { |
| | | if (res.code == 0) { |
| | | this.tabbarList[1].count = res.data |
| | | } else { |
| | | this.$refs.refSuccess.showBox({ |
| | | type: 'error', |
| | | txt: res.msg |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | setTimeout(() => { |
| | | //5秒播放一次 |
| | | this.findWarningNum(); |
| | |
| | | }, |
| | | |
| | | chenge(index) { |
| | | this.currentIndex = index; |
| | | if (index == 1) { |
| | | console.log(1111166666); |
| | | if (this.vuex_is_login) { |
| | | |
| | | console.log(index); |
| | | // this.currentIndex = index; |
| | | if (index == 1) { |
| | | |
| | | } |
| | | } else { |
| | | this.showfaka = true |
| | | } |
| | | |
| | | }, |
| | | click(index) { |
| | | |