volunteer-menu.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="pt-20 pb-30 px-50 flex justify-between items-center">
  3. <volunteer-menu-item v-for="m in menus" :key="m.title" :title="m.title" :icon="m.icon" @click="goPage(m)"/>
  4. </view>
  5. </template>
  6. <script setup lang="ts">
  7. import VolunteerMenuItem from "@/pagesMain/pages/volunteer/components/volunteer-menu-item.vue";
  8. import {routes} from "@/common/routes";
  9. import {useTransferPage} from "@/hooks/useTransferPage";
  10. const {transferTo} = useTransferPage()
  11. type Menu = {
  12. title: string
  13. icon: string
  14. pagePath: string
  15. }
  16. const menus: Menu[] = [{
  17. title: '找院校',
  18. icon: '/volunteer/index/menu_college.png',
  19. pagePath: routes.universityIndex
  20. }, {
  21. title: '查专业',
  22. icon: '/volunteer/index/menu_major.png',
  23. pagePath: routes.majorIndex
  24. }, {
  25. title: '看职业',
  26. icon: '/volunteer/index/menu_vocation.png',
  27. pagePath: routes.careerIndex
  28. }, {
  29. title: '志愿分析',
  30. icon: '/volunteer/index/menu_analysis.png',
  31. pagePath: ''
  32. }]
  33. const goPage = function (menu: Menu) {
  34. if (menu.pagePath) transferTo(menu.pagePath)
  35. else uni.$ie.showModal({title: '提示', content: '开发中,敬请期待', showCancel: false})
  36. }
  37. </script>
  38. <style scoped>
  39. </style>