From 8241cb8888234385aa481ca16f68fba3eece6c65 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 11 Jun 2024 13:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.vue | 65 ++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ac9170fa..3dad1d56 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -127,7 +127,6 @@ this.tabbar.forEach(res => { res.children.forEach(res => { i++ - console.log(res.name, i) }) }) this.getDictory() @@ -156,30 +155,28 @@ }, onShow() { if (uni.getStorageSync("hasLogin") == null || uni.getStorageSync("hasLogin") == false) { - // uni.showModal({ - // title: '未登录', - // content: '您未登录 , 需要登录后才能继续', //如果需要强制登录,不显示取消按钮 - // showCancel: !this.forcedLogin, - // success: (res) => { - // if (res.confirm) { - // //如果需要强制登录,使用reLanch方式 - // if (this.forcedLogin) { - // uni.reLaunch({ - // url: '../login/index' - // }) - // } else { - // uni.navigateTo({ - // url: '../login/index' - // }) - // } - // } - // } - // }) - uni.reLaunch({ - url: '../login/index' + uni.showModal({ + title: '未登录', + content: '您未登录 , 需要登录后才能继续', //如果需要强制登录,不显示取消按钮 + showCancel: !this.forcedLogin, + success: (res) => { + if (res.confirm) { + //如果需要强制登录,使用reLanch方式 + if (this.forcedLogin) { + uni.reLaunch({ + url: '../login/index' + }) + } else { + uni.navigateTo({ + url: '../login/index' + }) + } + } + } }) } else { this.timerRefresh(); + } }, onUnload() { @@ -208,7 +205,28 @@ this.menusCount = res.data; this.tabbar.forEach(item => { item.children.forEach(rightItem => { - var count = this.menusCount[rightItem.component] + + var count = 0 + if(Array.isArray(this.menusCount[rightItem.component.split('-')[0]])&&this.menusCount[rightItem.component.split('-')[0]].length>0){ + if(rightItem.component=='productionreturn'){ + this.menusCount[rightItem.component].forEach((item)=>{ + count += item.count + }) + }else{ + if(rightItem.component=='inventorymove-HoldToScrap'){ + console.log(rightItem.component) + } + this.menusCount[rightItem.component.split('-')[0]].forEach((item)=>{ + if(item.businessType ==rightItem.component.split('-')[1] ){ + count = item.count + } + }) + + } + + }else{ + count =this.menusCount[rightItem.component] + } if (count != undefined) { rightItem.count = count; } @@ -413,7 +431,6 @@ that.filterList = []; }, input(v) { - console.log("222", v) this.serchval = v this.nomore = false if (this.serchval == "") {