//logs.js const app = getApp() const util = require('../../utils/util.js') Page({ data: { logs: [] }, onLoad: function () { this.setData({ logs: (wx.getStorageSync('logs') || []).map(log => { return util.formatTime(new Date(log)) }) }) let _this = this; _this.setData({ navH: app.globalData.navHeight }) } })