202 lines
3.9 KiB
Vue
Raw Normal View History

2022-06-08 15:48:09 +08:00
<template>
<view class="footerBox" :class="userInfo.accountType==5||userInfo.accountType==6?'footerBox2':''">
2023-06-19 09:02:35 +08:00
<view @click="tabClick(item.plugin)" class="footerItem" :class="activeTab==item.plugin?'active':''"
v-for="(item,index) in tabList" v-if="item.appShow==1" :key="index">
2022-06-08 15:48:09 +08:00
<image class="tabIcon tabIcon1" :src="'/static/'+item.moduleIcon2+'.png'"></image>
<image class="tabIcon tabIcon2" :src="'/static/'+item.moduleIcon+'.png'"></image>
<view class="desc">
{{item.appName}}
</view>
</view>
</view>
</template>
<script>
export default {
2023-06-19 09:02:35 +08:00
props: ['activeTab'],
2022-06-08 15:48:09 +08:00
data() {
return {
2023-06-19 09:02:35 +08:00
tabList: [],
userInfo: {
accountType: 1
}
2022-06-08 15:48:09 +08:00
// activeTab: 0
};
},
mounted() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
2023-06-19 09:02:35 +08:00
if (this.userInfo.accountType == 5 || this.userInfo.accountType == 6) {
this.tabList.push({
appName: '首页',
moduleIcon2: 'tabIcon-index',
moduleIcon: 'tabIcon-index-active',
plugin: 'projectEnd',
appShow: 1
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my2',
moduleIcon: 'tabIcon-my2-active',
plugin: 'my',
appShow: 1
},
2023-03-22 15:38:12 +08:00
)
2023-06-19 09:02:35 +08:00
} else if (this.COMPANY == 'sanjiang') {
this.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 {
2022-06-08 15:48:09 +08:00
var moduleList = this.userInfo.menuAuthority.moduleList
for (let i = 0; i < moduleList.length; i++) {
2023-06-19 09:02:35 +08:00
if (moduleList[i].moduleType == 1) {
2022-06-08 15:48:09 +08:00
this.tabList.push(moduleList[i])
}
}
2023-03-22 15:38:12 +08:00
this.tabList.push(
2023-06-19 09:02:35 +08:00
{
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'my',
appShow: 1
},
2023-03-22 15:38:12 +08:00
)
2023-06-19 09:02:35 +08:00
2022-06-08 15:48:09 +08:00
}
// console.log(this.tabList)
2023-06-19 09:02:35 +08:00
2022-06-08 15:48:09 +08:00
},
methods: {
2023-06-19 09:02:35 +08:00
tabClick(plugin) {
2022-06-08 15:48:09 +08:00
console.log(plugin)
2023-06-19 09:02:35 +08:00
switch (plugin) {
2022-06-08 15:48:09 +08:00
case 'projectManage':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/projectManage/projectManage'
2022-06-08 15:48:09 +08:00
})
break;
case 'videoManage':
2023-06-19 09:02:35 +08:00
if (this.userInfo.accountType == 5) {
2022-06-08 15:48:09 +08:00
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/videoManage/videoList?sn=' + that.userInfo.sn
2022-06-08 15:48:09 +08:00
})
2023-06-19 09:02:35 +08:00
} else {
2022-06-08 15:48:09 +08:00
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/areaTree/areaTree'
2022-06-08 15:48:09 +08:00
})
}
break;
case 'my':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '/pages/my/my'
2022-06-08 15:48:09 +08:00
})
break;
case 'personManage':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/personManage/personManage'
2022-06-08 15:48:09 +08:00
})
break;
case 'projectEnd':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '/pages/projectEnd/projectIndex/projectIndex'
2022-06-08 15:48:09 +08:00
})
break;
case 'deviceManage':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/deviceManage/deviceManage'
2022-06-08 15:48:09 +08:00
})
break;
case 'markRoom':
uni.redirectTo({
2023-06-19 09:02:35 +08:00
url: '../../pages/markRoomManage/markRoomManage'
2022-06-08 15:48:09 +08:00
})
break;
}
}
}
}
</script>
<style lang="scss" scoped>
2023-06-19 09:02:35 +08:00
.footerBox {
background-color: white;
display: flex;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 9999;
border-top: 1px solid rgba(151, 151, 151, 0.15);
2022-06-08 15:48:09 +08:00
}
2023-06-19 09:02:35 +08:00
.footerItem {
font-size: 12px;
flex: 1;
justify-content: center;
text-align: center;
color: rgba(148, 149, 173, 1);
.tabIcon2 {
2022-06-08 15:48:09 +08:00
display: none;
}
2023-06-19 09:02:35 +08:00
&.active {
color: $uni-color-primary;
.tabIcon2 {
display: inline-block;
}
.tabIcon1 {
display: none;
}
}
.desc {
padding-bottom: 5px;
}
2022-06-08 15:48:09 +08:00
}
2023-06-19 09:02:35 +08:00
.tabIcon {
width: 26px;
height: 26px;
2022-06-08 15:48:09 +08:00
}
2023-06-19 09:02:35 +08:00
.footerBox2 {
.desc {
padding-bottom: 8px;
2022-06-08 15:48:09 +08:00
}
2023-06-19 09:02:35 +08:00
.footerItem {
&:first-child {
.tabIcon {
padding-top: 10px;
width: 23px;
height: 21px;
}
}
&:last-child {
.tabIcon {
padding-top: 8px;
width: 20px;
height: 23px;
}
2022-06-08 15:48:09 +08:00
}
}
}
</style>