list.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <ie-page>
  3. <z-paging ref="paging" v-model="list" bg-color="#F6F8FA" safe-area-inset-bottom :scrollable="!isSorting"
  4. :refresher-enabled="!isSorting" @query="handleQuery">
  5. <template #top>
  6. <ie-navbar title="志愿表"/>
  7. </template>
  8. <view class="mt-20 bg-warning-light p-28 text-23 leading-38 text-fore-title">
  9. <text class="font-bold">说明:</text>
  10. 目前志愿计划为2025年,排序前两个为第一、二志愿,可通过修改排序重新选择第一、二志愿
  11. </view>
  12. <view class="p-28 flex flex-col gap-28">
  13. <voluntary-item v-for="(item,i) in list" :key="i" :data="item" :index="i"/>
  14. </view>
  15. </z-paging>
  16. </ie-page>
  17. </template>
  18. <script setup lang="ts">
  19. import {VoluntaryRecord} from "@/types/voluntary";
  20. import VoluntaryItem from "@/pagesOther/pages/voluntary/list/components/voluntary-item.vue";
  21. import {ApiResponseList} from "@/types";
  22. import {VOLUNTARY_SORTING} from "@/types/injectionSymbols";
  23. import {getVoluntaryList} from "@/api/modules/voluntary";
  24. const list = ref<VoluntaryRecord[]>([])
  25. const paging = ref<ZPagingInstance>()
  26. const isSorting = ref<boolean>(false)
  27. const handleQuery = () => {
  28. getVoluntaryList().then(res => {
  29. paging.value?.completeByNoMore(res.data, true)
  30. }).catch(e => paging.value?.completeByError(e))
  31. }
  32. provide(VOLUNTARY_SORTING, isSorting)
  33. </script>
  34. <style lang="scss">
  35. </style>