|
|
@ -1,20 +1,15 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<!-- 占位区域,防止内容被TabBar遮挡 --> |
|
|
|
|
|
|
|
<!-- 固定的TabBar --> |
|
|
|
<view class="custom-tab-bar"> |
|
|
|
<view |
|
|
|
class="tab-item" |
|
|
|
v-for="(item, i) in tabBarList" |
|
|
|
:key="i" |
|
|
|
@click="switchTab(i)" |
|
|
|
> |
|
|
|
<text |
|
|
|
:style="{ color: currentTab === i ? item.selectColor : '#fff' }" |
|
|
|
>{{ item.text }}</text |
|
|
|
> |
|
|
|
</view> |
|
|
|
<view class="custom-tab-bar"> |
|
|
|
<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> |
|
|
@ -41,9 +36,9 @@ export default { |
|
|
|
text: "阅读体", |
|
|
|
}, |
|
|
|
{ |
|
|
|
pagePath: "pages/index/timeShopBank", |
|
|
|
pagePath: "pages/index/sensoryStore", |
|
|
|
selectColor: "#00FF00", |
|
|
|
text: "时间银行", |
|
|
|
text: "有感商店", |
|
|
|
}, |
|
|
|
{ |
|
|
|
pagePath: "pages/index/intelligentAgent", |
|
|
@ -56,11 +51,20 @@ export default { |
|
|
|
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(); |
|
|
|