2023-09-19 02:50:09 +00:00
|
|
|
<template>
|
2023-09-19 03:20:41 +00:00
|
|
|
<view class="tabbar">
|
2023-09-26 10:43:07 +00:00
|
|
|
<u-tabbar :safeAreaInsetBottom="true" :placeholder="true" :border="false" class="tabbar-ios-fix" activeColor='#22bf8e' :value="current?current:0" :fixed="true"
|
2023-09-26 03:15:45 +00:00
|
|
|
@change="handleTabClick">
|
2023-09-19 02:50:09 +00:00
|
|
|
<u-tabbar-item v-for='(item,index) in tabList' :key="index" :text="item.text">
|
2023-09-26 03:15:45 +00:00
|
|
|
<image style="width: 52rpx;height: 52rpx;margin-top: 34rpx" slot="inactive-icon" class="u-page__item__slot-icon" :src="item.iconPath">
|
2023-09-19 02:50:09 +00:00
|
|
|
</image>
|
2023-09-26 03:15:45 +00:00
|
|
|
<image style="width: 52rpx;height: 52rpx;margin-top: 34rpx" slot="active-icon" class="u-page__item__slot-icon" :src="item.selectedIconPath">
|
2023-09-19 02:50:09 +00:00
|
|
|
</image>
|
|
|
|
</u-tabbar-item>
|
|
|
|
</u-tabbar>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import tabBar from "../../util/tabbar";
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
current: Number
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tabList: uni.getStorageSync('tabBar')
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2023-09-19 03:20:41 +00:00
|
|
|
|
2023-09-19 02:50:09 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleTabClick(index) {
|
|
|
|
uni.switchTab({
|
|
|
|
url: '/' + this.tabList[index].pagePath,
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
|
|
.u-page__item__slot-icon {
|
|
|
|
width: 52rpx;
|
|
|
|
height: 52rpx;
|
|
|
|
}
|
|
|
|
|
2023-09-19 03:48:23 +00:00
|
|
|
|
2023-09-26 03:13:01 +00:00
|
|
|
.tabbar-ios-fix {
|
2023-09-19 02:50:09 +00:00
|
|
|
bottom: calc(120rpx + env(safe-area-inset-bottom));
|
2023-09-26 03:13:01 +00:00
|
|
|
}
|
2023-09-19 02:50:09 +00:00
|
|
|
</style>
|