Browse Source

禁止键盘

YLZH 1 year ago
parent
commit
9d97b77f3d
2 changed files with 18 additions and 3 deletions
  1. 9 1
      src/pages/oils/list.vue
  2. 9 2
      src/pages/settlement/list.vue

+ 9 - 1
src/pages/oils/list.vue

@@ -99,7 +99,15 @@ function changeSearchType({ item, index }) {
   }
 }
 function searchFocus() {
-
+  const keyStop = () => {
+    var interval = setInterval(function () {
+      uni.hideKeyboard(); //隐藏软键盘
+    }, 20);
+    setTimeout(() => {
+      clearInterval(interval);
+    }, 3000);
+  };
+  keyStop();
   uni.hideKeyboard()
   showSheet.value = true;
 }

+ 9 - 2
src/pages/settlement/list.vue

@@ -112,8 +112,15 @@ function changeSearchType({ item, index }) {
   }
 }
 function searchFocus() {
-
-
+  const keyStop = () => {
+    var interval = setInterval(function () {
+      uni.hideKeyboard(); //隐藏软键盘
+    }, 20);
+    setTimeout(() => {
+      clearInterval(interval);
+    }, 3000);
+  };
+  keyStop();
   uni.hideKeyboard();
   showSheet.value = true;
 }