voluntary-item.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="fx-row fx-bet-sta bg-white mx-card">
  3. <view class="fx-col fx-sta-cen ml-10 mb-10">
  4. <view class="fx-row rounded-b-full px-15 pt-5 pb-10 text-white" :class="pickType.bg">
  5. <text>{{ pickType.text }}</text>
  6. </view>
  7. <view class="text-main fx-row fx-cen-base gap-5">
  8. <view class="font-bold text-xl">{{ item.enrollRatio || '-' }}</view>
  9. %
  10. </view>
  11. <view class="text-content text-xs keep-all">
  12. {{ item.enrollRatioText }}
  13. </view>
  14. </view>
  15. <view class="flex-1 fx-col p-20 gap-15 text-main">
  16. <view class="fx-row fx-bet-sta gap-15">
  17. <view class="flex-1" @click="goCollegePage">
  18. <view class="font-[PingFang] font-bold">
  19. {{ item.university.name }}
  20. <template v-if="item.recruitPlan.group">({{ item.recruitPlan.group }})</template>
  21. ({{ item.recruitPlan.collegeCode }})
  22. <text v-if="item.specialProject" class="text-primary flex-nowrap">({{
  23. item.specialProject
  24. }})
  25. </text>
  26. </view>
  27. <view class="mt-10 text-tips text-2xs">{{ item.university.features.split(',').join(' / ') }}</view>
  28. <view class="mt-5 text-tips text-2xs">
  29. {{
  30. `${item.university.location} ${item.university.cityName} / ${item.university.type} / ${item.university.natureTypeCN} / 排名${item.university.rankingOfEdu || '-'}`
  31. }}
  32. </view>
  33. </view>
  34. <view class="fx-col fx-sta-cen relative">
  35. <uv-tags :plain="!item.majors.filter(major => {return major.selected}).length" shape="circle"
  36. type="primary" :text="`专业 ${item.recruitPlan.majorCount}`"
  37. @click="$emit('major')"/>
  38. <view class="text-2xs text-main absolute -bottom-35"
  39. v-if="item.majors.filter(major => {return major.selected}).length">
  40. 已填 {{ item.majors.filter(major => major.selected).length }}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="text-2xs">
  45. <view class="text-xs">
  46. {{ `${headerPlanYear}计划 ${item.recruitPlan.planCount}人 ${userSnapshot.examMajorName}` }}
  47. </view>
  48. <voluntary-history-list :container="item" @notify="$emit('notify', $event)"/>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup>
  54. import {computed} from 'vue';
  55. import {createPropDefine} from "@/utils";
  56. import {useInjectTransfer} from "@/hooks/useTransfer";
  57. import {useInjectVoluntaryHeader} from "@/pages/voluntary/hooks/useVoluntaryHeaderInjection";
  58. import {useInjectUserSnapshot} from "@/pages/ie/hooks/useUserSnapshotInjection";
  59. import VoluntaryHistoryList from "@/pages/voluntary/index/components/voluntary-history-list.vue";
  60. const props = defineProps({
  61. item: createPropDefine({}, Object)
  62. })
  63. defineEmits(['major', 'notify'])
  64. const {transferTo} = useInjectTransfer()
  65. const {headerPlanYear} = useInjectVoluntaryHeader()
  66. const {userSnapshot} = useInjectUserSnapshot()
  67. const pickType = computed(() => {
  68. switch (props.item.pickType) {
  69. case 0:
  70. return {bg: 'bg-error', text: '冲'}
  71. case 1:
  72. return {bg: 'bg-warning', text: '稳'}
  73. case 2:
  74. return {bg: 'bg-success', text: '保'}
  75. }
  76. return {bg: '', text: ''}
  77. })
  78. const goCollegePage = () => {
  79. const path = '/pages/college-library/detail/detail'
  80. const {university: {code}} = props.item
  81. transferTo(path, {code})
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. ::v-deep(.uv-tags) {
  86. .uv-tags__text--medium {
  87. font-size: 12px !important;
  88. }
  89. }
  90. </style>