Browse Source

clean keyboard

dev
赵明涛 1 year ago
parent
commit
9f80b1e8e7
  1. 32
      uniapp_project_code/src/components/index/keyboard/input_box_QR.vue
  2. 12
      uniapp_project_code/src/components/index/keyboard/view_keyboard.vue

32
uniapp_project_code/src/components/index/keyboard/input_box_QR.vue

@ -24,7 +24,6 @@
import util from "@/utils/util.js"
import viewKeyboard from "@/components/index/keyboard/view_keyboard.vue";
import {
onMounted,
ref
@ -58,12 +57,6 @@
inputValue.value = i
}
const getNumBtnClass = (i) => {
if (i == 11) {
return "num-btn-last-child"
}
return "num-btn"
}
// getInputClass
const getInputClass = () => {
if (inputValue.value == "") {
@ -76,25 +69,6 @@
if (i == 10) return "0"
if (i == 11) return "" //delete
}
//click keyboard
const clickKeyboard = util.debounce((i) => {
console.log("clickKeyboard:", i)
// add input react
activeValue.value = i
setTimeout(() => {
activeValue.value = ""
}, 100)
if (i == 11) { //handle delete input
inputValue.value = inputValue.value.substring(0, inputValue.value.length - 1)
} else {
//limit maxInput
if (inputValue.value.length >= props.maxInput) {
return util.showNone(`最大输入${props.maxInput}`)
}
inputValue.value += getNumClick(i)
}
}, 20, true)
</script>
<style lang="scss" scoped>
@ -126,11 +100,13 @@
align-self: flex-end;
margin: 21rpx 21rpx 0 0;
}
.txt-title {
font-weight: 600;
font-size: 25rpx;
color: #333333;
}
.txt-input {
@include ctf(flex-start);
flex-direction: row;
@ -141,14 +117,17 @@
height: 69.44rpx;
border: 0.69rpx solid #979797;
border-radius: 6.94rpx;
.txt {
font-weight: 700;
}
.txt-write {
font-weight: 700;
font-size: 25rpx;
color: #333333;
}
.txt-blank {
font-size: 22.22rpx;
color: #999999;
@ -190,6 +169,7 @@
width: 70.03rpx;
height: 54.17rpx;
}
.v-text {
margin-left: 16rpx;
font-weight: 400;

12
uniapp_project_code/src/components/index/keyboard/view_keyboard.vue

@ -36,23 +36,13 @@
console.log(res + ` the keyboard_box component is now mounted. ` + props.maskHeight)
})
const handle_closeKeyboardBox = () => {
emits("showIt", "false")
}
const getNumBtnClass = (i) => {
if (i == 11) {
return "num-btn-last-child"
}
return "num-btn"
}
// getInputClass
const getInputClass = () => {
if (inputValue.value == "") {
return "txt-blank"
}
return "txt-write"
}
const getNumClick = (i) => {
if (i <= 9) return i
if (i == 10) return "0"

Loading…
Cancel
Save