Files
car-system-app/pages/tab/tab.vue
2024-07-17 20:11:19 +08:00

56 lines
1.2 KiB
Vue

<template>
<view>
<image class="spread-its-tail" src="@/static/spread_its_tail.png" mode="aspectFill"></image>
</view>
</template>
<script>
import {Tabbar} from "@/data/Tab_bar.js";
// import {userInfo} from "@/api/user.js";
// import {driveInfo} from "@/api/drive.js";
export default {
data() {
return {
}
},
computed:{
// userInfo(){
// return this.$store.getters.userInfo;
// }
},
async onShow() {
// console.log("我的身份",uni.getStorageSync('userType'));
// console.log(7777777777,Tabbar[uni.getStorageSync('userType')]);
//动态加载底部tabbar
await Tabbar[uni.getStorageSync('userType')].forEach((item,index)=>{
// console.log('当前',item);
uni.setTabBarItem({
index:index,
selectedIconPath:item.activeIconPath,
pagePath:item.path,
iconPath:item.iconPath,
text:item.text,
visible:item.visible,
});
});
await uni.setTabBarStyle({
selectedColor:uni.getStorageSync('userType')==1?'#00A473':'#00A473'
});
this.$u.debounce(()=>{
this.$u.route({url:Tabbar[uni.getStorageSync('userType')][1].path,type:'switchTab'});
}, 150);
},
methods: {
}
}
</script>
<style>
.spread-its-tail{
width: 750rpx;
}
</style>