From 149b89d636d7416d3fce3e05469f8baee3a9fef2 Mon Sep 17 00:00:00 2001 From: zlong <953829746@qq.com> Date: Tue, 17 Dec 2024 17:10:18 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E5=A2=9E=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/FeedQuestionnaire.vue | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) 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] }} + +