From 389db4f2793e751bf20c7331a6663a5665d87027 Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Wed, 2 Sep 2026 09:23:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Profile/AboutPopup.vue | 20 ++++++++++++++++++++ src/pages/index/index.vue | 24 ++++++++++++++++++++++-- src/pages/record/index.vue | 4 ++++ src/pages/stats/index.vue | 4 ++++ src/pages/user/index.vue | 11 +++++++++++ src/store/profile.ts | 1 + src/utils/share.ts | 12 ++++++++++++ 7 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 src/components/Profile/AboutPopup.vue create mode 100644 src/utils/share.ts diff --git a/src/components/Profile/AboutPopup.vue b/src/components/Profile/AboutPopup.vue new file mode 100644 index 0000000..c55adec --- /dev/null +++ b/src/components/Profile/AboutPopup.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 65826d1..7aa33d9 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -76,7 +76,14 @@ - + + + @@ -100,7 +107,14 @@ - + + + @@ -161,6 +175,10 @@ import type { IRecipe, ITip } from "@/type"; import TipPopup from "@/components/Home/TipPopup.vue"; import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes"; import RecipePopup from "@/components/Home/RecipePopup.vue"; +import { share } from '@/utils/share' + +const { onShareAppMessage } = share() +onShareAppMessage() defineOptions({ name: 'Home', @@ -209,6 +227,8 @@ const today = computed(() => { onShow(() => { todayRecords.value = getDayRecords(getDateStr(Date.now())) hasSignedToday.value = checkSignedToday() + + errorMessage.value = '加载中' getTipList() getRecipeList() }) diff --git a/src/pages/record/index.vue b/src/pages/record/index.vue index f118926..22d2940 100644 --- a/src/pages/record/index.vue +++ b/src/pages/record/index.vue @@ -100,6 +100,10 @@ import { onShow } from "@dcloudio/uni-app"; import type { ICalendarSelect, IGroupHealthRecord, IHealthRecord } from "@/type/record"; import { useAppStore } from "@/store/app"; import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes"; +import { share } from '@/utils/share' + +const { onShareAppMessage } = share() +onShareAppMessage() const currentDate = ref(Date.now()) const currentRecordTypeSegment = ref('') diff --git a/src/pages/stats/index.vue b/src/pages/stats/index.vue index 9fbffe4..8b60be6 100644 --- a/src/pages/stats/index.vue +++ b/src/pages/stats/index.vue @@ -128,6 +128,10 @@ import { useAppStore } from '@/store/app' import { getStats } from "@/utils/profile"; import { getTheme, getThemeStyle } from "@/utils/themes"; import SummaryCard from "@/components/Stats/SummaryCard.vue"; +import { share } from '@/utils/share' + +const { onShareAppMessage } = share() +onShareAppMessage() const profileStore = useProfileStore() const appStore = useAppStore() diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue index 9c7e55e..c55cac3 100644 --- a/src/pages/user/index.vue +++ b/src/pages/user/index.vue @@ -47,6 +47,7 @@ + @@ -66,6 +67,7 @@ + @@ -87,6 +89,11 @@ import PointPopup from "@/components/Profile/PointPopup.vue"; import StatsPopup from "@/components/Profile/StatsPopup.vue"; import { getTheme, getThemePrimaryColor } from "@/utils/themes"; import ThemePopup from "@/components/Profile/ThemePopup.vue"; +import AboutPopup from "@/components/Profile/AboutPopup.vue"; +import { share } from '@/utils/share' + +const { onShareAppMessage } = share() +onShareAppMessage() const profileStore = useProfileStore() const appStore = useAppStore() @@ -147,6 +154,10 @@ function openStoragePopup() { profileStore.showStoragePopup = true } +function openAboutPopup() { + profileStore.showAboutPopup = true +} + function openPointPopup() { profileStore.showPointPopup = true } diff --git a/src/store/profile.ts b/src/store/profile.ts index 05d085f..b99ad55 100644 --- a/src/store/profile.ts +++ b/src/store/profile.ts @@ -13,6 +13,7 @@ export const useProfileStore = defineStore('profile', { showDefaultRecordValuePopup: false, showPointPopup: false, showThemePopup: false, + showAboutPopup: false, profileForm: { gender: '', height: 0, diff --git a/src/utils/share.ts b/src/utils/share.ts new file mode 100644 index 0000000..bbc92b2 --- /dev/null +++ b/src/utils/share.ts @@ -0,0 +1,12 @@ +export function share(title = '今日健康打卡 🌿 一起来记录') { + return { + onShareAppMessage() { + const pages = getCurrentPages() + return { + title, + path: `/${pages[pages.length - 1].route}`, + imageUrl: '/static/logo.png' + } + } + } +}