|
|
@ -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(); |
|
|
|