diff --git a/pages.config.ts b/pages.config.ts index f6267d7..f67658a 100644 --- a/pages.config.ts +++ b/pages.config.ts @@ -61,7 +61,7 @@ export default defineUniPages({ type: 'page', }, { - path: 'pages/feed-calculator/components/FeedFlogan', + path: 'pages/feed-calculator/components/FeedSlogan', type: 'page', }, { diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index c5ecd8d..0dbf9fd 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -190,6 +190,7 @@ declare global { const useEventSource: typeof import('@vueuse/core')['useEventSource'] const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper'] const useFavicon: typeof import('@vueuse/core')['useFavicon'] + const useFeedingPlanStore: typeof import('./stores/feeding-plan')['useFeedingPlanStore'] const useFetch: typeof import('@vueuse/core')['useFetch'] const useFileDialog: typeof import('@vueuse/core')['useFileDialog'] const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess'] @@ -507,6 +508,7 @@ declare module 'vue' { readonly useEventSource: UnwrapRef readonly useEyeDropper: UnwrapRef readonly useFavicon: UnwrapRef + readonly useFeedingPlanStore: UnwrapRef readonly useFetch: UnwrapRef readonly useFileDialog: UnwrapRef readonly useFileSystemAccess: UnwrapRef diff --git a/src/components.d.ts b/src/components.d.ts index 29173ac..e22a497 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -7,6 +7,11 @@ export {} declare module 'vue' { export interface GlobalComponents { + Cell: typeof import('./components/Cell.vue')['default'] + CellGroup: typeof import('./components/CellGroup.vue')['default'] + PickerDate: typeof import('./components/PickerDate.vue')['default'] + PickerItem: typeof import('./components/PickerItem.vue')['default'] + PopupInput: typeof import('./components/PopupInput.vue')['default'] TabBar: typeof import('./components/TabBar.vue')['default'] TitleBar: typeof import('./components/TitleBar.vue')['default'] } diff --git a/src/components/Cell.vue b/src/components/Cell.vue new file mode 100644 index 0000000..edf8f4f --- /dev/null +++ b/src/components/Cell.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/components/CellGroup.vue b/src/components/CellGroup.vue new file mode 100644 index 0000000..c86a468 --- /dev/null +++ b/src/components/CellGroup.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/src/components/PickerDate.vue b/src/components/PickerDate.vue new file mode 100644 index 0000000..c4c9c88 --- /dev/null +++ b/src/components/PickerDate.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/PickerItem.vue b/src/components/PickerItem.vue new file mode 100644 index 0000000..e8475b6 --- /dev/null +++ b/src/components/PickerItem.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/components/PopupInput.vue b/src/components/PopupInput.vue new file mode 100644 index 0000000..1b76cf0 --- /dev/null +++ b/src/components/PopupInput.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/src/model/pet.ts b/src/model/pet.ts index ce53e57..547ff29 100644 --- a/src/model/pet.ts +++ b/src/model/pet.ts @@ -2,7 +2,7 @@ import type { TraceableModel } from '@/model/base' export interface Pet extends TraceableModel { birthday: string - bodyType: string + bodyType: PetBodyType gender: number isActive: boolean isLactation: boolean @@ -10,10 +10,40 @@ export interface Pet extends TraceableModel { isSterilization: boolean name: string photo: string - type: string + type: PetType weight: number } export interface CreatePetRequest extends Omit { } + +export enum PetType { + CAT = 'cat', + DOG = 'dog', +} + +export enum PetBodyType { + // 极度消瘦 + EXTREMELY_THIN = 'extremely-thin', + // 非常瘦 + VERY_THIN = 'very-thin', + // 消瘦 + THIN = 'thin', + // 偏轻 + UNDERWEIGHT = 'underweight', + // 理想体重 + IDEAL = 'ideal', + // 偏重 + OVERWEIGHT = 'overweight', + // 肥胖 + OBESE = 'obese', + // 极度肥胖 + EXTREMELY_OBESE = 'extremely-obese', +} + +export enum Gender { + MALE, + FEMALE, + UNKNOWN, +} diff --git a/src/pages/feed-calculator/components/FeedStart.vue b/src/pages/feed-calculator/components/FeedStart.vue index b8795a2..b8d331b 100644 --- a/src/pages/feed-calculator/components/FeedStart.vue +++ b/src/pages/feed-calculator/components/FeedStart.vue @@ -1,6 +1,5 @@ diff --git a/src/static/icons/right.svg b/src/static/icons/right.svg new file mode 100644 index 0000000..49a06a0 --- /dev/null +++ b/src/static/icons/right.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/stores/feeding-plan.ts b/src/stores/feeding-plan.ts new file mode 100644 index 0000000..19999c0 --- /dev/null +++ b/src/stores/feeding-plan.ts @@ -0,0 +1,34 @@ +import { type CreatePetRequest, Gender, PetBodyType, PetType } from '@/model/pet' +import { defineStore } from 'pinia' + +export const useFeedingPlanStore = defineStore('feeding-plan', () => { + const petTypeOptions = [ + { value: PetType.CAT, label: '猫猫' }, + { value: PetType.DOG, label: '狗狗' }, + ] + + const genderOptions = [ + { value: Gender.MALE, label: '男孩' }, + { value: Gender.FEMALE, label: '女孩' }, + ] + + const pet = ref ({ + birthday: new Date().toISOString().split('T')[0], + bodyType: PetBodyType.IDEAL, + gender: Gender.MALE, + isActive: false, + isLactation: false, + isPregnant: false, + isSterilization: false, + name: '子龙', + photo: '', + type: PetType.CAT, + weight: 0, + }) + + return { + pet, + petTypeOptions, + genderOptions, + } +}) diff --git a/tailwind.config.ts b/tailwind.config.ts index 48a1f3c..c0a7e58 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -17,6 +17,9 @@ const theme: Config['theme'] = { primary: '#4545E5', default: '#828282', }, + boxShadow: { + 'cell-group': '0px 4px 12px 0px rgba(0, 0, 0, 0.10)', + }, } if (isMp || isQuickapp) theme.screens = {} diff --git a/tsconfig.json b/tsconfig.json index f363a42..ee5afdd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,9 @@ "@dcloudio/types", "@mini-types/alipay", "miniprogram-api-typings", - "@uni-helper/uni-types" + "@uni-helper/uni-types", + "@uni-helper/uni-app-types", + "@uni-helper/uni-ui-types" ], "sourceMap": true },