From 53899bfb2cb7e0e259eabf663725f97b56c0aa1a Mon Sep 17 00:00:00 2001 From: LSH Date: 星期四, 03 十一月 2022 11:46:52 +0800 Subject: [PATCH] # --- pages/basics/test.vue | 66 +++++++++++++++++++++++++++----- 1 files changed, 55 insertions(+), 11 deletions(-) diff --git a/pages/basics/test.vue b/pages/basics/test.vue index 75c4653..c6afbdf 100644 --- a/pages/basics/test.vue +++ b/pages/basics/test.vue @@ -4,11 +4,11 @@ <view class="square-2"> <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> - <view class="title-text"><text>閫氶亾</text></view> + <view class="title-text"><text>鐢ㄦ埛鐮�</text></view> </view> <view> <view style="width: 96%;margin-left: 2%;"> - <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="staNoList" v-model="staNo" placeholder="閫氶亾"></uni-combox> + <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="staNoList" v-model="staNo" placeholder="鐢ㄦ埛缂栧彿"></uni-combox> </view> </view> </view> @@ -19,23 +19,25 @@ </view> <view class="square-content"> <view class="content-input"> - <input readonly="value" v-model="locNo" type="text" placeholder="鎵爜 / 杈撳叆" > + <input readonly="value" v-model="locNo" type="text" placeholder="鎵爜 / 杈撳叆" + :focus="locNoFocus" @input="nextInput('userIdFocus')"> <uni-icons type="closeempty" size="20" color="#dadada" @click="remove('locNo')"></uni-icons> </view> </view> </view> - <view class="square-2"> + <!-- <view class="square-2"> <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> <view class="title-text"><text>鐢ㄦ埛鐮�</text></view> </view> <view class="square-content"> <view class="content-input"> - <input v-model="userId" type="text" placeholder="鎵爜 / 杈撳叆"> + <input v-model="userId" type="text" placeholder="鎵爜 / 杈撳叆" + :focus="userIdFocus" @input="nextInput('barcodeFocus')"> <uni-icons type="closeempty" size="20" color="#dadada" @click="remove('userId')"></uni-icons> </view> </view> - </view> + </view> --> <view class="square-2"> <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> @@ -43,7 +45,8 @@ </view> <view class="square-content"> <view class="content-input"> - <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆"> + <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" + :focus="barcodeFocus"> <uni-icons type="closeempty" size="20" color="#dadada" @click="remove('barcode')"></uni-icons> </view> </view> @@ -80,8 +83,11 @@ type: 'center', msgType: 'success', messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�', - staNoList:[1,2,3,4,5,6], - staNo:'' + staNoList:[1,2,3,4,5,6,7,8,9,10], + staNo:'', + locNoFocus:true, + userIdFocus:false, + barcodeFocus:false } }, mounted(){ @@ -105,6 +111,44 @@ getUrl() { this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl }, + focuss(e) { + this[e] = false; + setTimeout(()=>{ + this[e] = true; + }, 100); + }, + locNoFocuss() { + let that = this; + that.locNoFocus = false; + setTimeout(()=>{ + that.locNoFocus = true; + }, 100); + }, + // userIdFocuss() { + // let that = this; + // that.userIdFocus = false; + // setTimeout(()=>{ + // that.userIdFocus = true; + // }, 100); + // }, + barcodeFocuss() { + let that = this; + that.barcodeFocus = false; + setTimeout(()=>{ + that.barcodeFocus = true; + }, 100); + }, + nextInput(type) { + this.focuss(type) + // switch (obj) { + // case 'locNo': + // this.userIdFocuss(); + // break; + // case 'userId': + // this.barcodeFocuss(); + // break; + // } + }, // 娓呯┖input remove(e) { this[e] = '' @@ -113,8 +157,9 @@ resst() { this.staNo = '' this.locNo = '' - this.userId = '' + // this.userId = '' this.barcode = '' + this.locNoFocuss() }, // 纭 confirm() { @@ -124,7 +169,6 @@ data: { channel:that.staNo, locNo:that.locNo, - userId:that.userId, barcode:that.barcode }, header: { -- Gitblit v1.9.1