木箱扫码

This commit is contained in:
2023-08-17 16:33:52 +08:00
parent 8b5d490595
commit b2dba7b4b0
5 changed files with 36 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone"> <search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="focused = true"> <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">
</search-box-mx> </search-box-mx>
</view> </view>
</view> </view>
@@ -147,7 +147,7 @@
} }
}, },
onKeyInput ($event) { onKeyInput ($event) {
if ($event.target.value.length < 5) { if ($event.target.value.length !== 14) {
this.$nextTick(function(){ this.$nextTick(function(){
this.val1 = '' this.val1 = ''
uni.hideKeyboard() uni.hideKeyboard()
@@ -156,6 +156,12 @@
} }
this._boxQuery(this.val1) this._boxQuery(this.val1)
}, },
onFocus () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
onBlur () { onBlur () {
this.focused = false this.focused = false
}, },

View File

@@ -9,7 +9,7 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone"> <search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="focused = true"> <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">
</search-box-mx> </search-box-mx>
</view> </view>
</view> </view>
@@ -146,7 +146,7 @@
} }
}, },
onKeyInput ($event) { onKeyInput ($event) {
if ($event.target.value.length < 5) { if ($event.target.value.length !== 14) {
this.$nextTick(function(){ this.$nextTick(function(){
this.val1 = '' this.val1 = ''
uni.hideKeyboard() uni.hideKeyboard()
@@ -155,6 +155,12 @@
} }
this._boxQuery(this.val1) this._boxQuery(this.val1)
}, },
onFocus () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
onBlur () { onBlur () {
this.focused = false this.focused = false
}, },

View File

@@ -9,7 +9,7 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone"> <search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="focused = true"> <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">
</search-box-mx> </search-box-mx>
</view> </view>
</view> </view>
@@ -133,7 +133,7 @@
} }
}, },
onKeyInput ($event) { onKeyInput ($event) {
if ($event.target.value.length < 5) { if ($event.target.value.length !== 14) {
this.$nextTick(function(){ this.$nextTick(function(){
this.val1 = '' this.val1 = ''
uni.hideKeyboard() uni.hideKeyboard()
@@ -142,6 +142,12 @@
} }
this._boxQuery(this.val1) this._boxQuery(this.val1)
}, },
onFocus () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
onBlur () { onBlur () {
this.focused = false this.focused = false
}, },

View File

@@ -9,7 +9,7 @@
</view> </view>
<view class="filter_input_wraper"> <view class="filter_input_wraper">
<search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone"> <search-box-mx :focused="focused" @inputDel="inputDel" @inputScan="inputScan" @toPhone="toPhone">
<input type="text" v-model="val1" class="filter_input search_input" :focus="focused" @input="onKeyInput($event)" @blur="onBlur" @focus="focused = true"> <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">
</search-box-mx> </search-box-mx>
</view> </view>
</view> </view>
@@ -125,7 +125,7 @@
} }
}, },
onKeyInput ($event) { onKeyInput ($event) {
if ($event.target.value.length < 5) { if ($event.target.value.length !== 14) {
this.$nextTick(function(){ this.$nextTick(function(){
this.val1 = '' this.val1 = ''
uni.hideKeyboard() uni.hideKeyboard()
@@ -134,6 +134,12 @@
} }
this._boxQuery(this.val1) this._boxQuery(this.val1)
}, },
onFocus () {
this.focused = true
setTimeout(() => {
uni.hideKeyboard()
}, 300)
},
onBlur () { onBlur () {
this.focused = false this.focused = false
}, },

View File

@@ -44,7 +44,10 @@ const request = (params) => {
method: method, method: method,
header: Object.assign({}, defaultOpot, header), header: Object.assign({}, defaultOpot, header),
data: data, data: data,
dataType: 'json', dataType: 'json'
// networkTimeout: {
// 'request': 5000
// }
}) })
.then(res => { // 成功 .then(res => { // 成功
if (res.length === 1) { if (res.length === 1) {