index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <custom-scroll-list :refreshFn="getExamList" :tabList="tabData" :defaultTab="1">
  3. <template #default="{list}">
  4. <scroll-list-card v-for="(item,index) in list" :key="item.ksId" :data="item" @btnClick="handleClick"></scroll-list-card>
  5. </template>
  6. </custom-scroll-list>
  7. </template>
  8. <script setup>
  9. import {
  10. getExamList
  11. } from "@/api/exam.js";
  12. import {
  13. // onLoad,
  14. onReady,
  15. } from "@dcloudio/uni-app"
  16. import {
  17. reactive,
  18. ref
  19. } from "vue";
  20. const tabData = [{
  21. label: "可以考试",
  22. value: 1,
  23. },
  24. {
  25. label: "已结束",
  26. value: 4,
  27. }
  28. ]
  29. function handleClick(data) {
  30. console.log('data', data)
  31. if (data.status == 0) {
  32. // 未开始
  33. uni.redirectTo({
  34. url: `/pages/exam/exam?ksId=${data.ksId}&zhuapai=${data.zhuapai}`
  35. })
  36. }
  37. if (data.status == 1) {
  38. // 可以考试
  39. uni.redirectTo({
  40. url: `/pages/exam/exam?ksId=${data.ksId}&zhuapai=${data.zhuapai}`
  41. })
  42. }
  43. if (data.status == 2) {
  44. // 再次考试
  45. uni.redirectTo({
  46. url: `/pages/exam/exam?ksId=${data.ksId}&zhuapai=${data.zhuapai}`
  47. })
  48. }
  49. if (data.status == 3) {
  50. // 考试中
  51. uni.redirectTo({
  52. url: `/pages/exam/exam?ksId=${data.ksId}&zhuapai=${data.zhuapai}`
  53. })
  54. }
  55. if (data.status == 4) {
  56. // 已结束
  57. }
  58. if (data.status == 5) {
  59. // 未报名
  60. }
  61. if (data.status == 6) {
  62. // 报名审核中
  63. }
  64. if (data.status == 7) {
  65. // 审核未通过
  66. }
  67. if (data.status == 8) {
  68. // 等待人工评分
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. </style>