Browse Source

Merge branch 'master' into dev_des

# Conflicts:
#	components/CustomTabBar.vue
dev_des
1054425342@qq.com 3 months ago
parent
commit
4489fc5874
  1. 8
      App.vue
  2. 40
      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')

40
components/CustomTabBar.vue

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

Loading…
Cancel
Save