feat: 增加各个模块

This commit is contained in:
2026-08-24 22:58:08 +08:00
parent d0113394ec
commit 8ff7d4548e
32 changed files with 3019 additions and 188 deletions

25
src/utils/profile.ts Normal file
View File

@@ -0,0 +1,25 @@
export interface IProfile {
name: string
gender: 'male' | 'female' | ''
height: number | null
weight: number | null
}
const PROFILE_KEY = 'user_profile'
function getEmptyProfile(): IProfile {
return {
gender: '',
height: null,
name: '',
weight: null,
}
}
export function getProfile(): IProfile {
return wx.getStorageSync(PROFILE_KEY) || getEmptyProfile()
}
export function saveProfile(data: IProfile) {
wx.setStorageSync(PROFILE_KEY, data)
}