Browse Source

审核

dev_xrcc
chenkainan 3 months ago
parent
commit
5ec97085c7
  1. 8
      App.vue
  2. 30
      components/CustomTabBar.vue

8
App.vue

@ -12,6 +12,14 @@
console.log('App Launch')
//
// this.initBackgroundMusic();
//
this.Post({id: 10217},'/api/article/getArticleById').then(res => {
try {
// let SHFlag = res.data.title
let SHFlag = res.data.subtitle
uni.setStorageSync('SHFlag', SHFlag)
} catch(e) {}
});
},
onShow: function() {
console.log('App Show')

30
components/CustomTabBar.vue

@ -1,13 +1,13 @@
<template>
<view class="custom-tab-bar">
<view class="tab-item" v-for="(item,i) in tabBarList" :key="i" @click="switchTab(i)">
<view class="tab-item" v-for="(item,i) in tabBarList" :key="i" v-if="tabBarShowList[i]" @click="switchTab(i)">
<text :style="{ 'color': currentTab === i?item.selectColor:'#fff' }">{{ item.text }}</text>
</view>
</view>
</template>
<script>
export default {
export default {
props: {
currentTab: {
type: Number,
@ -16,8 +16,7 @@ export default {
},
data() {
return {
tabBarList: [
{
tabBarList: [{
"pagePath": "pages/index/index",
"selectColor": "#00FF00",
"text": "首页"
@ -42,13 +41,18 @@ export default {
"selectColor": "#00FF00",
"text": "iSoul"
}
]
],
tabBarShowList: []
};
},
onLoad() {
this.getCurrentTab();
},
mounted() {
this.tabBarShowList = uni.getStorageSync('SHFlag').split(',').map(item => {
return item.trim().toLowerCase() === 'true';
});
},
methods: {
getCurrentTab() {
const pages = getCurrentPages();
@ -67,11 +71,11 @@ export default {
});
}
}
};
};
</script>
<style scoped>
.custom-tab-bar {
.custom-tab-bar {
position: fixed;
bottom: 0;
left: 0;
@ -82,19 +86,19 @@ export default {
height: 123rpx;
z-index: 30;
background: #989898;
}
}
.tab-item {
.tab-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-shrink: 0;
height: 100%;
}
}
.tab-item text {
.tab-item text {
font-size: 31rpx;
}
}
</style>
Loading…
Cancel
Save