Browse Source

英文搜索删除

chenrui 2 years ago
parent
commit
b181c0acf1
5 changed files with 14 additions and 5 deletions
  1. 8 0
      libs/tools.js
  2. 3 1
      main.js
  3. 1 2
      pages/sales/chooseCustomerBill.vue
  4. 1 1
      pages/sales/chooseShelf.vue
  5. 1 1
      pages/statistics/chooseShelf.vue

+ 8 - 0
libs/tools.js

@@ -55,6 +55,14 @@ export function throttle(fn, gaptime) {
 		}
 	}
 }
+
+//延迟函数
+export function delayDel(fn) {
+	setTimeout(()=>{
+		fn();
+	},80)
+}
+
 // 图片转Base64,pad 平台
 export const imgToBase64 = function (path,callback){
 	 // plus.nativeUI.previewImage([path]);

+ 3 - 1
main.js

@@ -2,6 +2,7 @@ import Vue from 'vue'
 import App from './App'
 import store from '@/store'
 import getConfig from '@/config'
+import {delayDel} from '@/libs/tools.js'
 Vue.config.productionTip = false
 
 App.mpType = 'app'
@@ -10,7 +11,8 @@ Vue.use(uView)
 
 let vuexStore = require("@/store/$u.mixin.js")
 Vue.mixin(vuexStore)
-
+//延迟执行函数
+Vue.prototype.$delayDel = delayDel
 // 系统配置
 Vue.prototype.$config = function (key) {
 	const envText = {pro:'生产环境',dev:'开发环境',uat:'预发布环境'}

+ 1 - 2
pages/sales/chooseCustomerBill.vue

@@ -48,9 +48,8 @@
 				<view class="searchInput u-flex u-row-between">
 					<icon type="search" color="#333" @click="getSearchCon" size="18"/>
 					<input class="uni-input" placeholder="请输入客户名称/拼音首字母查询" :value="keyword" @input="clearInput"/>
-					<icon type="clear" :style="{'opacity':isGobleSearch?1:0}" @click="clearSearch" size="18"/>
+					<icon type="clear" :style="{'opacity':isGobleSearch?1:0}" @click="$delayDel(clearSearch)" size="18"/>
 				</view>
-				
 			</view>
 		</view>
 		<view class="customer-con">

+ 1 - 1
pages/sales/chooseShelf.vue

@@ -13,7 +13,7 @@
 			<view class="moreShelfPart-search u-flex u-row-between" :style="{width: !searchBtn? '100%' : 'calc(100% - 120rpx)'}">
 				<icon type="search" color="#333" @click="search" size="18"/>
 				<input class="uni-input" @focus="focus" @blur="blur" placeholder="请输入客户名称/拼音首字母查询" :value="customerName" @input="clearInput"/>
-				<icon type="clear" :style="{'opacity':isGobleSearch?1:0}" @click="clearSearch" size="18"/>
+				<icon type="clear" :style="{'opacity':isGobleSearch?1:0}" @click="$delayDel(clearSearch)" size="18"/>
 			</view>
 			<view @click="search" v-if="searchBtn">
 				<u-button size="mini" type="primary" :custom-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3'}">搜索</u-button>

+ 1 - 1
pages/statistics/chooseShelf.vue

@@ -10,7 +10,7 @@
 			@blur="isGobleSearch=false"
 			@custom="search" 
 			@search="search" 
-			@clear="clearSearch"
+			@clear="$delayDel(clearSearch)"
 			:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
 			</u-search>
 		</view>