index copy.vue 2.1 KB

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