add:新增开始建档页面

This commit is contained in:
zlong committed 2024-12-18 17:00:15 +08:00
1 parent e68fb95c1b
commit 05d82a5b2a
5 files changed
+75 -1

No files matched your search

+5 -1
View File
@@ -7,7 +7,7 @@
},
"pages": [
{
"path": "pages/home/index",
"path": "pages/start-filing/index",
"type": "page"
},
{
@@ -18,6 +18,10 @@
"path": "pages/feed-plan/index",
"type": "page"
},
{
"path": "pages/home/index",
"type": "page"
},
{
"path": "pages/me/index",
"type": "page"
+4
View File
@@ -8,6 +8,9 @@ const safeHeight = ToolFun.getSafeHeight()
const videoSrc = ref(
'https://test-cos-1308655658.cos.ap-shanghai.myqcloud.com/bright-intro-video.mp4',
)
function startFiling() {
uni.navigateTo({ url: '/pages/start-filing/index' })
}
</script>
<template>
@@ -49,6 +52,7 @@ const videoSrc = ref(
<button
class=" text-[18px] font-normal
tracking-[.36px] leading-[37px] shrink-0" hover-class="bg-[#4545E5]"
@tap="startFiling"
>
开始建档
</button>
+65
View File
@@ -0,0 +1,65 @@
<script setup lang="ts">
import FeedFlogan from '@/pages/feed-calculator/components/FeedFlogan.vue'
import right from '@/static/image/pet-parameters/right.png'
import edit from '@/static/image/start-filing/edit.png'
import ToolApi from '@/utils'
interface RecordList {
title: string
options: string[]
aimIndex: number
}
const titleName = ref<string>('开始建档')
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
}
function handleNext() {
uni.navigateTo({ url: '/pages/feed-calculator/index' })
}
</script>
<template>
<TitleBar :title-name="titleName" />
<view class="flex flex-col bg-[#F5F6F7] overflow-y-auto" :style="`height:calc(100vh - ${safeHeight}px)`">
<view class="w-[80px] h-[80px] rounded-full bg-[#D9D9D9] relative mt-[88px] mx-auto">
<view class="absolute right-1 bottom-1 w-[18px] h-[18px] bg-[#0052D9] rounded-full flex items-center justify-center">
<image :src="edit" class="w-[10px] h-[10px]" />
</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>
<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-[58px]" @tap="handleNext">
下一题
</button>
</view>
<FeedFlogan :bottom="feedFloganBottom" />
</view>
</template>
<style scoped>
</style>
Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

+1
View File
@@ -9,6 +9,7 @@ interface NavigateToOptions {
"/pages/home/index" |
"/pages/me/index" |
"/pages/pet-manual/index" |
"/pages/start-filing/index" |
"/pages/feed-calculator/components/FeedFlogan" |
"/pages/feed-calculator/components/FeedForm" |
"/pages/feed-calculator/components/FeedQuestionnaire" |