12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <!-- 使用得时候必须加上style 不然没有--colorxxxxx之类得变量 -->
- <view class="tabbar align-center">
- <view v-for="(item, index) in tabbarList" :key="index" @click="switchTabs(item)" class="tablist">
- <view class="column align-center justify-center" >
- <image :src="actindex==index?item.selectedIconPath:item.iconPath" class="w48 h48"></image>
- <text class="fs24 base-textcol" :class="actindex==index?'actcolor':'morecolor'">{{item.Text}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "tabbar",
- props: {
- actindex: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- tabbarList: [],
- };
- },
- mounted() {
- this.themeicon()
- },
- methods: {
- switchTabs(item) {
- // 到时候要设置两个tabbar 但是一教育页面得隐藏掉 这里得页面不能配置到tabbar得list里面
- uni.navigateTo({
- url: item.url
- })
- },
- themeicon() {
- const theme = this.themes
- this.tabbarList = [{
- iconPath: '/static/manageTabIcon/training.png',
- selectedIconPath: '/static/manageTabIcon/training_on.png',
- Text: '企业理念',
- url: '/pages/enterprise/enterprise'
- },
- {
- iconPath: '/static/manageTabIcon/manage.png',
- selectedIconPath: '/static/manageTabIcon/manage_on.png',
- Text: '我的',
- url: '/pages/user/wxuser'
- },
- ]
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .tabbar {
- display: flex;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- z-index: 1000;
- height: 120rpx;
- padding-bottom: 20rpx;
- }
- .tablist {
- width: 50%;
- }
- .morecolor{
- color: #626468;
- }
- .actcolor {
- color: #1773ff;
- }
- </style>
|