wangguoyu 2 veckor sedan
förälder
incheckning
246e3eb6e9
2 ändrade filer med 76 tillägg och 9 borttagningar
  1. 69 0
      pages/score/index copy.vue
  2. 7 9
      pages/score/index.vue

+ 69 - 0
pages/score/index copy.vue

@@ -0,0 +1,69 @@
+<template>
+	<customNavbarVue title="成绩"></customNavbarVue>
+	<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'" @lookShijuan="lookShijuan" @lookPaiming="lookPaiming"   v-for="(item,index) in list"
+				:key="item.ksId" :data="item"></scroll-list-card-chengji>
+			<scroll-list-card-kechengji v-show="currentTab =='2'" @click="kechengChengjiClick(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 customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
+	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 lookShijuan = (data) => {
+		console.log('data',data);
+		uni.navigateTo({
+			url: '/subpkgScore/pages/score/kaoshiChengjiInfo?hisId=' + data.hisId + '&name=' + data.ksName+ '&userScore=' + data.userScore+ '&ksScore=' + data.ksScore
+		});
+	}
+	const lookPaiming = (data) => {
+		console.log('datalookPaiming',data);
+		uni.navigateTo({
+			url: '/subpkgScore/pages/score/kaoshiChengjiInfo?kcId=' + data.kcId + '&name=' + data.name
+		});
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 7 - 9
pages/score/index.vue

@@ -1,14 +1,12 @@
 <template>
 	<customNavbarVue title="成绩"></customNavbarVue>
-	<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'" @lookShijuan="lookShijuan" @lookPaiming="lookPaiming"   v-for="(item,index) in list"
-				:key="item.ksId" :data="item"></scroll-list-card-chengji>
-			<scroll-list-card-kechengji v-show="currentTab =='2'" @click="kechengChengjiClick(item)"
-				v-for="(item,index) in list" :key="item.ksId" :data="item"></scroll-list-card-kechengji>
+	<custom-scroll-list ref="customChengjiRef" :refreshFn="currentRefreshFn" @tabChange="tabChange"
+		:searchBarKey="searchBarKeyName"  :defaultTab="1">
+		<template #default="{list}">
+			<scroll-list-card-chengji  @lookShijuan="lookShijuan" @lookPaiming="lookPaiming"   v-for="(item,index) in list"
+				:key="item.ksId" :data="item"></scroll-list-card-chengji>
 		</template>
-	</custom-scroll-list-chengji>
+	</custom-scroll-list>
 </template>
 
 <script setup>
@@ -17,7 +15,7 @@
 		getKcchengjiList
 	} from "@/api/chengji.js";
 	import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
-	import customScrollListChengji from "@/components/custom-scroll-list/custom-scroll-list-chengji.vue";
+	import customScrollListChengji from "@/components/custom-scroll-list/custom-scroll-list.vue";
 	import {
 		onLoad,
 		onReady,