feat: 更新首页卡片功能

This commit is contained in:
2026-08-26 23:00:11 +08:00
parent bedc0af688
commit 0b94b74c88
7 changed files with 141 additions and 108 deletions

View File

@@ -8,9 +8,9 @@ export const useRecordStore = defineStore('record', {
showWeightPopup: false,
showSleepPopup: false,
showSportPopup: false,
showBpPopup: false,
showGlucosePopup: false,
showTempPopup: false,
showBloodPressurePopup: false,
showBloodSugarPopup: false,
showTemperaturePopup: false,
weightForm: {
value: 0,
note: '',
@@ -29,20 +29,20 @@ export const useRecordStore = defineStore('record', {
note: '',
time: Date.now(),
},
bpForm: {
bloodPressureForm: {
systolic: 0,
diastolic: 0,
heartRate: 0,
note: '',
time: Date.now(),
},
glucoseForm: {
bloodSugarForm: {
value: 0,
period: '',
note: '',
time: Date.now(),
},
tempForm: {
temperatureForm: {
value: 36.5,
location: '',
note: '',
@@ -63,17 +63,17 @@ export const useRecordStore = defineStore('record', {
this.resetSport()
this.showSportPopup = true
},
openBp() {
this.resetBp()
this.showBpPopup = true
openBloodPressure() {
this.resetBloodPressure()
this.showBloodPressurePopup = true
},
openGlucose() {
this.resetGlucose()
this.showGlucosePopup = true
openBloodSugar() {
this.resetBloodSugar()
this.showBloodSugarPopup = true
},
openTemp() {
this.resetTemp()
this.showTempPopup = true
openTemperature() {
this.resetTemperature()
this.showTemperaturePopup = true
},
submitWeight() {
addWeight(this.weightForm.value, this.weightForm.note, this.weightForm.time)
@@ -101,35 +101,35 @@ export const useRecordStore = defineStore('record', {
this.showSportPopup = false
this.isRecord = !this.isRecord
},
submitBp() {
submitBloodPressure() {
addBloodPressure(
this.bpForm.systolic,
this.bpForm.diastolic,
this.bpForm.heartRate,
this.bpForm.note,
this.bpForm.time,
this.bloodPressureForm.systolic,
this.bloodPressureForm.diastolic,
this.bloodPressureForm.heartRate,
this.bloodPressureForm.note,
this.bloodPressureForm.time,
)
this.showBpPopup = false
this.showBloodPressurePopup = false
this.isRecord = !this.isRecord
},
submitGlucose() {
submitBloodSugar() {
addBloodSugar(
this.glucoseForm.value,
this.glucoseForm.period,
this.glucoseForm.note,
this.glucoseForm.time,
this.bloodSugarForm.value,
this.bloodSugarForm.period,
this.bloodSugarForm.note,
this.bloodSugarForm.time,
)
this.showGlucosePopup = false
this.showBloodSugarPopup = false
this.isRecord = !this.isRecord
},
submitTemp() {
submitTemperature() {
addTemperature(
this.tempForm.value,
this.tempForm.location,
this.tempForm.note,
this.tempForm.time,
this.temperatureForm.value,
this.temperatureForm.location,
this.temperatureForm.note,
this.temperatureForm.time,
)
this.showTempPopup = false
this.showTemperaturePopup = false
this.isRecord = !this.isRecord
},
resetWeight() {
@@ -141,14 +141,14 @@ export const useRecordStore = defineStore('record', {
resetSport() {
this.sportForm = { category: '跑步', duration: 30, note: '', time: Date.now() }
},
resetBp() {
this.bpForm = { systolic: 120, diastolic: 70, heartRate: 80, note: '', time: Date.now() }
resetBloodPressure() {
this.bloodPressureForm = { systolic: 120, diastolic: 70, heartRate: 80, note: '', time: Date.now() }
},
resetGlucose() {
this.glucoseForm = { value: 5.4, period: '空腹', note: '', time: Date.now() }
resetBloodSugar() {
this.bloodSugarForm = { value: 5.4, period: '空腹', note: '', time: Date.now() }
},
resetTemp() {
this.tempForm = { value: 36.5, location: '腋下', note: '', time: Date.now() }
resetTemperature() {
this.temperatureForm = { value: 36.5, location: '腋下', note: '', time: Date.now() }
},
},
})