henan-exam.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <view class="h-16 bg-back my-32"></view>
  4. <view class="px-30 pt-13 pb-24 text-32 text-fore-title font-bold">真题&模拟</view>
  5. <view class="">
  6. <view class="overflow-hidden bg-white sticky z-2" :style="{ top: baseStickyTop + 'px' }">
  7. <view class="px-30 pt-24 pb-30 text-32 text-fore-title font-bold flex items-center gap-44 bg-back rounded-t-15">
  8. <view :class="['relative text-fore-light', { 'is-active': current === 0 }]" @click="handleChange(0)">公共课
  9. </view>
  10. <view :class="['relative text-fore-light', { 'is-active': current === 1 }]" @click="handleChange(1)">专业课
  11. </view>
  12. </view>
  13. </view>
  14. <view class="px-30 pb-24 bg-back flex flex-col gap-20 sticky z-1 " :style="{ top: baseStickyTop + 20 + 'px' }">
  15. <henan-exam-item v-for="(item, index) in list" :key="index" :data="item" />
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script lang="ts" setup>
  21. import HenanExamItem from '@/pagesStudy/components/henan-exam-item.vue';
  22. import { useNavbar } from '@/hooks/useNavbar';
  23. import { getVHSPaperList } from '@/api/modules/study';
  24. import { Study } from '@/types';
  25. const { baseStickyTop } = useNavbar();
  26. const list = [1, 1, 1, 1, 1, 1, 1, 1]
  27. const current = ref(0);
  28. const handleChange = (index: number) => {
  29. current.value = index;
  30. }
  31. const loadData = async () => {
  32. const { data } = await getVHSPaperList({
  33. subjectId: current.value
  34. });
  35. console.log(data)
  36. // list.value = data;
  37. }
  38. onLoad(() => {
  39. loadData();
  40. });
  41. </script>
  42. <style lang="scss" scoped>
  43. .is-active {
  44. @apply text-fore-title;
  45. &::after {
  46. content: '';
  47. display: block;
  48. width: 20px;
  49. height: 4px;
  50. background: radial-gradient(0% 0% at 0% 0%, #31A0FC 0%, #70C8FD 100%);
  51. position: absolute;
  52. bottom: 0;
  53. border-radius: 4rpx;
  54. left: 50%;
  55. transform: translateX(-50%);
  56. bottom: -8rpx;
  57. }
  58. }
  59. </style>