From c097d3a91224061f66ece32277c55dca1d820958 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Wed, 5 Jun 2024 23:32:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/footers/footers.vue | 463 ++++++++++++----------- main.js | 2 +- pages/login/login.vue | 2 +- pages/projectEnd/carManage/indexPage.vue | 8 +- 4 files changed, 245 insertions(+), 230 deletions(-) diff --git a/components/footers/footers.vue b/components/footers/footers.vue index f413e607..a29c8931 100644 --- a/components/footers/footers.vue +++ b/components/footers/footers.vue @@ -18,240 +18,255 @@ props: ['activeTab'], data() { return { - tabList: [ - { - appName: '首页', - moduleIcon2: 'tabIcon-index', - moduleIcon: 'tabIcon-index-active', - plugin: 'projectEnd', - appShow: 1 - }, - { - appName: '我的', - moduleIcon2: 'tabIcon-my2', - moduleIcon: 'tabIcon-my2-active', - plugin: 'my', - appShow: 1 - }], - userInfo: { - accountType: 1 + tabList: [], + userInfo: { + accountType: 1 + }, + haveModuleList: [] + // activeTab: 0 + }; + }, + mounted() { + // console.log(this.tabList) + this.$forceUpdate() + }, + created() { + let that = this; + console.log(666) + setTimeout(function() { + that.getModuleList(); + }, 500) + }, + methods: { + getModuleList() { + var that = this + this.sendRequest({ + url: "xmgl/baseModule/getModuleAndMenuList", + data: { + projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn, + moduleType: 7, + userId: JSON.parse(uni.getStorageSync('userInfo')).userId, }, - haveModuleList: [] - // activeTab: 0 - }; - }, - mounted() { - // console.log(this.tabList) - this.$forceUpdate() - }, - created() { - let that = this; - setTimeout(function() { - that.getModuleList(); - }, 200) - }, - methods: { - getModuleList() { - var that = this - this.sendRequest({ - url: "xmgl/baseModule/getModuleAndMenuList", - data: { - projectSn: JSON.parse(uni.getStorageSync('projectDetail')).projectSn, - moduleType: 7, - userId: JSON.parse(uni.getStorageSync('userInfo')).userId, - }, - method: "post", - success(result) { - if (result.success) { - that.haveModuleList = result.result.moduleList - that.userInfo = JSON.parse(uni.getStorageSync('userInfo')) - if (that.userInfo.accountType == 5 || that.userInfo.accountType == 6 || that - .userInfo - .accountType == 10) { - let findInfo = that.haveModuleList.find(item => item.modulePath == - "/infoCenter/allInfo") - if (findInfo) { - that.tabList = [{ - appName: '消息', - moduleIcon2: 'footerIcon1', - moduleIcon: 'footerIcon2', - plugin: 'mssage', - appShow: 1 - }, { - appName: '首页', - moduleIcon2: 'tabIcon-index', - moduleIcon: 'tabIcon-index-active', - plugin: 'projectEnd', - appShow: 1 - }, { - appName: '我的', - moduleIcon2: 'tabIcon-my2', - moduleIcon: 'tabIcon-my2-active', - plugin: 'my', - appShow: 1 - }] - } - let findWorkSpace = that.haveModuleList.find(item => item.modulePath == - "/workSpace") - if (findWorkSpace) { - that.tabList = [ { - appName: '首页', - moduleIcon2: 'tabIcon-index', - moduleIcon: 'tabIcon-index-active', - plugin: 'projectEnd', - appShow: 1 - }, { - appName: '发起审批', - moduleIcon2: 'submit-n', - moduleIcon: 'submit', - plugin: 'submit', - appShow: 1 - }, { - appName: '工作台', - moduleIcon2: 'workspace-n', - moduleIcon: 'workspace', - plugin: 'workspace', - appShow: 1 - }, { - appName: '我的', - moduleIcon2: 'tabIcon-my2', - moduleIcon: 'tabIcon-my2-active', - plugin: 'my', - appShow: 1 - }] - } - } else if (that.COMPANY == 'sanjiang') { - that.tabList.push({ - appName: '首页总览', - moduleIcon2: 'sjjt_syzl', - moduleIcon: 'sjjt_syzl-tab', - plugin: 'projectManage', - appShow: 1 - }, { - appName: '我的', - moduleIcon2: 'tabIcon-my', - moduleIcon: 'tabIcon-my-select', - plugin: 'my', + method: "post", + success(result) { + if (result.success) { + that.haveModuleList = result.result.moduleList + that.userInfo = JSON.parse(uni.getStorageSync('userInfo')) + if (that.userInfo.accountType == 5 || that.userInfo.accountType == 6 || that + .userInfo + .accountType == 10) { + let findInfo = that.haveModuleList.find(item => item.modulePath == + "/infoCenter/allInfo") + if (findInfo) { + that.tabList = [{ + appName: '消息', + moduleIcon2: 'footerIcon1', + moduleIcon: 'footerIcon2', + plugin: 'mssage', + appShow: 1 + }, { + appName: '首页', + moduleIcon2: 'tabIcon-index', + moduleIcon: 'tabIcon-index-active', + plugin: 'projectEnd', + appShow: 1 + }, { + appName: '我的', + moduleIcon2: 'tabIcon-my2', + moduleIcon: 'tabIcon-my2-active', + plugin: 'my', + appShow: 1 + }] + } + let findWorkSpace = that.haveModuleList.find(item => item.modulePath == + "/workSpace") + if (findWorkSpace) { + that.tabList = [{ + appName: '首页', + moduleIcon2: 'tabIcon-index', + moduleIcon: 'tabIcon-index-active', + plugin: 'projectEnd', + appShow: 1 + }, { + appName: '发起审批', + moduleIcon2: 'submit-n', + moduleIcon: 'submit', + plugin: 'submit', + appShow: 1 + }, { + appName: '工作台', + moduleIcon2: 'workspace-n', + moduleIcon: 'workspace', + plugin: 'workspace', + appShow: 1 + }, { + appName: '我的', + moduleIcon2: 'tabIcon-my2', + moduleIcon: 'tabIcon-my2-active', + plugin: 'my', + appShow: 1 + }] + if (findInfo) { + that.tabList.unshift({ + appName: '消息', + moduleIcon2: 'footerIcon1', + moduleIcon: 'footerIcon2', + plugin: 'mssage', appShow: 1 }) - } else if (that.userInfo.accountType == 11) { - // 供应商 - that.tabList.push({ - appName: '首页总览', - moduleIcon2: 'sjjt_syzl', - moduleIcon: 'sjjt_syzl-tab', - plugin: 'supplierHome', - appShow: 1 - }, { - appName: '我的', - moduleIcon2: 'tabIcon-my', - moduleIcon: 'tabIcon-my-select', - plugin: 'supplierMy', - appShow: 1 - }) - } else { - try { - var moduleList = that.userInfo.menuAuthority.moduleList - for (let i = 0; i < moduleList.length; i++) { - if (moduleList[i].moduleType == 1) { - that.tabList.push(moduleList[i]) - } - } - } catch (e) { - //TODO handle the exception - } - that.tabList.push({ - appName: '我的', - moduleIcon2: 'tabIcon-my', - moduleIcon: 'tabIcon-my-select', - plugin: 'my', - appShow: 1 - }) - } - console.log(result, 777888) } + } else if (that.COMPANY == 'sanjiang') { + that.tabList.push({ + appName: '首页总览', + moduleIcon2: 'sjjt_syzl', + moduleIcon: 'sjjt_syzl-tab', + plugin: 'projectManage', + appShow: 1 + }, { + appName: '我的', + moduleIcon2: 'tabIcon-my', + moduleIcon: 'tabIcon-my-select', + plugin: 'my', + appShow: 1 + }) + } else if (that.userInfo.accountType == 11) { + // 供应商 + that.tabList.push({ + appName: '首页总览', + moduleIcon2: 'sjjt_syzl', + moduleIcon: 'sjjt_syzl-tab', + plugin: 'supplierHome', + appShow: 1 + }, { + appName: '我的', + moduleIcon2: 'tabIcon-my', + moduleIcon: 'tabIcon-my-select', + plugin: 'supplierMy', + appShow: 1 + }) + } else { + try { + var moduleList = that.userInfo.menuAuthority.moduleList + for (let i = 0; i < moduleList.length; i++) { + if (moduleList[i].moduleType == 1) { + that.tabList.push(moduleList[i]) + } + } + } catch (e) { + //TODO handle the exception + } + that.tabList.push({ + appName: '我的', + moduleIcon2: 'tabIcon-my', + moduleIcon: 'tabIcon-my-select', + plugin: 'my', + appShow: 1 + }) + } - }) - }, - tabClick(plugin) { - console.log(plugin) - switch (plugin) { - case 'projectManage': - uni.redirectTo({ - url: '../../pages/projectManage/projectManage' - }) - break; - case 'videoManage': - if (this.userInfo.accountType == 5) { - uni.redirectTo({ - url: '../../pages/videoManage/videoList?sn=' + that.userInfo.sn - }) - } else { - uni.redirectTo({ - url: '../../pages/areaTree/areaTree' - }) - } - break; - case 'my': - uni.redirectTo({ - url: '/pages/my/my' - }) - break; - case 'submit': - uni.redirectTo({ - url: '/pages/submit/submit' - }) - break; - case 'workspace': - uni.redirectTo({ - url: '/pages/workspace/workspace' - }) - break; - case 'supplierHome': - uni.redirectTo({ - url: '/pages/supplier/supplier' - }) - break; - case 'supplierMy': - uni.redirectTo({ - url: '/pages/supplier/my/my' - }) - break; - case 'personManage': - uni.redirectTo({ - url: '../../pages/personManage/personManage' - }) - break; - case 'projectEnd': - uni.redirectTo({ - url: '/pages/projectEnd/projectIndex/projectIndex' - }) - break; - case 'mssage': - uni.redirectTo({ - url: '/pages/messageCenter/messageCenter' - }) - break; - case 'deviceManage': - uni.redirectTo({ - url: '../../pages/deviceManage/deviceManage' - }) - break; - case 'markRoom': - uni.redirectTo({ - url: '../../pages/markRoomManage/markRoomManage' - }) - break; - case 'messageTask': - uni.redirectTo({ - url: '/pages/messageTask/messageTask' - }) - break; + console.log(result, 777888) } } + }) + setTimeout(function() { + if (that.tabList.length == 0) { + that.tabList = [{ + appName: '首页', + moduleIcon2: 'tabIcon-index', + moduleIcon: 'tabIcon-index-active', + plugin: 'projectEnd', + appShow: 1 + }, + { + appName: '我的', + moduleIcon2: 'tabIcon-my2', + moduleIcon: 'tabIcon-my2-active', + plugin: 'my', + appShow: 1 + } + ] + } + }, 1000) + }, + tabClick(plugin) { + console.log(plugin) + switch (plugin) { + case 'projectManage': + uni.redirectTo({ + url: '../../pages/projectManage/projectManage' + }) + break; + case 'videoManage': + if (this.userInfo.accountType == 5) { + uni.redirectTo({ + url: '../../pages/videoManage/videoList?sn=' + that.userInfo.sn + }) + } else { + uni.redirectTo({ + url: '../../pages/areaTree/areaTree' + }) + } + break; + case 'my': + uni.redirectTo({ + url: '/pages/my/my' + }) + break; + case 'submit': + uni.redirectTo({ + url: '/pages/submit/submit' + }) + break; + case 'workspace': + uni.redirectTo({ + url: '/pages/workspace/workspace' + }) + break; + case 'supplierHome': + uni.redirectTo({ + url: '/pages/supplier/supplier' + }) + break; + case 'supplierMy': + uni.redirectTo({ + url: '/pages/supplier/my/my' + }) + break; + case 'personManage': + uni.redirectTo({ + url: '../../pages/personManage/personManage' + }) + break; + case 'projectEnd': + uni.redirectTo({ + url: '/pages/projectEnd/projectIndex/projectIndex' + }) + break; + case 'mssage': + uni.redirectTo({ + url: '/pages/messageCenter/messageCenter' + }) + break; + case 'deviceManage': + uni.redirectTo({ + url: '../../pages/deviceManage/deviceManage' + }) + break; + case 'markRoom': + uni.redirectTo({ + url: '../../pages/markRoomManage/markRoomManage' + }) + break; + case 'messageTask': + uni.redirectTo({ + url: '/pages/messageTask/messageTask' + }) + break; } + } } + }