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:
+18
-7
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user