diff --git a/pages.config.ts b/pages.config.ts
index 057371c..9e4da2c 100644
--- a/pages.config.ts
+++ b/pages.config.ts
@@ -1,4 +1,4 @@
-import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
+import {defineUniPages} from '@uni-helper/vite-plugin-uni-pages'
export default defineUniPages({
easycom: {
@@ -18,7 +18,7 @@ export default defineUniPages({
},
},
{
- path: 'pages/feed-calculator/index',
+ path: 'pages/feed-questionnaire/index',
type: 'page',
style: {
navigationBarTitleText: '喂养计算器',
@@ -64,33 +64,49 @@ export default defineUniPages({
type: 'page',
},
{
- path: 'pages/feed-calculator/components/FeedSlogan',
+ path: 'pages/feed-questionnaire/components/FeedSlogan',
type: 'page',
},
{
- path: 'pages/feed-calculator/components/FeedForm',
+ path: 'pages/feed-questionnaire/components/FeedForm',
type: 'page',
},
{
- path: 'pages/feed-calculator/components/FeedQuestionnaire',
+ path: 'pages/feed-questionnaire/components/FeedQuestionnaire',
type: 'page',
},
{
- path: 'pages/feed-calculator/components/FeedStart',
+ path: 'pages/feed-questionnaire/components/FeedStart',
type: 'page',
},
{
- path: 'pages/feed-calculator/components/FeedStep',
+ path: 'pages/feed-questionnaire/components/FeedStep',
type: 'page',
},
{
- path: 'pages/feed-calculator/components/ProgressBar',
+ path: 'pages/feed-questionnaire/components/ProgressBar',
type: 'page',
},
{
path: 'pages/pet-manual/components/CardList',
type: 'page',
},
+ {
+ path: 'pages/feed-plan-calculator/index',
+ type: 'page',
+ style: {
+ navigationBarTitleText: '喂养问卷',
+ },
+ layout: 'custom',
+ },
+ {
+ path: 'pages/feed-plan-calculator/choose-product',
+ type: 'page',
+ style: {
+ navigationBarTitleText: '喂养问卷',
+ },
+ layout: 'custom',
+ },
],
globalStyle: {
backgroundColor: '#fff',
diff --git a/src/App.vue b/src/App.vue
index 79f2db4..d83ad99 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,5 @@
-
-
-
-
diff --git a/src/api/product.ts b/src/api/product.ts
new file mode 100644
index 0000000..c6db97e
--- /dev/null
+++ b/src/api/product.ts
@@ -0,0 +1,6 @@
+import type {Product} from '@/model/product'
+import httpClient from '@/api/httpClient'
+
+export function fetchProductList() {
+ return httpClient.get('/products/list')
+}
diff --git a/src/components.d.ts b/src/components.d.ts
index e22a497..0be78a6 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -7,6 +7,8 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
+ AddFeedingPlan: typeof import('./components/AddFeedingPlan.vue')['default']
+ BButton: typeof import('./components/BButton.vue')['default']
Cell: typeof import('./components/Cell.vue')['default']
CellGroup: typeof import('./components/CellGroup.vue')['default']
PickerDate: typeof import('./components/PickerDate.vue')['default']
diff --git a/src/components/AddFeedingPlan.vue b/src/components/AddFeedingPlan.vue
new file mode 100644
index 0000000..0424a14
--- /dev/null
+++ b/src/components/AddFeedingPlan.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+ 添加
+
+
+
+
diff --git a/src/components/BButton.vue b/src/components/BButton.vue
new file mode 100644
index 0000000..ddc3fff
--- /dev/null
+++ b/src/components/BButton.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/src/layouts/custom.vue b/src/layouts/custom.vue
new file mode 100644
index 0000000..0c39861
--- /dev/null
+++ b/src/layouts/custom.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/model/product.ts b/src/model/product.ts
new file mode 100644
index 0000000..4142844
--- /dev/null
+++ b/src/model/product.ts
@@ -0,0 +1,14 @@
+import type {BaseModel} from '@/model/base'
+
+export interface Product extends BaseModel {
+ name: string
+ category: ProductCategory
+ photo: string
+ tags: string[]
+ totalCalories: number
+ totalWeight: number
+}
+export enum ProductCategory {
+ DRY_FOOD = '干粮',
+ WET_FOOD = '湿粮',
+}
diff --git a/src/pages.json b/src/pages.json
index be7feff..8ec348d 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -7,13 +7,6 @@
},
"entryPagePath": "pages/home/index",
"pages": [
- {
- "path": "pages/feed-calculator/index",
- "type": "page",
- "style": {
- "navigationBarTitleText": "喂养计算器"
- }
- },
{
"path": "pages/feed-plan/index",
"type": "page",
@@ -21,6 +14,29 @@
"navigationBarTitleText": "喂养计划"
}
},
+ {
+ "path": "pages/feed-plan-calculator/choose-product",
+ "type": "page",
+ "style": {
+ "navigationBarTitleText": "喂养问卷"
+ },
+ "layout": "custom"
+ },
+ {
+ "path": "pages/feed-plan-calculator/index",
+ "type": "page",
+ "style": {
+ "navigationBarTitleText": "喂养问卷"
+ },
+ "layout": "custom"
+ },
+ {
+ "path": "pages/feed-questionnaire/index",
+ "type": "page",
+ "style": {
+ "navigationBarTitleText": "喂养计算器"
+ }
+ },
{
"path": "pages/home/index",
"type": "page",
@@ -62,32 +78,32 @@
"style": {}
},
{
- "path": "pages/feed-calculator/components/FeedForm",
+ "path": "pages/feed-questionnaire/components/FeedForm",
"type": "page",
"style": {}
},
{
- "path": "pages/feed-calculator/components/FeedQuestionnaire",
+ "path": "pages/feed-questionnaire/components/FeedQuestionnaire",
"type": "page",
"style": {}
},
{
- "path": "pages/feed-calculator/components/FeedSlogan",
+ "path": "pages/feed-questionnaire/components/FeedSlogan",
"type": "page",
"style": {}
},
{
- "path": "pages/feed-calculator/components/FeedStart",
+ "path": "pages/feed-questionnaire/components/FeedStart",
"type": "page",
"style": {}
},
{
- "path": "pages/feed-calculator/components/FeedStep",
+ "path": "pages/feed-questionnaire/components/FeedStep",
"type": "page",
"style": {}
},
{
- "path": "pages/feed-calculator/components/ProgressBar",
+ "path": "pages/feed-questionnaire/components/ProgressBar",
"type": "page",
"style": {}
},
diff --git a/src/pages/feed-plan-calculator/choose-product.vue b/src/pages/feed-plan-calculator/choose-product.vue
new file mode 100644
index 0000000..c021030
--- /dev/null
+++ b/src/pages/feed-plan-calculator/choose-product.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+ productStore.switchCurrentProductCategory(category.value)"
+ >
+ {{ category.label }}
+
+
+
+
+
+
+
+ {{ product.name }}
+
+
+
+ {{ tag }}
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/feed-plan-calculator/index.vue b/src/pages/feed-plan-calculator/index.vue
new file mode 100644
index 0000000..d325731
--- /dev/null
+++ b/src/pages/feed-plan-calculator/index.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+ 400
+ Kcal
+
+
+
+ 总热量
+
+
+ (未添加产品)
+
+
+
+
+
+
+
+ 确认
+
+
+
+
+
diff --git a/src/pages/feed-calculator/components/FeedForm.vue b/src/pages/feed-questionnaire/components/FeedForm.vue
similarity index 100%
rename from src/pages/feed-calculator/components/FeedForm.vue
rename to src/pages/feed-questionnaire/components/FeedForm.vue
diff --git a/src/pages/feed-calculator/components/FeedQuestionnaire.vue b/src/pages/feed-questionnaire/components/FeedQuestionnaire.vue
similarity index 93%
rename from src/pages/feed-calculator/components/FeedQuestionnaire.vue
rename to src/pages/feed-questionnaire/components/FeedQuestionnaire.vue
index 18d2a67..8201504 100644
--- a/src/pages/feed-calculator/components/FeedQuestionnaire.vue
+++ b/src/pages/feed-questionnaire/components/FeedQuestionnaire.vue
@@ -1,8 +1,8 @@