index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="index">
  3. <StatusBarSpace backgroundColor="transparent" />
  4. <NavBar
  5. :title="title"
  6. :titleScroll="false"
  7. backgroundColor="transparent"
  8. textColor="white"
  9. align="left"
  10. />
  11. <HomeIndex v-if="tabIndex === 0" @goDiscover="tabIndex = 1" />
  12. <DiscoverIndex v-else-if="tabIndex === 1" />
  13. <DigIndex v-else-if="tabIndex === 2" />
  14. <StoreIndex v-else-if="tabIndex === 3" />
  15. <UserIndex v-else-if="tabIndex === 4" @goSubmit="tabIndex = 2" />
  16. <TabBar
  17. v-model:selectedTabIndex="tabIndex"
  18. fixed
  19. xbarSpace
  20. >
  21. <TabBarItem icon="/static/images/tabs/home.png" activeIcon="/static/images/tabs/home-active.png" text="首页" />
  22. <TabBarItem icon="/static/images/tabs/discover.png" activeIcon="/static/images/tabs/discover-active.png" text="发现" />
  23. <TabBarItem icon="/static/images/tabs/dig.png" hump :humpHeight="[ 10, 10 ]" :humpSpace="[20,20]" :iconSize="140" />
  24. <TabBarItem icon="/static/images/tabs/store.png" activeIcon="/static/images/tabs/store-active.png" text="知识库" />
  25. <TabBarItem icon="/static/images/tabs/user.png" activeIcon="/static/images/tabs/user-active.png" text="我的" />
  26. </TabBar>
  27. </view>
  28. </template>
  29. <script setup lang="ts">
  30. import { computed, ref } from 'vue';
  31. import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
  32. import NavBar from '@/components/nav/NavBar.vue';
  33. import TabBar from '@/components/nav/TabBar.vue';
  34. import TabBarItem from '@/components/nav/TabBarItem.vue';
  35. import DigIndex from './dig/index.vue';
  36. import UserIndex from './user/index.vue';
  37. import HomeIndex from './home/index.vue';
  38. import DiscoverIndex from './home/discover/index.vue';
  39. import StoreIndex from './home/store/index.vue';
  40. const title = computed(() => {
  41. switch (tabIndex.value) {
  42. case 0:
  43. return '首页·村社文化资源挖掘平台';
  44. case 1:
  45. return '发现·村社文化资源挖掘平台';
  46. case 2:
  47. return '挖掘·村社文化资源挖掘平台';
  48. case 3:
  49. return '知识库·村社文化资源挖掘平台';
  50. case 4:
  51. return '我的·村社文化资源挖掘平台';
  52. }
  53. return '';
  54. });
  55. const tabIndex = ref(0);
  56. </script>
  57. <style scoped>
  58. .index {
  59. background-position: top left;
  60. background-size: 100% auto;
  61. background-repeat: no-repeat;
  62. background-image: url('@/static/images/BackgroundMask.jpg');
  63. overflow-x: hidden;
  64. }
  65. </style>