<template>
	<view class="shouye-card-box lianxi-card-box">
		<!-- card title -->
		<view class="card-head-box">
			<view class="card-line-title">练习</view>
			<view class="card-more" @click="checkMore" v-if="data.count">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
		</view>
		<!-- kaoshi title -->
		<view class="card-name-box">
			<view class="card-name" v-if="data.zyName"><icon></icon>{{data.zyName}}</view>
			<text class="card-level">{{data.zyLevelName}}</text>
		</view>
		<!-- 内容区域 -->
		<view class="card-content-box kaoshi-content-box">
			<!-- <view class="card-content-item">
				<icon class="card-time-icon"></icon>
				<view class="content-text-box">
					<text>时间</text>
					<view>{{data.totalTm}}分钟</view>
				</view>
			</view> -->
			<view class="card-content-item">
				<icon :style="{ backgroundImage: 'url(' + data.iconsArr.sumIcon + ')' }"></icon>
				<view class="content-text-box">
					<text>总分</text>
					<view>{{data.ksScore}}分</view>
				</view>
			</view>
			<view class="card-content-item">
				<icon :style="{ backgroundImage: 'url(' + data.iconsArr.jgIcon + ')' }"></icon>
				<view class="content-text-box">
					<text>及格分</text>
					<view>{{data.okScore}}分</view>
				</view>
			</view>
		</view>
		<!-- 底部 -->
		<view class="card-bottom-box">
			<button type="default" class="index-card-btn" @click="handleStart(data)">进行练习</button>
		</view>
		
		<!-- 考试须知 -->
		<lianxixuzhi ref="lxzRef" @confirm="handleConfirmLx" key="1"></lianxixuzhi>
	</view>
</template>

<script setup>
	import lianxixuzhi from "@/components/kaoshixuzhi/lianxixuzhi.vue";
	import * as lianxi from "@/api/lianxi.js"
	import { ref } from "vue"
	defineProps({
		data: {
			type: Object,
		}
	})
	const activeks = ref(null);
	const lxzRef = ref(null)
	
	function checkMore() {
		uni.navigateTo({
			url: '/pages/client/Lianxi/list?from=shouye'
		})
	}
	
	function handleStart(data) {
		lxzRef.value.showDialog(data)
	}
	
	function handleConfirmKs(data) {
		checkKaoshi(data)
	}
	
	function checkKaoshi(item) {
		uni.navigateTo({
			url: `/pages/client/Lianxi/exam?lxId=${item.lxId}&from=shouye`
		})
	}
	
	function handleConfirmLx(data) {
		checkKaoshi(data)
	}
</script>

<style>
</style>