cuiqian2004
4 天以前 2af5f043b60c1f7ac38ecccc8f5bf44743134325
pages/my/log.vue
@@ -2,13 +2,13 @@
   <view class="pages-my-log">
      <view class="top">
         <view class="input">
            <input placeholder="请输入查找接口URL" v-model="keyMethod"/>
            <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>
            <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>
@@ -30,6 +30,9 @@
</template>
<script>
   import {
      Base64
   } from '@/comm/Base64.js';
   import {
      session,
      showToast,
      showModal
@@ -49,12 +52,19 @@
         }
      },
      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() {
@@ -68,14 +78,17 @@
            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;
         },
      }
   }
@@ -143,6 +156,7 @@
            display: flex;
            flex-direction: row;
            background-color: #fff;
            input {
               flex: 1;
            }