From e42d0854ecc8db6e94a43dbfa2905fe665668e4f Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Tue, 25 Aug 2026 10:42:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 12 +++- src/components/Profile/StoragePopup.vue | 54 ++++++++++++++++ src/pages/index/index.vue | 15 +++-- src/pages/record/index.vue | 12 ++-- src/pages/user/index.vue | 16 ++++- src/store/profile.ts | 6 +- src/type/index.ts | 4 ++ src/type/profile.ts | 6 ++ src/type/record.ts | 18 ++++++ src/utils/profile.ts | 7 +- src/utils/record.ts | 85 ++++++++++++------------- tsconfig.json | 2 +- 13 files changed, 176 insertions(+), 62 deletions(-) create mode 100644 src/components/Profile/StoragePopup.vue create mode 100644 src/type/index.ts diff --git a/package.json b/package.json index a93f785..c116617 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@dcloudio/uni-mp-xhs": "3.0.0-5020420260813003", "@dcloudio/uni-quickapp-webview": "3.0.0-5020420260813003", "@wot-ui/ui": "^2.3.2", + "miniprogram-api-typings": "^5.2.3", "pinia": "^4.0.3", "vue": "^3.4.21", "vue-i18n": "^9.1.9" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 578318f..0e60880 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ importers: '@wot-ui/ui': specifier: ^2.3.2 version: 2.3.2(vue@3.5.41(typescript@4.9.5)) + miniprogram-api-typings: + specifier: ^5.2.3 + version: 5.2.3 pinia: specifier: ^4.0.3 version: 4.0.3(@vue/devtools-api@6.6.4)(typescript@4.9.5)(vue@3.5.41(typescript@4.9.5)) @@ -3179,6 +3182,9 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + miniprogram-api-typings@5.2.3: + resolution: {integrity: sha512-KVcNSfR2VmRtz35rxkjLxE92HlsBnbT6NsKyTcDX3ebbTKAsAiTOFO1mRM82Xbe848dnEYqNGzaD48LMEvGytw==} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -6715,7 +6721,7 @@ snapshots: browserslist: 4.28.8 browserslist-to-esbuild: 2.1.1(browserslist@4.28.8) core-js: 3.50.0 - magic-string: 0.30.11 + magic-string: 0.30.21 regenerator-runtime: 0.14.1 systemjs: 6.15.1 terser: 5.50.0 @@ -6814,7 +6820,7 @@ snapshots: '@vue/compiler-ssr': 3.4.21 '@vue/shared': 3.4.21 estree-walker: 2.0.2 - magic-string: 0.30.11 + magic-string: 0.30.21 postcss: 8.5.26 source-map-js: 1.2.1 @@ -8343,6 +8349,8 @@ snapshots: minimist@1.2.8: {} + miniprogram-api-typings@5.2.3: {} + mkdirp@0.5.6: dependencies: minimist: 1.2.8 diff --git a/src/components/Profile/StoragePopup.vue b/src/components/Profile/StoragePopup.vue new file mode 100644 index 0000000..0e6ae37 --- /dev/null +++ b/src/components/Profile/StoragePopup.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index e5cad71..1dfd4a2 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -81,10 +81,11 @@ import SportPopup from "@/components/Home/SportPopup.vue"; import BpPopup from "@/components/Home/BpPopup.vue"; import GlucosePopup from "@/components/Home/GlucosePopup.vue"; import TempPopup from "@/components/Home/TempPopup.vue"; -import { ref, computed, onMounted, watch } from 'vue' +import { ref, computed, watch } from 'vue' import { useRecordStore } from '@/store/record' -import type { IHealthRecord } from '@/utils/record' -import { getDateStr, getDayRecords } from '@/utils/record' +import { countRecordsByMonth, getDateStr, getDayRecords } from '@/utils/record' +import type { IHealthRecord } from "@/type/record"; +import {onShow} from "@dcloudio/uni-app"; defineOptions({ name: 'Home', @@ -114,7 +115,7 @@ const today = computed(() => { return `${m}月${d}日 周${w}` }) -onMounted(() => { +onShow(() => { todayRecords.value = getDayRecords(getDateStr(Date.now())) }) @@ -196,3 +197,9 @@ function handelFabClick() { recordStore.showFab = false } + + diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue index ea99761..10071a9 100644 --- a/src/pages/record/index.vue +++ b/src/pages/record/index.vue @@ -13,12 +13,12 @@ - + - + @@ -90,7 +90,6 @@