logs.js 309 B

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