logs.js 261 B

123456789101112131415
  1. //logs.js
  2. const util = require('../../utils/util.js')
  3. Page({
  4. data: {
  5. logs: []
  6. },
  7. onLoad: function () {
  8. this.setData({
  9. logs: (wx.getStorageSync('logs') || []).map(log => {
  10. return util.formatTime(new Date(log))
  11. })
  12. })
  13. }
  14. })