木箱扫码

This commit is contained in:
2023-08-18 13:56:04 +08:00
parent b2dba7b4b0
commit a3d469e35e
4 changed files with 32 additions and 20 deletions

View File

@@ -9,7 +9,7 @@
</view>
<view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @focus="onFocus" @blur="onBlur">
<input type="text" class="filter_input search_input" v-model="val1" :focus="focused" @input="onKeyInput" @focus="onFocus" @blur="onBlur" inputmode="node">
</search-box-mx>
</view>
</view>
@@ -146,14 +146,17 @@
this.disabled1 = false
}
},
onKeyInput ($event) {
if ($event.target.value.length !== 14) {
this.$nextTick(function(){
onKeyInput (event) {
var value = event.detail.value
value=value.replace(/[^\w\.\/]/ig,'')
if (value.length !== 14) {
this.$nextTick(() => {
this.val1 = ''
uni.hideKeyboard()
})
uni.hideKeyboard()
return
}
uni.hideKeyboard()
this._boxQuery(this.val1)
},
onFocus () {

View File

@@ -9,7 +9,7 @@
</view>
<view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="onFocus">
<input type="text" class="filter_input search_input" v-model="val1" :focus="focused" @input="onKeyInput" @focus="onFocus" @blur="onBlur">
</search-box-mx>
</view>
</view>
@@ -145,14 +145,17 @@
this.disabled1 = false
}
},
onKeyInput ($event) {
if ($event.target.value.length !== 14) {
this.$nextTick(function(){
onKeyInput (event) {
var value = event.detail.value
value=value.replace(/[^\w\.\/]/ig,'')
if (value.length !== 14) {
this.$nextTick(() => {
this.val1 = ''
uni.hideKeyboard()
})
uni.hideKeyboard()
return
}
uni.hideKeyboard()
this._boxQuery(this.val1)
},
onFocus () {

View File

@@ -9,7 +9,7 @@
</view>
<view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="onFocus">
<input type="text" class="filter_input search_input" v-model="val1" :focus="focused" @input="onKeyInput" @focus="onFocus" @blur="onBlur">
</search-box-mx>
</view>
</view>
@@ -132,14 +132,17 @@
this.disabled = false
}
},
onKeyInput ($event) {
if ($event.target.value.length !== 14) {
this.$nextTick(function(){
onKeyInput (event) {
var value = event.detail.value
value=value.replace(/[^\w\.\/]/ig,'')
if (value.length !== 14) {
this.$nextTick(() => {
this.val1 = ''
uni.hideKeyboard()
})
uni.hideKeyboard()
return
}
uni.hideKeyboard()
this._boxQuery(this.val1)
},
onFocus () {

View File

@@ -9,7 +9,7 @@
</view>
<view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="onFocus">
<input type="text" class="filter_input search_input" v-model="val1" :focus="focused" @input="onKeyInput" @focus="onFocus" @blur="onBlur">
</search-box-mx>
</view>
</view>
@@ -124,14 +124,17 @@
this.disabled = false
}
},
onKeyInput ($event) {
if ($event.target.value.length !== 14) {
this.$nextTick(function(){
onKeyInput (event) {
var value = event.detail.value
value=value.replace(/[^\w\.\/]/ig,'')
if (value.length !== 14) {
this.$nextTick(() => {
this.val1 = ''
uni.hideKeyboard()
})
uni.hideKeyboard()
return
}
uni.hideKeyboard()
this._boxQuery(this.val1)
},
onFocus () {