12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <view class="container">
- <u-navbar leftIconColor="#fff" titleStyle="color:#fff;fontSize:36rpx;" :autoBack="true" bgColor="#2C6FF3"
- :placeholder="true" title="接口日志"></u-navbar>
- <scroll-view scroll-y="true" scroll-with-animation="true" lower-threshold="100">
- <view class="log-item" v-for="(item,index) in logs" :key="index">
- <view class="logs">
- <view class="name">请求时间</view>
- <view class="val">{{item.time}}</view>
- </view>
- <view class="logs">
- <view class="name">请求路径</view>
- <view class="val">{{item.url}}</view>
- </view>
- <view class="logs">
- <view class="name">请求参数</view>
- <view class="val">{{item.params}}</view>
- </view>
- <view class="logs">
- <view class="name">返回结果</view>
- <view class="val">{{item.res}}</view>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- logs: []
- }
- },
- onLoad(o) {
- if (uni.getStorageSync('logs')) {
- this.logs = JSON.parse(uni.getStorageSync('logs'))
- }
- },
- methods: {
- },
- }
- </script>
- <style scoped lang="scss">
- .container {
- padding: 24rpx;
- line-height: 50rpx;
- .text {
- color: #2C6FF3;
- }
- .log-item {
- width: 702rpx;
- margin-bottom: 50rpx;
- .logs {
- overflow: hidden;
- width: 100%;
- }
- .name {
- float: left;
- margin-right: 24rpx;
- width: 20%;
- color: gray;
- }
- .val {
- float: left;
- word-wrap: break-word;
- word-break: break-all;
- width: 76%;
- }
- }
- }
- </style>
|