|
|
@@ -1,40 +1,37 @@
|
|
|
<template>
|
|
|
- <view class="page-content">
|
|
|
- <mx-nav-bar v-bind="navBinding"/>
|
|
|
- <view ref="container" class="flex-1 min-h-1">
|
|
|
- <swiper :current="currentStep" disable-touch :style="{height: height+'px'}">
|
|
|
- <swiper-item>
|
|
|
- <score-step/>
|
|
|
- </swiper-item>
|
|
|
- <swiper-item>
|
|
|
- <batch-step/>
|
|
|
- </swiper-item>
|
|
|
- <swiper-item>
|
|
|
- <cart-step/>
|
|
|
- </swiper-item>
|
|
|
- </swiper>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <view ref="container" class="h-full">
|
|
|
+ <swiper :current="currentStep" disable-touch class="h-full">
|
|
|
+ <swiper-item class="h-full">
|
|
|
+ <score-step />
|
|
|
+ </swiper-item>
|
|
|
+ <swiper-item>
|
|
|
+ <batch-step />
|
|
|
+ </swiper-item>
|
|
|
+ <swiper-item>
|
|
|
+ <cart-step />
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref} from 'vue';
|
|
|
-import {useProvideTransfer} from "@/hooks/useTransfer";
|
|
|
-import {useProvideVoluntaryStep} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
|
|
|
-import {useProvideVoluntaryData} from "@/hooks/useVoluntaryDataInjection";
|
|
|
-import {useProvideVoluntaryForm} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
|
|
|
-import {useProvideVoluntaryCart} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryCartInjection";
|
|
|
-import {useProvideVoluntaryAssistant} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
|
|
|
+import { ref } from 'vue';
|
|
|
+import { useProvideTransfer } from "@/hooks/useTransfer";
|
|
|
+import { useProvideVoluntaryStep } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryStepInjection";
|
|
|
+import { useProvideVoluntaryData } from "@/hooks/useVoluntaryDataInjection";
|
|
|
+import { useProvideVoluntaryForm } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryFormInjection";
|
|
|
+import { useProvideVoluntaryCart } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryCartInjection";
|
|
|
+import { useProvideVoluntaryAssistant } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryAssistantInjection";
|
|
|
import ScoreStep from "@/pagesOther/pages/voluntary/index/components/score-step.vue";
|
|
|
-import {useElementSize} from "@vueuse/core";
|
|
|
-import {useProvideUserSnapshot} from "@/pagesOther/pages/ie/hooks/useUserSnapshotInjection";
|
|
|
+// import {useElementSize} from "@vueuse/core";
|
|
|
+import { useProvideUserSnapshot } from "@/pagesOther/pages/ie/hooks/useUserSnapshotInjection";
|
|
|
import BatchStep from "@/pagesOther/pages/voluntary/index/components/batch-step.vue";
|
|
|
import CartStep from "@/pagesOther/pages/voluntary/index/components/cart-step.vue";
|
|
|
-import {useProvideVoluntaryMajorHighlight} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryMajorHighlightInjection";
|
|
|
-import {useProvideVoluntaryHeader} from "@/pagesOther/pages/voluntary/hooks/useVoluntaryHeaderInjection";
|
|
|
+import { useProvideVoluntaryMajorHighlight } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryMajorHighlightInjection";
|
|
|
+import { useProvideVoluntaryHeader } from "@/pagesOther/pages/voluntary/hooks/useVoluntaryHeaderInjection";
|
|
|
|
|
|
useProvideUserSnapshot()
|
|
|
-const {transferTo} = useProvideTransfer()
|
|
|
+const { transferTo } = useProvideTransfer()
|
|
|
const stepSvc = useProvideVoluntaryStep()
|
|
|
const dataSvc = useProvideVoluntaryData()
|
|
|
const formSvc = useProvideVoluntaryForm()
|
|
|
@@ -42,19 +39,18 @@ const cartSvc = useProvideVoluntaryCart()
|
|
|
const highlightSvc = useProvideVoluntaryMajorHighlight()
|
|
|
useProvideVoluntaryHeader()
|
|
|
|
|
|
-const {currentStep} = stepSvc
|
|
|
+const { currentStep } = stepSvc
|
|
|
const container = ref(null) // swiper必须指定明确的高度,所以多包了一层
|
|
|
-const {height} = useElementSize(container)
|
|
|
+// const {height} = useElementSize(container)
|
|
|
|
|
|
-const assistantSvc = useProvideVoluntaryAssistant(stepSvc, dataSvc, formSvc, cartSvc, highlightSvc, height)
|
|
|
-const {navBinding, onComplete, resetAll} = assistantSvc
|
|
|
+const assistantSvc = useProvideVoluntaryAssistant(stepSvc, dataSvc, formSvc, cartSvc, highlightSvc)
|
|
|
+const { navBinding, onComplete, resetAll } = assistantSvc
|
|
|
|
|
|
onComplete((id) => {
|
|
|
- transferTo('/pages/voluntary/detail/detail', {id})
|
|
|
- currentStep.value = 0
|
|
|
- resetAll()
|
|
|
+ transferTo('/pages/voluntary/detail/detail', { id })
|
|
|
+ currentStep.value = 0
|
|
|
+ resetAll()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|