|
@@ -1,30 +1,18 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import FeedFlogan from '@/pages/feed-calculator/components/FeedFlogan.vue'
|
|
|
|
|
-import right from '@/static/image/pet-parameters/right.png'
|
|
|
|
|
|
|
+import PickerItem from '@/components/PickerItem.vue'
|
|
|
|
|
+import FeedSlogan from '@/pages/feed-calculator/components/FeedFlogan.vue'
|
|
|
import edit from '@/static/image/start-filing/edit.png'
|
|
import edit from '@/static/image/start-filing/edit.png'
|
|
|
|
|
+import { useFeedingPlanStore } from '@/stores/feeding-plan'
|
|
|
import ToolApi from '@/utils'
|
|
import ToolApi from '@/utils'
|
|
|
|
|
|
|
|
-interface RecordList {
|
|
|
|
|
- title: string
|
|
|
|
|
- options: string[]
|
|
|
|
|
- aimIndex: number
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const safeHeight = ToolApi.getSafeHeight()
|
|
const safeHeight = ToolApi.getSafeHeight()
|
|
|
-const recordList = ref<RecordList[]>([
|
|
|
|
|
- { title: '宠物名字', options: ['子龙'], aimIndex: 0 },
|
|
|
|
|
- { title: '品种', options: ['好猫'], aimIndex: 0 },
|
|
|
|
|
- { title: '性别', options: ['男孩'], aimIndex: 0 },
|
|
|
|
|
- { title: '出生日期', options: ['2月2日'], aimIndex: 0 },
|
|
|
|
|
- { title: '体重', options: ['2kg'], aimIndex: 0 },
|
|
|
|
|
-])
|
|
|
|
|
-const feedFloganBottom = ref<number>(13)
|
|
|
|
|
-function handleAimChange(e: CustomEvent, index: number) {
|
|
|
|
|
- recordList.value[index].aimIndex = e.detail.value
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
+const feedSloganBottom = ref<number>(13)
|
|
|
function handleNext() {
|
|
function handleNext() {
|
|
|
uni.navigateTo({ url: '/pages/feed-calculator/index' })
|
|
uni.navigateTo({ url: '/pages/feed-calculator/index' })
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const { pet, petTypeOptions, genderOptions } = useFeedingPlanStore()
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -34,19 +22,26 @@ function handleNext() {
|
|
|
<image :src="edit" class="w-[10px] h-[10px]" />
|
|
<image :src="edit" class="w-[10px] h-[10px]" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-for="(item, index) in recordList" :key="index" :style="{ marginTop: index === 0 ? '28px' : index === 1 ? '16px' : '', borderRadius: index === 0 ? '12px' : index === 1 ? '12px 12px 0 0' : index === recordList.length - 1 ? '0 0 12px 12px' : '0px' }" class="w-[calc(100% - 32px)] mx-[16px] h-[56px] bg-[white] flex items-center card_border_bottom p-4 justify-between">
|
|
|
|
|
- <view class="whitespace-nowrap">
|
|
|
|
|
- {{ item.title }}
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="flex justify-center items-center">
|
|
|
|
|
- <picker :value="item.aimIndex" :range="item.options" @change="handleAimChange($event, index)">
|
|
|
|
|
- <view class="uni-input">
|
|
|
|
|
- {{ item.options[item.aimIndex] }}
|
|
|
|
|
- </view>
|
|
|
|
|
- </picker>
|
|
|
|
|
- <image :src="right" class="w-[24px] h-[24px]" />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="w-full px-4 flex flex-col gap-4 mt-[28px]">
|
|
|
|
|
+ <CellGroup class="w-full bg-[#fff] shadow-cell-group rounded-3 overflow-hidden">
|
|
|
|
|
+ <Cell title="宠物名称">
|
|
|
|
|
+ <PopupInput v-model="pet.name" placeholder="请输入宠物名称" />
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ </CellGroup>
|
|
|
|
|
+ <CellGroup class="w-full bg-[#fff] shadow-cell-group rounded-3 overflow-hidden">
|
|
|
|
|
+ <Cell title="品种" border>
|
|
|
|
|
+ <PickerItem v-model="pet.type" :options="petTypeOptions" />
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ <Cell title="性别" border>
|
|
|
|
|
+ <PickerItem v-model="pet.gender" :options="genderOptions" />
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ <Cell title="出生日期" border>
|
|
|
|
|
+ <PickerDate v-model="pet.birthday" />
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ <Cell title="体重">
|
|
|
|
|
+ <PopupInput v-model="pet.weight" placeholder="请输入宠物体重" suffix="kg" />
|
|
|
|
|
+ </Cell>
|
|
|
|
|
+ </CellGroup>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="flex items-center justify-center">
|
|
<view class="flex items-center justify-center">
|
|
@@ -54,7 +49,7 @@ function handleNext() {
|
|
|
下一题
|
|
下一题
|
|
|
</button>
|
|
</button>
|
|
|
</view>
|
|
</view>
|
|
|
- <FeedFlogan :bottom="feedFloganBottom" />
|
|
|
|
|
|
|
+ <FeedSlogan :bottom="feedSloganBottom" />
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|