feat: 调整个人信息页面

This commit is contained in:
ilhamtahir committed 2025-01-04 12:13:53 +08:00
1 parent bde886d9e6
commit 6074180a1a
13 files changed
+174 -97

No files matched your search

@@ -4,7 +4,6 @@ import FeedForm from '@/pages/feed-calculator/components/FeedForm.vue'
import FeedSlogan from '@/pages/feed-calculator/components/FeedSlogan.vue'
import ProgressBar from '@/pages/feed-calculator/components/ProgressBar.vue'
import avator from '@/static/image/pet-parameters/avatar.png'
import right from '@/static/image/pet-parameters/right.png'
const props = defineProps<{
list: FeedFormQuestions[]
@@ -51,19 +50,21 @@ function handlePrevious() {
emits('back')
}
}
function handleAnswer(answer: PetCard) {
console.log(answer.name, '答案')
const feedingPlanStore = useFeedingPlanStore()
function handleAnswer(answer: PetCard) {
if (answer.key) {
feedingPlanStore.setPetValue(answer.key, answer.value)
}
if (step.value === 2 || step.value === 7) {
emits('step', step.value)
}
if (step.value === props.list.length - 1) {
console.log(123)
isUserPage.value = true
}
if (step.value < props.list.length - 1 + addPage.value) {
step.value += 1
console.log(step.value, 'step')
}
}
</script>
@@ -78,41 +79,24 @@ function handleAnswer(answer: PetCard) {
<image :src="avator" class="w-[64px] h-[64px] rounded-full" />
<view class="mt-[5px] ">
<text class="font-bold text-[16px] ">
{{ props.userList.username }}
{{ feedingPlanStore.pet.name }}
</text>
<view class="mt-[8px] flex gap-2">
<view v-for="(item, index) in props.userList.type" :key="index" class="text-[12px] text-[#999] bg-[#F3F3F3] rounded-[3px] py-[2px] px-[8px]">
{{ item }}
<view v-for="item in feedingPlanStore.petTags" :key="item.key" class="text-[12px] text-[#999] bg-[#F3F3F3] rounded-[3px] py-[2px] px-[8px]">
{{ item.value }}
</view>
</view>
</view>
</view>
</view>
<view class="w-[calc(100% - 32px)] mx-[16px] h-[56px] bg-[white] rounded-t-3 mt-4 flex items-center card_border_bottom p-4 justify-between">
<view class="whitespace-nowrap">
喂养目标
</view>
<view class="flex justify-center items-center">
<picker :value="aimIndex" :range="aimList" @change="handleAimChange($event, 'aim')">
<view class="uni-input">
{{ aimList[aimIndex] }}
</view>
</picker>
<image :src="right" class="w-[24px] h-[24px]" />
</view>
</view>
<view class="w-[calc(100% - 32px)] mx-[16px] h-[56px] bg-[white] rounded-b-3 flex items-center p-4 justify-between">
<view>目标体重</view>
<view class="flex justify-center items-center">
<picker :value="weightIndex" :range="weightList" @change="handleAimChange($event, 'weight')">
<view class="uni-input">
{{ weightList[weightIndex] }}
</view>
</picker>
<image :src="right" class="w-[24px] h-[24px]" />
</view>
</view>
<CellGroup>
<Cell title="喂养目标" border>
<PickerItem v-model="feedingPlanStore.feedingPlan.feedingGoal" :options="feedingPlanStore.feedingGoalOptions" />
</Cell>
<Cell title="目标体重">
<PopupInput v-model="feedingPlanStore.feedingPlan.targetWeight" placeholder="请输入目标体重" />
</Cell>
</CellGroup>
<view class="flex items-center justify-center">
<button class="w-[176px] h-[47px] flex items-center justify-center bg-[#4545E5] border-none text-[white] rounded-3xl mt-[210px]">
下一步