feat:生产初版页面

This commit is contained in:
R524809
2026-03-26 17:33:04 +08:00
parent 3aaf340781
commit dc5e057cb3
63 changed files with 2940 additions and 543 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* 存储平台适配器
* 封装微信小程序 Storage API
*/
export function getStorage<T>(key: string, defaultValue?: T): T | undefined {
try {
const value = wx.getStorageSync(key);
return value !== '' ? value : defaultValue;
} catch {
return defaultValue;
}
}
export function setStorage(key: string, value: any): void {
try {
wx.setStorageSync(key, value);
} catch (e) {
console.error('setStorage failed:', key, e);
}
}
export function removeStorage(key: string): void {
try {
wx.removeStorageSync(key);
} catch (e) {
console.error('removeStorage failed:', key, e);
}
}