<template>
    <ie-page fix-height :safe-area-inset-bottom="false">
        <ie-navbar :title="navBinding.title"/>
        <ie-auto-resizer>
            <swiper :current="currentStep" disable-touch class="swiper h-full">
                <swiper-item>
                    <score-step/>
                </swiper-item>
                <swiper-item>
                    <batch-step/>
                </swiper-item>
                <swiper-item>
<!--                    <cart-step/>-->
                </swiper-item>
            </swiper>
        </ie-auto-resizer>
    </ie-page>
</template>

<script setup>
import ScoreStep from "@/pagesOther/pages/vhs/index/components/score-step.vue";
import BatchStep from "@/pagesOther/pages/vhs/index/components/batch-step.vue";
// import CartStep from "@/pagesOther/pages/vhs/index/components/cart-step.vue";
import {useProvideVoluntaryStep} from "@/pagesOther/pages/vhs/hooks/useVoluntaryStepInjection";
import {useProvideVoluntaryData} from "@/pagesOther/hooks/useVoluntaryDataInjection";
import {useProvideVoluntaryForm} from "@/pagesOther/pages/vhs/hooks/useVoluntaryFormInjection";
import {useProvideVoluntaryCart} from "@/pagesOther/pages/vhs/hooks/useVoluntaryCartInjection";
import {useProvideVoluntaryAssistant} from "@/pagesOther/pages/vhs/hooks/useVoluntaryAssistantInjection";
import {useProvideUserSnapshot} from "@/pagesOther/hooks/useUserSnapshotInjection";
import {useProvideVoluntaryMajorHighlight} from "@/pagesOther/pages/vhs/hooks/useVoluntaryMajorHighlightInjection";
import {useProvideVoluntaryHeader} from "@/pagesOther/pages/vhs/hooks/useVoluntaryHeaderInjection";
import {useTransferPage} from "@/hooks/useTransferPage";
import {routes} from "@/common/routes";

useProvideUserSnapshot()
const {transferTo} = useTransferPage()
const stepSvc = useProvideVoluntaryStep()
const dataSvc = useProvideVoluntaryData()
const formSvc = useProvideVoluntaryForm()
const cartSvc = useProvideVoluntaryCart()
const highlightSvc = useProvideVoluntaryMajorHighlight()
useProvideVoluntaryHeader()

const {currentStep} = stepSvc
const assistantSvc = useProvideVoluntaryAssistant(stepSvc, dataSvc, formSvc, cartSvc, highlightSvc)
const {navBinding, onComplete, resetAll} = assistantSvc

onComplete((id) => {
    transferTo(routes.VHSDetail, {data: {id}})
    currentStep.value = 0
    resetAll()
})
</script>

<style scoped lang="scss">
</style>
