<template>
    <ie-page>
        <ie-navbar title="MBTI职业性格测评" />
        <character-result :code="mbtiCode" :scores="mbtiScores" />
    </ie-page>
</template>

<script setup lang="ts">
import {useTransferPage} from "@/hooks/useTransferPage";
import {mbtiDetail} from "@/api/modules/test-center";
import CharacterResult from "@/pagesOther/pages/test-center/mbti/components/character-result.vue";

const { prevData } = useTransferPage();
const mbtiCode = ref('')
const mbtiScores = ref<number[]>([])

onMounted(async () => {
    if (prevData.value.code) {
        const {data} = await mbtiDetail({code: prevData.value.code})
        const {scoreE, scoreI, scoreS, scoreN, scoreT, scoreF, scoreJ, scoreP} = data
        mbtiCode.value = data.ruleCode
        mbtiScores.value = [scoreE, scoreI, scoreS, scoreN, scoreT, scoreF, scoreJ, scoreP]
    }
})

onPageScroll(() => {})
</script>

<style lang="scss">

</style>