diff --git a/src/components/Home/BpPopup.vue b/src/components/Home/BpPopup.vue
new file mode 100644
index 0000000..06a92a7
--- /dev/null
+++ b/src/components/Home/BpPopup.vue
@@ -0,0 +1,119 @@
+
+
+
+ 🩺 记录血压
+
+
+
+
+
+
+
+ mmHg
+
+
+
+
+
+
+
+ mmHg
+
+
+
+
+
+
+ bpm
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
diff --git a/src/components/Home/GlucosePopup.vue b/src/components/Home/GlucosePopup.vue
new file mode 100644
index 0000000..b5deaf7
--- /dev/null
+++ b/src/components/Home/GlucosePopup.vue
@@ -0,0 +1,114 @@
+
+
+
+ 💉 记录血糖
+
+
+
+
+
+
+
+ mmol/L
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
diff --git a/src/components/Home/RecordPopup.vue b/src/components/Home/RecordPopup.vue
new file mode 100644
index 0000000..3285138
--- /dev/null
+++ b/src/components/Home/RecordPopup.vue
@@ -0,0 +1,115 @@
+
+
+
+ 选择记录类型
+
+
+
+
+ {{ item.icon }}
+
+ {{ item.label }}
+
+
+
+
+
+
diff --git a/src/components/Home/SleepPopup.vue b/src/components/Home/SleepPopup.vue
new file mode 100644
index 0000000..9c4729f
--- /dev/null
+++ b/src/components/Home/SleepPopup.vue
@@ -0,0 +1,146 @@
+
+
+
+ 💤 记录睡眠
+
+
+
+
+
+
+
+
+
+ {{ sleepDuration }}
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Home/SportPopup.vue b/src/components/Home/SportPopup.vue
new file mode 100644
index 0000000..c6aebb3
--- /dev/null
+++ b/src/components/Home/SportPopup.vue
@@ -0,0 +1,109 @@
+
+
+
+ 🏃 记录运动
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+ 分钟
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
diff --git a/src/components/Home/TempPopup.vue b/src/components/Home/TempPopup.vue
new file mode 100644
index 0000000..e430c10
--- /dev/null
+++ b/src/components/Home/TempPopup.vue
@@ -0,0 +1,112 @@
+
+
+
+ 🌡️ 记录体温
+
+
+
+
+
+
+
+ ℃
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
diff --git a/src/components/Home/WeightPopup.vue b/src/components/Home/WeightPopup.vue
new file mode 100644
index 0000000..d5c13f3
--- /dev/null
+++ b/src/components/Home/WeightPopup.vue
@@ -0,0 +1,69 @@
+
+
+
+ ⚖️ 记录体重
+
+
+
+
+
+
+ Kg
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
+
+
+
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 1ed4a00..3802ef2 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -64,85 +64,21 @@
-
-
- 选择记录类型
-
-
-
-
- {{ item.icon }}
-
- {{ item.label }}
-
-
-
+
-
-
- ⚖️ 记录体重(Kg)
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- 保存
-
-
-
-
-
-
-
+
diff --git a/src/pages/record/record.vue b/src/pages/record/record.vue
index be15044..7309df4 100644
--- a/src/pages/record/record.vue
+++ b/src/pages/record/record.vue
@@ -1,8 +1,6 @@
-
-
-
+
@@ -17,7 +15,7 @@
-
+
({
+ list: [] as any[],
+ loading: false,
+ showFab: true,
+ showRecordPopup: false,
+ showWeightPopup: false,
+ weightForm: {
+ value: 1,
+ note: '',
+ time: '' as number | string,
+ },
+ showSleepPopup: false,
+ sleepForm: {
+ startTime: '' as number | string,
+ endTime: '' as number | string,
+ note: '',
+ time: '' as number | string,
+ },
+ showSportPopup: false,
+ sportForm: {
+ type: '',
+ duration: 0,
+ note: '',
+ time: '' as number | string,
+ },
+ showBpPopup: false,
+ bpForm: {
+ systolic: 0,
+ diastolic: 0,
+ heartRate: 0,
+ time: Date.now(),
+ note: '',
+ },
+ showGlucosePopup: false,
+ glucoseForm: {
+ value: 0,
+ period: '' as string,
+ time: Date.now(),
+ note: '',
+ },
+ showTempPopup: false,
+ tempForm: {
+ value: 36.5,
+ location: '' as string,
+ time: Date.now(),
+ note: '',
+ },
+ }),
+ actions: {
+ setLoading(val: boolean) {
+ this.loading = val
+ },
+
+ async fetchList() {
+ this.loading = true
+ try {
+ const res = await fetch('/api/record/list')
+ this.list = await res.json()
+ }
+ finally {
+ this.loading = false
+ }
+ },
+
+ addRecord(item: any) {
+ this.list.push(item)
+ },
+
+ removeRecord(id: string) {
+ this.list = this.list.filter(item => item.id !== id)
+ },
+ reset() {
+
+ },
+ },
+})
diff --git a/src/utils/index.ts b/src/utils/index.ts
index f86d774..79007e3 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -149,3 +149,11 @@ export const isDoubleTokenMode = import.meta.env.VITE_AUTH_MODE === 'double'
* 通常为 /pages/index/index
*/
export const HOME_PAGE = `/${(pages as PageMetaDatum[]).find(page => page.type === 'home')?.path || (pages as PageMetaDatum[])[0].path}`
+
+export function formatTime(ts: string | number) {
+ if (!ts)
+ return ''
+ const d = new Date(ts)
+ const pad = (n: number) => String(n).padStart(2, '0')
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`
+}