1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 21:29:31 +08:00

update: 调整首页顶部头像为应用LOGO、调整启动页面,增加是否每次都显示判断

This commit is contained in:
小莫唐尼
2024-06-26 09:47:04 +08:00
parent aec54e8c5b
commit cc05b64dec
4 changed files with 33 additions and 14 deletions
+18 -7
View File
@@ -3,6 +3,8 @@
</template>
<script>
const homePagePath = '/pages/tabbar/home/home'
const startPagePath = '/pagesA/start/start'
export default {
computed: {
configs() {
@@ -11,33 +13,42 @@ export default {
},
onLoad() {
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
console.log('正常:', res)
// #ifdef MP-WEIXIN
uni.$tm.vx.commit('setWxShare', res.shareConfig);
// #endif
this.fnCheckShowStarted();
}).catch((err) => {
console.log('异常:', err)
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
})
},
methods: {
fnCheckShowStarted() {
if (!this.configs.startConfig.enabled) {
if (!this.configs.appConfig.startConfig.enabled) {
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
return;
}
// 是否每次都显示启动页
if (this.configs.appConfig.startConfig.alwaysShow) {
uni.removeStorageSync('APP_HAS_STARTED')
uni.redirectTo({
url: startPagePath
});
return;
}
// 只显示一次启动页
if (uni.getStorageSync('APP_HAS_STARTED')) {
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
} else {
uni.redirectTo({
url: '/pagesA/start/start'
url: startPagePath
});
}
}