<template>
	<!-- 个人资料 -->
	<view class="Userinformation">
		<view class="score">
			<view class="scoreList" v-for="(item,index) in scoreList" :key="item.index">
				<text class="title"> 课程名称：{{item.typeName}}</text>
				<text>成绩:{{item.score}}</text>
				<text>学号:{{item.stuNo}}</text>
				<text>学年:{{item.stuYearName}}</text>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		listOwnFive
	} from "@/api/cqScore/cqscore.js";
	export default {

		data() {
			return {
				
				scoreList: [	]

			}
		},

		created() {

			this.fetchCqScores();

		},

		methods: {
			fetchCqScores() {
				// Make a GET request to the API endpoint
				let data={
					pageNum:1,
					pageSize:5
				};
				listOwnFive(data).then(res=>{
					if (res.statusCode === 200) { 
						this.scoreList = res.rows;
						console.log(this.scoreList);
					} else {
						console.error('Failed to fetch Cq Scores:', res.statusCode);
					}
				});  
			}

		}
	}
</script>

<style lang="less" scoped>
	.Userinformation {
		margin-bottom: 10rpx;

		.score {
			width: 100%;
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-top: 20rpx;
			margin-bottom: 20rpx;

			.scoreList {
				display: flex;
				flex-direction: column;
				width: 90%;
				height: 220rpx;
				border-bottom: 1px solid #D8D8D8;

				.title {
					font-size: 35rpx;
					font-weight: bold;
					color: black;
				}

				text {
					margin-top: 10rpx;
					color: #9C9C9C;
				}
			}
		}
	}
</style>