index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <customNavbarVue title="成绩"></customNavbarVue>
  3. <custom-scroll-list ref="customChengjiRef" :refreshFn="currentRefreshFn" @tabChange="tabChange"
  4. :searchBarKey="searchBarKeyName" :defaultTab="1">
  5. <template #default="{list}">
  6. <scroll-list-card-chengji @lookShijuan="lookShijuan" @lookPaiming="lookPaiming" v-for="(item,index) in list"
  7. :key="item.ksId" :data="item"></scroll-list-card-chengji>
  8. </template>
  9. </custom-scroll-list>
  10. </template>
  11. <script setup>
  12. import {
  13. getKaoshichengjiList,
  14. getKcchengjiList
  15. } from "@/api/chengji.js";
  16. import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
  17. import customScrollListChengji from "@/components/custom-scroll-list/custom-scroll-list.vue";
  18. import {
  19. onLoad,
  20. onReady,
  21. } from "@dcloudio/uni-app"
  22. import {
  23. reactive,
  24. ref,
  25. computed
  26. } from "vue";
  27. let currentTab = ref('1')
  28. let searchBarKeyName = ref('ksName')
  29. let customChengjiRef = ref(null)
  30. const tabData = [{
  31. label: "考试成绩",
  32. value: 1,
  33. }, {
  34. label: "课程成绩",
  35. value: 2
  36. }]
  37. const currentRefreshFn = computed(() =>
  38. currentTab.value == '1' ? getKaoshichengjiList : getKcchengjiList
  39. )
  40. function tabChange(data) {
  41. currentTab.value = data.value
  42. if (currentTab.value == 1) {
  43. searchBarKeyName.value = 'ksName'
  44. } else {
  45. searchBarKeyName.value = 'kcName'
  46. }
  47. // customChengjiRef.value.tabChangeSearch(data)
  48. }
  49. const lookShijuan = (data) => {
  50. console.log('data',data);
  51. uni.navigateTo({
  52. url: '/subpkgScore/pages/score/kaoshiChengjiInfo?hisId=' + data.hisId + '&name=' + data.ksName+ '&userScore=' + data.userScore+ '&ksScore=' + data.ksScore
  53. });
  54. }
  55. const lookPaiming = (data) => {
  56. console.log('datalookPaiming',data);
  57. uni.navigateTo({
  58. url: '/subpkgScore/pages/score/kaoshiChengjiInfo?kcId=' + data.kcId + '&name=' + data.name
  59. });
  60. }
  61. </script>
  62. <style lang="scss">
  63. </style>