From c5e49c10499435802a6551b98772f95660c6f85a Mon Sep 17 00:00:00 2001 From: 王飞 <14095171+wang-fei12345@user.noreply.gitee.com> Date: 星期五, 07 三月 2025 09:15:56 +0800 Subject: [PATCH] 定位app首次提交 --- pages/index/index.vue | 132 ++++++++++++++++++++++++++++--------------- 1 files changed, 86 insertions(+), 46 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index c85c037..ca4761a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,13 +1,15 @@ <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> @@ -19,7 +21,11 @@ </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> @@ -42,6 +48,7 @@ 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'; @@ -56,6 +63,7 @@ webbCom, successCom, homeCom, + cejuCom, mainCom, personCom, alarmCom, @@ -64,7 +72,7 @@ }, data() { return { - + showfaka: false, show: true, title: '鐧婚珮鏈涜繙', description: '娆茬┓鍗冮噷鐩紝鏇翠笂涓�灞傛ゼ', @@ -83,7 +91,7 @@ text: '鍒嗕韩' }], warnlist: [], - tabbarList: [{ + tabbarList: [{ title: '棣栭〉', activeIcon: '/static/tabbar/report_f_icon.png', inactiveIcon: '/static/tabbar/report_l_icon.png', @@ -140,7 +148,6 @@ onLoad() { const systemInfo = uni.getSystemInfoSync() this.tabBarHeight = systemInfo.windowBottom - console.log(this.tabBarHeight); this.earlyWarning(); this.findWarningNum(); }, @@ -150,7 +157,6 @@ }, heHeight() { let num = 0; - console.log(num); return num; } }, @@ -161,21 +167,31 @@ }, 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 @@ -208,10 +224,22 @@ }, 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'] @@ -221,6 +249,7 @@ 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', @@ -239,29 +268,30 @@ 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(); @@ -272,16 +302,18 @@ 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(); @@ -289,10 +321,18 @@ }, 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) { -- Gitblit v1.9.3