index-map.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="mx-30 mt-32 bg-white shadow-card overflow-hidden rounded-15 relative">
  3. <view class="w-full h-150 bg-[#F7FEE7] absolute" />
  4. <view class="flex justify-between z-1 relative">
  5. <view class="py-14 pl-40 pr-80 bg-white"
  6. style="clip-path: polygon(0 0, calc(100% - 40rpx) 0, 100% 80rpx, 100% 100%, 0 100%);">
  7. <ie-image src="/map-title.png" is-oss custom-class="w-182 h-57" />
  8. </view>
  9. <view class="flex-1 flex justify-center items-center text-24 text-fore-title">
  10. 分步拆解,指引升学每一步
  11. </view>
  12. </view>
  13. <view class="bg-white rounded-tr-15 z-1 relative px-12 py-20 grid grid-cols-4 gap-x-12 gap-y-20">
  14. <view v-for="(m, i) in maps" :key="i" class="flex flex-col items-center" @click="handleMap(m)">
  15. <view class="px-24 leading-36 text-20 text-fore-title font-bold bg-[#CEF57B] rounded-full z-1"
  16. style="margin-bottom: -18rpx">
  17. 第{{ i + 1 }}步
  18. </view>
  19. <view class="w-full bg-back-light rounded-10 flex flex-col items-center pt-36 pb-22"
  20. style="box-shadow: 1px 2px 0px 0px #DCF8BC;">
  21. <view>
  22. <view class="text-24 text-fore-title flex items-center gap-12">
  23. <view class="font-bold">{{ m.title }}</view>
  24. <view class="bg-black rounded-full p-4">
  25. <uv-icon name="arrow-right" color="white" size="6" />
  26. </view>
  27. </view>
  28. <view class="mt-3 text-22 text-fore-tip">{{ m.desc }}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup lang="ts">
  36. import { routes } from "@/common/routes";
  37. import { useTransferPage } from "@/hooks/useTransferPage";
  38. import { useUserStore } from "@/store/userStore";
  39. interface SiteMap {
  40. title: string;
  41. desc: string;
  42. pagePath: string;
  43. handler?: () => void
  44. }
  45. const userStore = useUserStore()
  46. const { transferTo } = useTransferPage()
  47. const goSimulate = async () => {
  48. const isLogin = await userStore.checkLogin();
  49. if (isLogin) {
  50. const list = userStore.directedSchoolList || []
  51. const first = list[0] || {}
  52. if (!list.length || first.notice) {
  53. transferTo(routes.studyIndex)
  54. } else {
  55. transferTo(routes.studySimulate, {
  56. data: first
  57. });
  58. }
  59. }
  60. }
  61. const maps = computed<SiteMap[]>(() => [{
  62. title: '本省规则',
  63. desc: '填志愿不踩坑',
  64. pagePath: routes.newsDetail + '?id=' + (userStore.isHN ? 1065 : 1078)
  65. }, {
  66. title: '自我评价',
  67. desc: '了解自身优势',
  68. pagePath: routes.pageTestCenter
  69. }, {
  70. title: '职业规划',
  71. desc: '锁定职业方向',
  72. pagePath: routes.careerIndex
  73. }, {
  74. title: '了解专业',
  75. desc: '选择对口专业',
  76. pagePath: routes.majorIndex
  77. }, {
  78. title: '锁定院校',
  79. desc: '了解院校实力',
  80. pagePath: routes.universityIndex
  81. }, {
  82. title: '定向刷题',
  83. desc: '根据考纲练习',
  84. pagePath: routes.studyIndex
  85. }, {
  86. title: '模拟测试',
  87. desc: '全真模拟',
  88. pagePath: '',
  89. handler: goSimulate
  90. }, {
  91. title: '测录取率',
  92. desc: '录取风险评估',
  93. pagePath: routes.voluntaryIndex
  94. }])
  95. const handleMap = (m: SiteMap) => {
  96. if (m.handler) return m.handler()
  97. if (!m.pagePath) return
  98. transferTo(m.pagePath)
  99. }
  100. </script>
  101. <style scoped></style>