<template>
   	<div class="btn-box">
		<m-button @click="goWrongPreview" class="btn1" text="错题重做" />
		<m-button @click="goHomeTest" class="btn2" text="返回首页" />
	</div>
</template>

<script lang="ts" setup>
import { useRouter } from "vue-router"
import { Toast } from "vant";
const router = useRouter()
const vehicle = useRouter().currentRoute.value.query.vehicle as string; //路由qvehicle参数
const subject = useRouter().currentRoute.value.query.subject as string; //路由subject参数
const goWrongPreview = ()=>{

	if(window.localStorage.getItem(vehicle+subject)==""||window.localStorage.getItem(vehicle+subject)=="[]"||!window.localStorage.getItem(vehicle+subject)){
		Toast("没有错题了")
		return
	}
    router.push({
        path:"/wrongReview",
        query:router.currentRoute.value.query
    })


}
const goHomeTest = ()=>{
	   router.push({
        path:"/home/test",
        
    })


}


</script>

<style lang="scss" scoped>
.btn-box {
	margin: 45px auto;
	width: 230px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #ffffff;
	font-size: 15px;
	font-family: PingFang SC;
	font-weight: 400;
	line-height: 23px;
	.btn1 {
		background-color: #498ef5;
	}
	.btn2 {
		background-color: #01c18d;
	}
}

</style>