logs.ts 362 B

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