You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
894 B
46 lines
894 B
11 months ago
|
<template>
|
||
|
<!-- logs.wxml -->
|
||
|
<view class="container log-list">
|
||
|
<block v-for="(log, index) in logs" :key="index">
|
||
|
<text class="log-item">{{ index + 1 }}. {{ log.date }}</text>
|
||
|
</block>
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
// logs.js
|
||
|
const util = require('../../utils/util.js');
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
logs: [],
|
||
|
|
||
|
log: {
|
||
|
date: ''
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
onLoad() {
|
||
|
this.setData({
|
||
|
logs: (uni.getStorageSync('logs') || []).map((log) => {
|
||
|
return {
|
||
|
date: util.formatTime(new Date(log)),
|
||
|
timeStamp: log
|
||
|
};
|
||
|
})
|
||
|
});
|
||
|
},
|
||
|
methods: {}
|
||
|
};
|
||
|
</script>
|
||
|
<style>
|
||
|
.log-list {
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
padding: 40rpx;
|
||
|
}
|
||
|
.log-item {
|
||
|
margin: 10rpx;
|
||
|
}
|
||
|
</style>
|