class Storage {
static cache = {};
constructor() { }
static getStorage(key){
if (!this.cache[key]) {
this.cache[key] = wx.getStorageSync(key);
}
return this.cache[key]; }
static setStorage(key, val) {
wx.setStorageSync(key, val);
this.cache[key] = val; }}
export default Storage页面使用Storage.getStorage('depoist_money_str')
Storage.setStorage('depoist_money_str','122344')