feat: 增加数据统计自定义功能

This commit is contained in:
2026-08-31 22:22:24 +08:00
parent dd5e4a255a
commit f85a6ded2a
6 changed files with 117 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ import type {IDefaultRecordValue, IProfile} from "@/type/profile";
const PROFILE_KEY = 'user_profile'
const OVERVIEW_KEY = 'user_overview'
const PLAN_KEY = 'user_plan'
const STATS_KEY = 'user_stats'
const DEFAULT_RECORD_VALUE_KEY = 'user_default_record_value'
function getEmptyProfile(): IProfile {
@@ -45,3 +46,11 @@ export function savePlan(data: string[]) {
wx.setStorageSync(PLAN_KEY, data)
}
export function getStats(): string[] {
return wx.getStorageSync(STATS_KEY) || []
}
export function saveStats(data: string[]) {
wx.setStorageSync(STATS_KEY, data)
}