diff --git a/src/pages/feed-plan/components/FeedQuestionnaire.vue b/src/pages/feed-plan/components/FeedQuestionnaire.vue index 4364322..5ad21a1 100644 --- a/src/pages/feed-plan/components/FeedQuestionnaire.vue +++ b/src/pages/feed-plan/components/FeedQuestionnaire.vue @@ -15,9 +15,21 @@ const emits = defineEmits<{ back: [void] step: [number] }>() -const step = ref(0) -const addPage = ref(1) -const isUserPage = ref(false) +const step = ref(0) +const addPage = ref(1) +const isUserPage = ref(false) +const aimList = ref(['增肥', '减肥']) +const aimIndex = ref(0) +const weightList = ref(['6kg', '7kg']) +const weightIndex = ref(0) +function handleAimChange(e: CustomEvent, type: string) { + if (type === 'aim') { + aimIndex.value = e.detail.value + } + else if (type === 'weight') { + weightIndex.value = e.detail.value + } +} const progressNumber = computed(() => { return Math.ceil((step.value + 1) / (props.list.length + addPage.value) * 100) }) @@ -76,20 +88,27 @@ function handleAnswer(answer: PetCard) { - 喂养目标 + + 喂养目标 + + - - 增肥 - + + + {{ aimList[aimIndex] }} + + 目标体重 - - 6kg - + + + {{ weightList[weightIndex] }} + +