Browse Source

优化样式

shenjj 7 years ago
parent
commit
5d1622a86e
1 changed files with 14 additions and 1 deletions
  1. 14 1
      pages/mobile/applyPurchase/list/index.vue

+ 14 - 1
pages/mobile/applyPurchase/list/index.vue

@@ -3,7 +3,7 @@
     <div class="mobile-header">
     <div class="mobile-header">
       <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
       <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
       <div class="search-content">
       <div class="search-content">
-        <input type="text" v-model="seekKeyword" placeholder="请输入您要查找的型号或品牌" @keyup.13="searchSeek">
+        <input type="text" v-model="seekKeyword" placeholder="请输入您要查找的型号或品牌" @keyup.13="searchSeek" ref="searchSeekInput" @focus="inputGetFocus()" @blur="blur()">
         <span @click="searchSeek">
         <span @click="searchSeek">
         <i class="iconfont icon-sousuo"></i>
         <i class="iconfont icon-sousuo"></i>
         </span>
         </span>
@@ -79,6 +79,19 @@
         if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
         if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchSearchingMore && this.page < this.allPage) {
           this.getMoreSearch()
           this.getMoreSearch()
         }
         }
+        if (this.$refs.searchSeekInput && this.$store.state.mobile.InputGetFocus) {
+          this.$refs.searchSeekInput.blur()
+        }
+      },
+      blur: function() {
+        // setTimeout(() => {
+        this.$store.dispatch('mobile/SetInputGetFocus', false)
+        // }, 300)
+      },
+      inputGetFocus: function() {
+        setTimeout(() => {
+          this.$store.dispatch('mobile/SetInputGetFocus', true)
+        }, 300)
       },
       },
       getMoreSearch: function () {
       getMoreSearch: function () {
         this.page++
         this.page++