uu
This commit is contained in:
parent
cb427b0c3b
commit
a00ebbf01e
@ -2,7 +2,7 @@
|
|||||||
<u-row>
|
<u-row>
|
||||||
<u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value"
|
<u-input :placeholder="placeholder" :fontSize="fontSize" :modelValue="value"
|
||||||
:custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`"
|
:custom-style="`border-radius: 10rpx;padding: 11rpx 20rpx;${customStyle};`"
|
||||||
@change="handleInputChange"
|
@change="handleInputChange" @blur="handleInputBlur" @focus="handleInputFocus"
|
||||||
>
|
>
|
||||||
<template v-if="iconPos == 'left'" v-slot:prefix>
|
<template v-if="iconPos == 'left'" v-slot:prefix>
|
||||||
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon>
|
<u-icon @click="handleScan" name="scan" :size="fontSize*1.5"></u-icon>
|
||||||
@ -17,13 +17,26 @@
|
|||||||
<u-button custom-style="height: 70rpx;" :plain="true">确认</u-button>
|
<u-button custom-style="height: 70rpx;" :plain="true">确认</u-button>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<tpx-physics-scan @onChange="handleScanChange"></tpx-physics-scan>
|
<tpx-physics-scan v-if="showPhysics" @onChange="handleScanChange"></tpx-physics-scan>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { scanCode } from "@/common/untool"
|
import { scanCode } from "@/common/untool"
|
||||||
export default {
|
export default {
|
||||||
|
computed: {
|
||||||
|
showPhysics() {
|
||||||
|
let bl = false
|
||||||
|
if(this.phyTrigger == 'loaded') {
|
||||||
|
debugger
|
||||||
|
bl = true
|
||||||
|
}
|
||||||
|
if(this.phyTrigger == 'focus' && this.isInputFocused) {
|
||||||
|
debugger
|
||||||
|
bl = true
|
||||||
|
}
|
||||||
|
return bl
|
||||||
|
},
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
value: {
|
value: {
|
||||||
@ -61,8 +74,16 @@
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
phyTrigger:{ // 红外监听方式
|
||||||
|
default () {
|
||||||
|
return 'loaded' // loaded:组件加载 focus:输入框获取焦点
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
return {
|
||||||
|
isInputFocused: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
@ -91,6 +112,14 @@
|
|||||||
},
|
},
|
||||||
handleConfirm(){
|
handleConfirm(){
|
||||||
this.$emit('confirmClick')
|
this.$emit('confirmClick')
|
||||||
|
},
|
||||||
|
handleInputBlur(){
|
||||||
|
this.isInputFocused = false
|
||||||
|
this.$emit('blur')
|
||||||
|
},
|
||||||
|
handleInputFocus(){
|
||||||
|
this.isInputFocused = true
|
||||||
|
this.$emit('focus')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<u-row justify="between">
|
<u-row justify="between">
|
||||||
<view style="flex:1;">
|
<view style="flex:1;">
|
||||||
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="运单号, 请输入或扫码"
|
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="运单号, 请输入或扫码"
|
||||||
@scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
|
phyTrigger="focus" @scanChange="handleScanValChange" :showConfirm="true" @confirmClick="handleScanValChange" iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="margin-top:20rpx;">
|
<u-row custom-style="margin-top:20rpx;">
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<u-row custom-style="margin-top:20rpx;">
|
<u-row custom-style="margin-top:20rpx;">
|
||||||
<view style="flex: 1;">
|
<view style="flex: 1;">
|
||||||
<tpx-scan-input v-model:value="submitParam.bagNo" placeholder="合包号, 请输入或扫码"
|
<tpx-scan-input v-model:value="submitParam.bagNo" placeholder="合包号, 请输入或扫码"
|
||||||
iconPos="left"></tpx-scan-input>
|
phyTrigger="focus" iconPos="left"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="pl-10">
|
<!-- <view class="pl-10">
|
||||||
<u-button @click="handleCreatePaNo()"
|
<u-button @click="handleCreatePaNo()"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user