From 2af5f043b60c1f7ac38ecccc8f5bf44743134325 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 十二月 2025 18:08:00 +0800
Subject: [PATCH] test
---
pages/my/log.vue | 96 ++++++++++++++++++++++++++++++++++++++----------
1 files changed, 76 insertions(+), 20 deletions(-)
diff --git a/pages/my/log.vue b/pages/my/log.vue
index a824105..0cbaa52 100644
--- a/pages/my/log.vue
+++ b/pages/my/log.vue
@@ -1,5 +1,21 @@
<template>
<view class="pages-my-log">
+ <view class="top">
+ <view class="input">
+ <input :placeholder="translate('input_interface_name')" v-model="keyMethod" />
+ <uni-icons class="clear" color="#ccc" type="clear" size="20" v-if="keyMethod"
+ @click="clickClearKey"></uni-icons>
+ </view>
+
+ <a class="btn" @click="clickSearch">
+ <uni-icons type="search" size="24" color="#1890FF"></uni-icons>
+ </a>
+ <a class="btn" @click="clickClearLog">
+ <uni-icons type="trash" size="24" color="#1890FF"></uni-icons>
+ </a>
+
+ </view>
+
<view class="list">
<view class="group" v-for="(item,index) in list" :key="index">
<view class="title" :class="item.statusCode!=200 ? 'error':''">{{ item.date+" "+item.url}}
@@ -9,12 +25,13 @@
</a>
</view>
</view>
- <view class="bottom">
- <a-button class="button" @click="clickClearLog">娓呯┖</a-button>
- </view>
+
</view>
</template>
<script>
+ import {
+ Base64
+ } from '@/comm/Base64.js';
import {
session,
showToast,
@@ -30,25 +47,49 @@
},
data() {
return {
- list: []
-
+ list: [],
+ keyMethod: ""
}
},
onLoad() {
- this.list = session.getValue("request_log") || []
+ const list = session.getValue("request_log") || []
+ this.list = list.map((item) => {
+ item.url = decodeURI(item.url)
+ return item
+ })
+
},
methods: {
clickDetail(item) {
+
+ getApp().globalData.pageBigData = item
uni.navigateTo({
- url: `/pages/my/log-detail?info=${JSON.stringify(item)}`
+ url: `/pages/my/log-detail`
})
},
clickClearLog() {
session.setValue("request_log", [])
session.setValue("request_log_max_data", {})
-
+
this.list = []
- }
+ },
+ clickSearch() {
+ const list = session.getValue("request_log")
+ const key = this.keyMethod.trim()
+ if (key)
+ this.list = list.filter((a) => a.url.toLowerCase().includes(key.toLowerCase()))
+
+ else
+ this.list = list
+ },
+ clickClearKey() {
+ this.keyMethod = ""
+ },
+ translate(t) {
+ if (typeof this.$t == "function") return this.$t(`page.${t}`)
+ else return t;
+ },
+
}
}
</script>
@@ -63,19 +104,18 @@
.list {
flex: 1;
- overflow: auto;
+ overflow-y: auto;
display: flex;
flex-direction: column;
+ width: 750rpx;
}
.group {
-
-
- width: calc(100% - 30rpx);
+ width: calc(100% - 20rpx);
padding: 10rpx 10rpx;
display: flex;
flex-direction: row;
- margin: 5rpx;
+ margin: 5rpx 10rpx;
background-color: #fff;
border-radius: 10rpx;
font-size: 30rpx;
@@ -84,12 +124,14 @@
flex: 1;
display: flex;
flex-direction: row;
+
margin: 5rpx;
word-wrap: break-word;
/* 鍏佽闀垮崟璇嶆垨 URL 鍦板潃鎹㈣鍒颁笅涓� */
word-break: break-all;
/* 寮哄埗鏂囨湰鍦ㄨ秴鍑哄鍣ㄥ搴︽椂鎹㈣ */
white-space: normal;
+ min-height: 30prx;
/* 鍏佽鏂囨湰鎹㈣ */
}
@@ -100,17 +142,31 @@
}
- .bottom {
+ .top {
margin: 10rpx;
+ width: 730rpx;
display: flex;
flex-direction: row;
- justify-content: center;
- align-items: center;
+ background-color: #F0F0F0;
- .button {
- width: 500rpx;
- color: red;
+ .input {
+ flex: 1;
+ padding: 10rpx;
+ border-radius: 8rpx;
+ display: flex;
+ flex-direction: row;
+ background-color: #fff;
+
+ input {
+ flex: 1;
+ }
}
+
+ .btn {
+ padding: 5rpx;
+ margin: 0 10rpx;
+ }
+
}
}
--
Gitblit v1.9.1