<template>
    <view v-if="userStore.hasTestAndRecord" class="mt-40 p-24 rounded-xl flex justify-between items-center
    bg-gradient-to-r from-primary-100 to-primary-50">
        <view class="text-24 text-fore-title">没有模考成绩/估分不确定？</view>
        <view class="text-28 text-primary font-bold flex items-center" @click="goSimulate">
            <text class="mr-6">去模拟测试</text>
            <uv-icon name="arrow-right" color="primary"/>
        </view>
    </view>
</template>

<script lang="ts" setup>

import {useUserStore} from "@/store/userStore";
import {useTransferPage} from "@/hooks/useTransferPage";
import {routes} from "@/common/routes";

const userStore = useUserStore()
const {transferTo} = useTransferPage()
const goSimulate = () => {
    const list = userStore.directedSchoolList || []
    const first = list[0] || {}
    if (!list.length || first.notice) {
        transferTo(routes.studyIndex)
    } else {
        transferTo(routes.studySimulate, {
            data: first
        });
    }
}

onMounted(() => userStore.getDirectedSchoolList())
</script>

<style scoped>

</style>