|
@@ -3,6 +3,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+const homePagePath = '/pages/tabbar/home/home'
|
|
|
|
|
+const startPagePath = '/pagesA/start/start'
|
|
|
export default {
|
|
export default {
|
|
|
computed: {
|
|
computed: {
|
|
|
configs() {
|
|
configs() {
|
|
@@ -11,33 +13,42 @@ export default {
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
|
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
|
|
- console.log('正常:', res)
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
|
uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
|
uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
|
|
// #endif
|
|
// #endif
|
|
|
this.fnCheckShowStarted();
|
|
this.fnCheckShowStarted();
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
- console.log('异常:', err)
|
|
|
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
|
- url: '/pages/tabbar/home/home'
|
|
|
|
|
|
|
+ url: homePagePath
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
fnCheckShowStarted() {
|
|
fnCheckShowStarted() {
|
|
|
- if (!this.configs.startConfig.enabled) {
|
|
|
|
|
|
|
+ if (!this.configs.appConfig.startConfig.enabled) {
|
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
|
- url: '/pages/tabbar/home/home'
|
|
|
|
|
|
|
+ url: homePagePath
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 是否每次都显示启动页
|
|
|
|
|
+ if (this.configs.appConfig.startConfig.alwaysShow) {
|
|
|
|
|
+ uni.removeStorageSync('APP_HAS_STARTED')
|
|
|
|
|
+ uni.redirectTo({
|
|
|
|
|
+ url: startPagePath
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 只显示一次启动页
|
|
|
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
|
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
|
|
uni.switchTab({
|
|
uni.switchTab({
|
|
|
- url: '/pages/tabbar/home/home'
|
|
|
|
|
|
|
+ url: homePagePath
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
- url: '/pagesA/start/start'
|
|
|
|
|
|
|
+ url: startPagePath
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|