index.vue 538 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <view class="app-page"></view>
  3. </template>
  4. <script>
  5. export default {
  6. onLoad() {
  7. this.fnCheckShowStarted();
  8. },
  9. methods: {
  10. // 检查是否需要跳转到启动页
  11. fnCheckShowStarted() {
  12. if (!getApp().globalData.start.use) {
  13. uni.switchTab({
  14. url: '/pages/tabbar/home/home'
  15. });
  16. return;
  17. }
  18. if (uni.getStorageSync('APP_HAS_STARTED')) {
  19. uni.switchTab({
  20. url: '/pages/tabbar/home/home'
  21. });
  22. } else {
  23. uni.redirectTo({
  24. url: '/pagesA/start/start'
  25. });
  26. }
  27. }
  28. }
  29. };
  30. </script>