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') console.log('App Launch')
// //
// this.initBackgroundMusic(); // 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() { onShow: function() {
console.log('App Show') console.log('App Show')

14
components/CustomTabBar.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="custom-tab-bar"> <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> <text :style="{ 'color': currentTab === i?item.selectColor:'#fff' }">{{ item.text }}</text>
</view> </view>
</view> </view>
@ -16,8 +16,7 @@ export default {
}, },
data() { data() {
return { return {
tabBarList: [ tabBarList: [{
{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"selectColor": "#00FF00", "selectColor": "#00FF00",
"text": "首页" "text": "首页"
@ -42,13 +41,18 @@ export default {
"selectColor": "#00FF00", "selectColor": "#00FF00",
"text": "iSoul" "text": "iSoul"
} }
] ],
tabBarShowList: []
}; };
}, },
onLoad() { onLoad() {
this.getCurrentTab(); this.getCurrentTab();
}, },
mounted() {
this.tabBarShowList = uni.getStorageSync('SHFlag').split(',').map(item => {
return item.trim().toLowerCase() === 'true';
});
},
methods: { methods: {
getCurrentTab() { getCurrentTab() {
const pages = getCurrentPages(); const pages = getCurrentPages();

Loading…
Cancel
Save