import * as util from '../../utils/utils' ; interface LogsPageData { logs : string [ ] ; } interface LogsPage extends IPage { } class LogsPage { public data : LogsPageData = { logs : [ ] } ; public onLoad ( ) { let logs = wx . getStorageSync ( 'logs' ) || [ ] ; logs = logs . map ( log => { return util . formatTime ( new Date ( log ) ) ; } ) ; this . setData ( { logs : logs } ) ; } } Page ( new LogsPage ( ) ) ;