This commit is contained in:
2025-08-13 17:13:50 +08:00
parent 34a3f7bf1f
commit 8c7e7750b5
3 changed files with 92 additions and 10 deletions
+14
View File
@@ -194,6 +194,20 @@ export default {
title: '洗澡护理',
date: '2024-01-17',
content: '给小橘洗了澡,全程很乖没有挣扎,现在毛毛很香'
},
{
id: 4,
type: 'weight',
title: '体重记录',
date: '2024-01-15',
content: '体重4.1kg,保持稳定增长趋势'
},
{
id: 5,
type: 'food',
title: '饮食记录',
date: '2024-01-14',
content: '今天食欲很好,吃完了所有的猫粮'
}
],
layout1Items: [
+7
View File
@@ -200,6 +200,7 @@ export default {
this.petId = options.petId || ''
this.petName = options.petName || '宠物'
this.loadPetInfo()
this.initializeTestDataIfNeeded()
this.loadWeightData()
this.generateChartData()
},
@@ -220,6 +221,12 @@ export default {
}
},
initializeTestDataIfNeeded() {
// 检查是否已有体重数据,如果没有则初始化测试数据
const records = weightManager.getWeightRecords(this.petId)
console.log(`宠物 ${this.petId} 的体重记录数量:`, records.length)
},
loadWeightData() {
// 获取当前体重
this.currentWeight = weightManager.getCurrentWeight(this.petId) || 4.2