123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <custom-scroll-list-chengji ref="customChengjiRef" :refreshFn="currentRefreshFn" @tabChange="tabChange"
- :searchBarKey="searchBarKeyName" :tabList="tabData" :defaultTab="1">
- <template #default="{list}">
- <scroll-list-card-chengji v-show="currentTab =='1'" @click="kechengClick(item)" v-for="(item,index) in list"
- :key="item.ksId" :data="item"></scroll-list-card-chengji>
- <scroll-list-card-kechengji v-show="currentTab =='2'" @click="kechengClick(item)"
- v-for="(item,index) in list" :key="item.ksId" :data="item"></scroll-list-card-kechengji>
- </template>
- </custom-scroll-list-chengji>
- </template>
- <script setup>
- import {
- getKaoshichengjiList,
- getKcchengjiList
- } from "@/api/chengji.js";
- import customScrollListChengji from "@/components/custom-scroll-list/custom-scroll-list-chengji.vue";
- import {
- onLoad,
- onReady,
- } from "@dcloudio/uni-app"
- import {
- reactive,
- ref,
- computed
- } from "vue";
- let currentTab = ref('1')
- let searchBarKeyName = ref('ksName')
- let customChengjiRef = ref(null)
- const tabData = [{
- label: "考试成绩",
- value: 1,
- }, {
- label: "课程成绩",
- value: 2
- }]
- const currentRefreshFn = computed(() =>
- currentTab.value == '1' ? getKaoshichengjiList : getKcchengjiList
- )
- function tabChange(data) {
- currentTab.value = data.value
- if (currentTab.value == 1) {
- searchBarKeyName.value = 'ksName'
- } else {
- searchBarKeyName.value = 'kcName'
- }
- // customChengjiRef.value.tabChangeSearch(data)
- }
- const kechengClick = (data) => {
- uni.navigateTo({
- url: '/pages/course/kechengInfo?kcId=' + data.kcId + '&name=' + data.name
- });
- }
- </script>
- <style lang="scss">
- </style>
|