<template>
	<view class="scroll-list-card mobile-card-box">
		<view>
			<img style="width: 100rpx;height: 100rpx;;" :src="data.pic" alt="" />
		</view>
		<text>{{data.ksName}}</text>
		<view class="timeSpan">总分：{{data.ksScore === null ? '': data.ksScore}}</view>
		<view class="timeSpan">得分：{{data.userScore === null ? '' : data.userScore}}</view>
		<view class="timeSpan">及格分：{{data.okScore=== null ? '': data.okScore}}</view>
		<view class="timeSpan">时间：{{data.answerStartTime === null ? '': data.answerStartTime}}</view>
		<view @click="lookShijuan(data)">查看试卷</view>
		<view @click="lookPaiming(data)">查看排名</view>
	</view>
</template>

<script setup>
	import {
		toRefs,
		ref,
		computed
	} from "vue";
	const props = defineProps({
		data: {
			type: Object,
		},
	});
	const Emits = defineEmits(['lookShijuan', 'lookPaiming']);
	const {
		data
	} = toRefs(props);

	function lookShijuan(data) {
		Emits('lookShijuan', data)
	}

	function lookPaiming(data) {
		Emits('lookPaiming', data)
	}
</script>

<style lang="scss" scoped>
	.mobile-card-box {
		box-sizing: border-box;
		margin: 0 30rpx 10rpx;
		border-bottom: 2rpx solid #f2f1f2;
		padding-bottom: 30rpx;
	}

	.mobile-card-title {
		color: #333;
		font-size: 32rpx;
		font-weight: 500;
		margin: 24rpx 0 24rpx 0;
		text-overflow: ellipsis;
		-o-text-overflow: ellipsis;
		overflow: hidden;
		word-wrap: break-word;
		display: -webkit-box;
		white-space: normal;
		-webkit-box-orient: vertical;
		text-align: justify;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		line-height: 48rpx;
	}

	// 行
	.mobile-card-row {
		margin-bottom: 32rpx;
		display: flex;
		justify-content: space-between;
		align-items: flex-end;

		text {
			font-size: 28rpx;
			line-height: 40rpx;
		}

		// 得分
		.mobile-card-score {
			font-size: 40rpx;
			color: #f10a0a;
		}

		// 分数（有最小宽度）
		.card-score-box {
			min-width: 240rpx;
			text-align: left;
		}
	}

	// 按钮
	.mobile-card-btn {
		width: 60%;
		height: 80rpx;
		line-height: 80rpx;
		margin: 50rpx auto;
		background: linear-gradient(0deg, #436aff 0%, #234ff7 100%);
		border-radius: 80rpx;
		display: block;
	}
</style>