uu
This commit is contained in:
parent
57c74d9aa4
commit
d079e1d4cb
@ -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,24 @@
|
|||||||
<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') {
|
||||||
|
bl = true
|
||||||
|
}
|
||||||
|
if(this.phyTrigger == 'focus' && this.isInputFocused) {
|
||||||
|
bl = true
|
||||||
|
}
|
||||||
|
return bl
|
||||||
|
},
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
value: {
|
value: {
|
||||||
@ -61,8 +72,16 @@
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
phyTrigger:{ // 红外监听方式
|
||||||
|
default () {
|
||||||
|
return 'loaded' // loaded:组件加载 focus:输入框获取焦点
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
return {
|
||||||
|
isInputFocused: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
@ -91,6 +110,14 @@
|
|||||||
},
|
},
|
||||||
handleConfirm(){
|
handleConfirm(){
|
||||||
this.$emit('confirmClick')
|
this.$emit('confirmClick')
|
||||||
|
},
|
||||||
|
handleInputBlur(){
|
||||||
|
this.isInputFocused = false
|
||||||
|
this.$emit('blur')
|
||||||
|
},
|
||||||
|
handleInputFocus(){
|
||||||
|
this.isInputFocused = true
|
||||||
|
this.$emit('focus')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,8 +72,8 @@
|
|||||||
handleoItemClick({ curItem }) {
|
handleoItemClick({ curItem }) {
|
||||||
this.$emit('onItemClick', curItem)
|
this.$emit('onItemClick', curItem)
|
||||||
},
|
},
|
||||||
handleChange(val, text, checkedList) {
|
handleChange(val) {
|
||||||
this.$emit('onChange', val, text, checkedList)
|
this.$emit('onChange', val)
|
||||||
this.$emit('update:value', val)
|
this.$emit('update:value', val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<u-textarea shape="circle" placeholder-style=""
|
<u-textarea shape="circle" placeholder-style=""
|
||||||
:modelValue="value" :clearable="true" :placeholder="placeholder"
|
:modelValue="value" :clearable="true" :placeholder="placeholder"
|
||||||
custom-style="border-radius: 10rpx;padding: 15rpx 20rpx;"
|
custom-style="border-radius: 10rpx;padding: 15rpx 20rpx;" height="160"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
:height="height"
|
|
||||||
:autoHeight="autoHeight"
|
|
||||||
></u-textarea>
|
></u-textarea>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,16 +19,6 @@
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
height:{
|
|
||||||
default () {
|
|
||||||
return 160
|
|
||||||
}
|
|
||||||
},
|
|
||||||
autoHeight:{
|
|
||||||
default () {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user