Browse Source

fix: 🧩 车位号优化

pull/2/head
liyongle 3 years ago
parent
commit
2e4c8dc23c
  1. 9
      src/components/PlateInput/PlateInput.vue
  2. 2
      src/composables/useParkingKeyboard.ts

9
src/components/PlateInput/PlateInput.vue

@ -21,7 +21,7 @@
class="btn"
:class="
((searchMethod === '车牌' && ((isEnergy && list.length === 8) || (!isEnergy && list.length === 7))) ||
(searchMethod === '车位' && list.length === 6)) &&
(searchMethod === '车位' && list.length !== 0)) &&
'ac'
"
@click="confirm"
@ -61,7 +61,7 @@ function handleEnergy() {
function confirm() {
if (
(props.searchMethod === '车牌' && ((isEnergy.value && props.list.length === 8) || (!isEnergy.value && props.list.length === 7))) ||
(props.searchMethod === '车位' && props.list.length === 6)
(props.searchMethod === '车位' && props.list.length !== 0)
) {
emits('confirm')
}
@ -171,9 +171,10 @@ $btn-width: 218px;
color: $btn-color;
background: $btn-bg;
border-radius: 12px;
opacity: 0.5;
box-shadow: 1px 16px 32px rgb(96 94 116 / 20%);
&.disabled {
opacity: 0.5;
&.ac {
opacity: 1;
}
span {
white-space: nowrap;

2
src/composables/useParkingKeyboard.ts

@ -6,7 +6,7 @@ type SearchMethods = '车牌' | '车位'
export const useParkingKeyboard = () => {
const NOT_ENERGY_PLATE = 7 //非能源车牌长度
const ENERGY_PLATE = 8 //能源车牌长度
const SPACE_MAX_LENGTH = 4 //车位最大允许长度
const SPACE_MAX_LENGTH = 7 //车位最大允许长度
const LICENSE = ['辽', 'A'] //默认车牌前缀
const plate = ref(LICENSE.slice())

Loading…
Cancel
Save