From 964faa1077a89713910063c39ebe08fac4e4c56e Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期四, 24 七月 2025 17:44:18 +0800 Subject: [PATCH] 企业维修适配修改 --- pages/home/home.vue | 80 +++++++++++++++++++++++++++++----------- 1 files changed, 58 insertions(+), 22 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index 2a927ef..b159b0a 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -53,7 +53,10 @@ <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.1 + 's'}]" v-for="(item,index) in osList" :key="index" @tap="goPage(item.page)"> <view class="padding text-center"> - <image :src="item.icon" style="width:28px;height:28px;" /> + <image :src="item.icon" style="width:28px;height:28px;"> + <view class="cu-tag badge margin-top-sm" style="margin-left:1.2em" + v-if="getTtemDotInfo(item)"></view> + </image> <view class="margin-top-xs">{{item.title}}</view> </view> </view> @@ -70,7 +73,10 @@ <view class="cu-item animation-slide-bottom" :style="[{animationDelay: (index + 1)*0.1 + 's'}]" v-for="(item,index) in wsList" :key="index" @tap="goPage(item.page)"> <view class="padding text-center"> - <image :src="item.icon" style="width:28px;height:28px;" /> + <image :src="item.icon" style="width:28px;height:28px;"> + <view class="cu-tag badge margin-top-sm" style="margin-left:1.2em" + v-if="getTtemDotInfo(item)"></view> + </image> <view class="margin-top-xs">{{item.title}}</view> </view> </view> @@ -96,45 +102,50 @@ props: { cur: String, }, + // watch: { + // cur: { + // immediate: true, + // handler: function(val, oldVal) { + // console.log('cur', val, oldVal) + // this.initMenu() + // }, + // }, + // }, watch: { - cur: { - immediate: true, - handler: function(val, oldVal) { - console.log('cur', val, oldVal) - this.initMenu() - }, - }, + cur: { + immediate: true, + handler: function(val, oldVal) { + console.log('cur', val, oldVal) + // 鍗充娇鍊兼病鏈夊彉鍖栵紝涔熶富鍔ㄨ皟鐢� initMenu + this.initMenu() + }, + }, }, data() { return { url: { bindingThirdPhone: '/sys/permission/getUserPermissionByToken', - countItem: '/assign/flow/taskCountBySelf' + countItem: '/assign/flow/taskCountBySelf', + waitTiem: 'eam/dashboard/pendingExecOrderCountBySelf' }, swiperList: [{ id: 1, type: 'image', - url: '/static/banner/eam_banner1.png', + url: '/static/banner/fashite-banner.png', link: '' }, { id: 2, type: 'image', - url: '/static/banner/eam_banner2.png', + url: '/static/banner/eam_banner3.png', link: '' }, { id: 3, type: 'image', - url: '/static/banner/eam_banner3.png', - link: '' - }, - { - id: 4, - type: 'image', url: '/static/banner/eam_banner4.png', link: '' - }, + } ], middleApps: [{ icon: 'line2_icon1.png', @@ -152,7 +163,9 @@ wsList: ws.data, msgCount: 0, toDomsgCount: 0, - + unExecRepairOrderCount: 0, + unExecInspectionOrderCount: 0, + unExecMaintenanceOrderCount: 0, dot: { mailHome: false } @@ -165,6 +178,7 @@ this.onSocketReceive() this.saveClientId() this.taskCountBySelf(); + this.getItemCount(); this.loadCount(0); }, goPage(page) { @@ -206,6 +220,22 @@ this.toDomsgCount = res.data.result }) }, + + getItemCount() { + this.$http.get(this.url.waitTiem).then(res => { + const { + unExecRepairOrderCount, + unExecInspectionOrderCount, + unExecMaintenanceOrderCount + } = res.data.result; + + // 鎴栬�呭崟鐙祴鍊肩粰涓嶅悓鐨勬暟鎹睘鎬� + this.unExecRepairOrderCount = unExecRepairOrderCount; + this.unExecInspectionOrderCount = unExecInspectionOrderCount; + this.unExecMaintenanceOrderCount = unExecMaintenanceOrderCount; + }); + }, + loadCount(flag) { console.log("loadCount::flag", flag) let url = '/sys/annountCement/listByUser'; @@ -247,11 +277,17 @@ }, getTtemDotInfo(item) { if (item.page === 'ToDoList' && this.toDomsgCount > 0) { - // return this.toDomsgCount - return true + return true; + } else if (item.page === 'maintenanceReport' && this.unExecRepairOrderCount > 0) { + return true; + } else if (item.page === 'checkList' && this.unExecInspectionOrderCount > 0) { + return true; + } else if (item.page === 'baoZhou' && this.unExecMaintenanceOrderCount > 0) { + return true; } return false; } + } } </script> -- Gitblit v1.9.3