浏览代码

禁止键盘

YLZH 1 年之前
父节点
当前提交
9d97b77f3d
共有 2 个文件被更改,包括 18 次插入3 次删除
  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;
 }