enter.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="container">
  3. <enterNavigator :selectedIndex="nav_current_index" @clickToIndex='homeNavigatorClick'/>
  4. <home :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.home" />
  5. <AIChat :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.ai_chat" />
  6. <AIDraw :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == config.page_index.ai_draw" />
  7. </view>
  8. </template>
  9. <script>
  10. import enterNavigator from '../../pages/enter/enter-navigator.vue'
  11. import home from '../../pages/home/home.vue'
  12. import AIChat from '../../pages/AI_chat/AI_chat.vue'
  13. import AIDraw from '../../pages/AI-draw/AI-draw.vue'
  14. import config from '../../utils/config.js'
  15. export default {
  16. data() {
  17. return {
  18. nav_current_index: 0, // 当前导航索引
  19. subviewTop: 0,
  20. subviewHeight: 0,
  21. }
  22. },
  23. methods: {
  24. homeNavigatorClick(index) {
  25. if(index == config.page_index.ai_chat ||
  26. index == config.page_index.ai_draw) {
  27. if(this.tools.is_login_gotoLogin() == false) {
  28. return
  29. }
  30. }
  31. this.nav_current_index = index
  32. }
  33. },
  34. mounted() {
  35. let systemInfo = uni.getSystemInfoSync()
  36. this.subviewTop = 60
  37. this.subviewHeight = systemInfo.screenHeight - this.subviewTop
  38. },
  39. components: {
  40. enterNavigator,
  41. home,
  42. AIChat,
  43. AIDraw
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .container{
  49. }
  50. </style>