Browse Source

审核

dev_xrcc
chenkainan 3 months ago
parent
commit
5ec97085c7
  1. 8
      App.vue
  2. 14
      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')

14
components/CustomTabBar.vue

@ -1,6 +1,6 @@
<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>
@ -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();

Loading…
Cancel
Save