From 4ec20722756ba84c36b9690f6a24bec50c760fd9 Mon Sep 17 00:00:00 2001 From: whycq <123456> Date: 星期日, 24 四月 2022 23:56:14 +0800 Subject: [PATCH] # --- pages/basics/offline.vue | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pages/basics/offline.vue b/pages/basics/offline.vue index ac70a7a..09153e0 100644 --- a/pages/basics/offline.vue +++ b/pages/basics/offline.vue @@ -8,7 +8,8 @@ </view> <view class="square-content"> <view class="content-input"> - <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8"> + <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" + maxlength="8" :focus="barcodeFocus" @focus="focuss"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> </view> </view> @@ -34,7 +35,8 @@ </view> <view class="square-content"> <view class="content-input"> - <input v-model="matNo" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()" :focus="focus"> + <input v-model="matNo" type="text" placeholder="鎵爜 / 杈撳叆" + @input="findMat()" :focus="focus" @focus="focuss" > <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMat()"></uni-icons> </view> </view> @@ -132,7 +134,8 @@ data() { return { barcode: '', - matList:[], + barcodeFocus:true, + matList:[{barcode:'92992929292'}], matNo:'', mat:null, type: 'center', @@ -146,7 +149,8 @@ enableQty:'', msgType: 'success', messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�', - focus:true + + focus:false } }, mounted(){ @@ -156,6 +160,9 @@ this.basePORT = UPORT }, methods: { + focuss() { + uni.hideKeyboard() + }, messageToggle(type) { this.msgType = type this.messageText = `杩欐槸涓�鏉�${type}娑堟伅鎻愮ず` @@ -170,10 +177,18 @@ removeBarcode() { this.barcode = '' uni.vibrateShort(); + this.barcodeFocus = false; + this.$nextTick(function() { + this.barcodeFocus = true; + }); }, removeMat() { this.matNo = '' uni.vibrateShort(); + this.focus = false; + this.$nextTick(function() { + this.focus = true; + }); }, eject(type) { this.type = type -- Gitblit v1.9.1