diff --git a/pages.json b/pages.json
index 36e98da..5cba2cc 100644
--- a/pages.json
+++ b/pages.json
@@ -32,6 +32,33 @@
"navigationBarTextStyle": "black"
}
},
+ {
+ "path": "pages/pets/pet-detail",
+ "style": {
+ "navigationBarTitleText": "宠物详情",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/pets/add-pet",
+ "style": {
+ "navigationBarTitleText": "添加宠物",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/pets/add-record",
+ "style": {
+ "navigationBarTitleText": "添加记录",
+ "navigationBarBackgroundColor": "#ffffff",
+ "navigationBarTextStyle": "black",
+ "navigationStyle": "custom"
+ }
+ },
{
"path": "pages/index/index",
"style": {
diff --git a/pages/pets/add-pet.vue b/pages/pets/add-pet.vue
new file mode 100644
index 0000000..2e973c3
--- /dev/null
+++ b/pages/pets/add-pet.vue
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/pets/add-record.vue b/pages/pets/add-record.vue
new file mode 100644
index 0000000..17cedfa
--- /dev/null
+++ b/pages/pets/add-record.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加照片
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/pets/pet-detail.vue b/pages/pets/pet-detail.vue
new file mode 100644
index 0000000..f7198b3
--- /dev/null
+++ b/pages/pets/pet-detail.vue
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ record.date }}
+ {{ record.content }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/pets/pets.vue b/pages/pets/pets.vue
index 1e1dba9..b29b09e 100644
--- a/pages/pets/pets.vue
+++ b/pages/pets/pets.vue
@@ -34,34 +34,22 @@
export default {
data() {
return {
- petsList: [
- // 示例数据
- {
- id: 1,
- name: '小橘',
- breed: '橘猫',
- age: 2,
- companionDays: 365,
- avatar: '/static/cat-avatar.jpg',
- gender: '公',
- weight: '4.5kg',
- birthday: '2022-01-15'
- },
- {
- id: 2,
- name: '小白',
- breed: '金毛',
- age: 3,
- companionDays: 1095,
- avatar: '/static/dog-avatar.jpg',
- gender: '母',
- weight: '25kg',
- birthday: '2021-03-20'
- }
- ]
+ petsList: []
}
},
+ onShow() {
+ this.loadPets()
+ },
methods: {
+ loadPets() {
+ try {
+ const pets = uni.getStorageSync('pets') || []
+ this.petsList = pets
+ } catch (error) {
+ console.error('加载宠物列表失败', error)
+ this.petsList = []
+ }
+ },
addPet() {
uni.navigateTo({
url: '/pages/pets/add-pet'