volunteer-banner.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="px-28 flex gap-18">
  3. <volunteer-banner-item :title="mainEntry.title" :desc="mainEntry.desc" desc-bg-color="#A8F496"
  4. bg-src="/volunteer/index/banner_rate.png" class="flex-1" custom-class="h-342" @click="goRateCalc" />
  5. <view class="flex-1 flex flex-col justify-between">
  6. <volunteer-banner-item :title="secondaryEntry.title" :desc="secondaryEntry.desc" desc-bg-color="#F8ECA6"
  7. bg-src="/volunteer/index/banner_skill.png" custom-class="h-162" @click="goSkillCalc" />
  8. <volunteer-banner-item title="志愿表" desc="我的报考意向" desc-bg-color="#DDD6FF" bg-src="/volunteer/index/banner_list.png"
  9. custom-class="h-162" @click="goVoluntaryList" />
  10. </view>
  11. </view>
  12. </template>
  13. <script setup lang="ts">
  14. import VolunteerBannerItem from "@/pagesMain/pages/volunteer/components/volunteer-banner-item.vue";
  15. import { useTransferPage } from "@/hooks/useTransferPage";
  16. import { routes } from "@/common/routes";
  17. import { useUserStore } from "@/store/userStore";
  18. const { transferTo } = useTransferPage()
  19. const userStore = useUserStore()
  20. const mainEntry = computed(() => userStore.isVHS ? {
  21. title: '填志愿',
  22. desc: '大数据分析+智能算法'
  23. } : {
  24. title: '测录取概率',
  25. desc: '院校录取风险评估'
  26. })
  27. const secondaryEntry = computed(() => userStore.isVHS ? {
  28. title: '查位次',
  29. desc: '查历年等效分'
  30. } : {
  31. title: '测技能分',
  32. desc: '精准定位'
  33. })
  34. const goRateCalc = async () => {
  35. transferTo(userStore.isVHS ? routes.VHSIndex : routes.voluntaryIndex)
  36. }
  37. const goSkillCalc = async () => {
  38. if (userStore.isVHS) {
  39. const isLogin = await userStore.checkLogin();
  40. if (isLogin) {
  41. transferTo(routes.pageRanking)
  42. }
  43. } else {
  44. transferTo(routes.skillIndex)
  45. }
  46. }
  47. const goVoluntaryList = async () => {
  48. const isLogin = await userStore.checkLogin();
  49. if (isLogin) {
  50. transferTo(userStore.isVHS ? routes.VHSList : routes.voluntaryList)
  51. }
  52. }
  53. </script>
  54. <style scoped></style>