feat: 增加数据统计自定义功能
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user