feat: 增加分享功能
This commit is contained in:
20
src/components/Profile/AboutPopup.vue
Normal file
20
src/components/Profile/AboutPopup.vue
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<template>
|
||||||
|
<wd-popup
|
||||||
|
v-model="profileStore.showAboutPopup"
|
||||||
|
position="bottom"
|
||||||
|
:safe-area-inset-bottom="true"
|
||||||
|
custom-style="border-radius: 32rpx 32rpx 0 0; padding: 40rpx 32rpx"
|
||||||
|
>
|
||||||
|
<text class="leading-8 text-[#5A5A5A] text-center">
|
||||||
|
本小程序处于持续建设阶段,各项功能按计划分批次推进。<br/>
|
||||||
|
当前可体验的内容为阶段性成果,后续模块将陆续补齐,<br/>
|
||||||
|
期间已有功能可正常访问,感谢理解与等候。
|
||||||
|
</text>
|
||||||
|
</wd-popup>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useProfileStore } from '@/store/profile'
|
||||||
|
|
||||||
|
const profileStore = useProfileStore()
|
||||||
|
</script>
|
||||||
@@ -76,7 +76,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
<wd-card title="🔥 今日资讯">
|
<wd-card>
|
||||||
|
<template #title>
|
||||||
|
<view class="wd-card__title-text flex items-center justify-between">
|
||||||
|
<text>🔥 健康资讯</text>
|
||||||
|
<text class="text-11px text-[#999]">🔄 每日更新</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
<wd-empty v-if="tipList.length === 0" icon="no-content"
|
<wd-empty v-if="tipList.length === 0" icon="no-content"
|
||||||
:tip="errorMessage || '获取资讯失败,请检查网络连接或联系管理员'" />
|
:tip="errorMessage || '获取资讯失败,请检查网络连接或联系管理员'" />
|
||||||
|
|
||||||
@@ -100,7 +107,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
<wd-card title="🔥 今日食谱">
|
<wd-card>
|
||||||
|
<template #title>
|
||||||
|
<view class="wd-card__title-text flex items-center justify-between">
|
||||||
|
<text>🌿 养生食谱</text>
|
||||||
|
<text class="text-11px text-[#999]">🔄 每日更新</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
<wd-empty v-if="recipeList.length === 0" icon="no-content"
|
<wd-empty v-if="recipeList.length === 0" icon="no-content"
|
||||||
:tip="errorMessage || '获取资讯失败,请检查网络连接或联系管理员'" />
|
:tip="errorMessage || '获取资讯失败,请检查网络连接或联系管理员'" />
|
||||||
|
|
||||||
@@ -161,6 +175,10 @@ import type { IRecipe, ITip } from "@/type";
|
|||||||
import TipPopup from "@/components/Home/TipPopup.vue";
|
import TipPopup from "@/components/Home/TipPopup.vue";
|
||||||
import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes";
|
import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes";
|
||||||
import RecipePopup from "@/components/Home/RecipePopup.vue";
|
import RecipePopup from "@/components/Home/RecipePopup.vue";
|
||||||
|
import { share } from '@/utils/share'
|
||||||
|
|
||||||
|
const { onShareAppMessage } = share()
|
||||||
|
onShareAppMessage()
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
@@ -209,6 +227,8 @@ const today = computed(() => {
|
|||||||
onShow(() => {
|
onShow(() => {
|
||||||
todayRecords.value = getDayRecords(getDateStr(Date.now()))
|
todayRecords.value = getDayRecords(getDateStr(Date.now()))
|
||||||
hasSignedToday.value = checkSignedToday()
|
hasSignedToday.value = checkSignedToday()
|
||||||
|
|
||||||
|
errorMessage.value = '加载中'
|
||||||
getTipList()
|
getTipList()
|
||||||
getRecipeList()
|
getRecipeList()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ import { onShow } from "@dcloudio/uni-app";
|
|||||||
import type { ICalendarSelect, IGroupHealthRecord, IHealthRecord } from "@/type/record";
|
import type { ICalendarSelect, IGroupHealthRecord, IHealthRecord } from "@/type/record";
|
||||||
import { useAppStore } from "@/store/app";
|
import { useAppStore } from "@/store/app";
|
||||||
import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes";
|
import { getTheme, getThemePrimaryColor, getThemeStyle } from "@/utils/themes";
|
||||||
|
import { share } from '@/utils/share'
|
||||||
|
|
||||||
|
const { onShareAppMessage } = share()
|
||||||
|
onShareAppMessage()
|
||||||
|
|
||||||
const currentDate = ref(Date.now())
|
const currentDate = ref(Date.now())
|
||||||
const currentRecordTypeSegment = ref('')
|
const currentRecordTypeSegment = ref('')
|
||||||
|
|||||||
@@ -128,6 +128,10 @@ import { useAppStore } from '@/store/app'
|
|||||||
import { getStats } from "@/utils/profile";
|
import { getStats } from "@/utils/profile";
|
||||||
import { getTheme, getThemeStyle } from "@/utils/themes";
|
import { getTheme, getThemeStyle } from "@/utils/themes";
|
||||||
import SummaryCard from "@/components/Stats/SummaryCard.vue";
|
import SummaryCard from "@/components/Stats/SummaryCard.vue";
|
||||||
|
import { share } from '@/utils/share'
|
||||||
|
|
||||||
|
const { onShareAppMessage } = share()
|
||||||
|
onShareAppMessage()
|
||||||
|
|
||||||
const profileStore = useProfileStore()
|
const profileStore = useProfileStore()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
<wd-cell size="large" title="数据统计" is-link @click="openStatsPopup"/>
|
<wd-cell size="large" title="数据统计" is-link @click="openStatsPopup"/>
|
||||||
<wd-cell size="large" title="主题色" is-link @click="openThemePopup"/>
|
<wd-cell size="large" title="主题色" is-link @click="openThemePopup"/>
|
||||||
<wd-cell size="large" title="存储详情" is-link @click="openStoragePopup"/>
|
<wd-cell size="large" title="存储详情" is-link @click="openStoragePopup"/>
|
||||||
|
<wd-cell size="large" title="关于我们" is-link @click="openAboutPopup"/>
|
||||||
</wd-cell-group>
|
</wd-cell-group>
|
||||||
|
|
||||||
<wd-text :text="`版本号:${appStore.version}`" custom-style="margin-top: 5px;display:block; text-align:center;"></wd-text>
|
<wd-text :text="`版本号:${appStore.version}`" custom-style="margin-top: 5px;display:block; text-align:center;"></wd-text>
|
||||||
@@ -66,6 +67,7 @@
|
|||||||
<point-popup />
|
<point-popup />
|
||||||
|
|
||||||
<theme-popup />
|
<theme-popup />
|
||||||
|
<about-popup />
|
||||||
</view>
|
</view>
|
||||||
</wd-config-provider>
|
</wd-config-provider>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,6 +89,11 @@ import PointPopup from "@/components/Profile/PointPopup.vue";
|
|||||||
import StatsPopup from "@/components/Profile/StatsPopup.vue";
|
import StatsPopup from "@/components/Profile/StatsPopup.vue";
|
||||||
import { getTheme, getThemePrimaryColor } from "@/utils/themes";
|
import { getTheme, getThemePrimaryColor } from "@/utils/themes";
|
||||||
import ThemePopup from "@/components/Profile/ThemePopup.vue";
|
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 profileStore = useProfileStore()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
@@ -147,6 +154,10 @@ function openStoragePopup() {
|
|||||||
profileStore.showStoragePopup = true
|
profileStore.showStoragePopup = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openAboutPopup() {
|
||||||
|
profileStore.showAboutPopup = true
|
||||||
|
}
|
||||||
|
|
||||||
function openPointPopup() {
|
function openPointPopup() {
|
||||||
profileStore.showPointPopup = true
|
profileStore.showPointPopup = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export const useProfileStore = defineStore('profile', {
|
|||||||
showDefaultRecordValuePopup: false,
|
showDefaultRecordValuePopup: false,
|
||||||
showPointPopup: false,
|
showPointPopup: false,
|
||||||
showThemePopup: false,
|
showThemePopup: false,
|
||||||
|
showAboutPopup: false,
|
||||||
profileForm: {
|
profileForm: {
|
||||||
gender: '',
|
gender: '',
|
||||||
height: 0,
|
height: 0,
|
||||||
|
|||||||
12
src/utils/share.ts
Normal file
12
src/utils/share.ts
Normal file
@@ -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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user