Files
lunar-mini/mini/app.js
T

27 lines
674 B
JavaScript

// app.js
App({
onLaunch() {
// 初始化本地存储
const settings = wx.getStorageSync('lunar-settings');
if (!settings) {
wx.setStorageSync('lunar-settings', {
theme: 'light',
weekStartDay: 0,
ziHourSect: 'lateZiNextDay',
solarTime: true,
});
}
const profiles = wx.getStorageSync('lunar-user-profiles');
if (!profiles) {
wx.setStorageSync('lunar-user-profiles', { profiles: [], activeIndex: 0 });
}
const bookmarks = wx.getStorageSync('lunar-bookmarks');
if (!bookmarks) {
wx.setStorageSync('lunar-bookmarks', []);
}
},
globalData: {
// 全局共享数据
},
});