feat(tools): Remove requirement for ten-diget codes
This commit is contained in:
parent
25c38ea381
commit
80ca7aa08b
@ -72,18 +72,15 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handleInput(input) {
|
function handleInput(input) {
|
||||||
if (`${input}`.length > 10) {
|
|
||||||
cardCode = input;
|
|
||||||
|
|
||||||
ScanService.scanControllerPostTrackScans({
|
ScanService.scanControllerPostTrackScans({
|
||||||
card: parseInt(cardCode),
|
card: parseInt(input),
|
||||||
station: selectedStation,
|
station: selectedStation,
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
scaninfo = data;
|
scaninfo = data;
|
||||||
if (scaninfo.valid) {
|
if (scaninfo.valid) {
|
||||||
new Audio("/beep.mp3").play();
|
new Audio("/beep.mp3").play();
|
||||||
state = "scan_success";
|
state = "scan_card";
|
||||||
} else {
|
} else {
|
||||||
state = "error_invalid";
|
state = "error_invalid";
|
||||||
new Audio("/error.mp3").play();
|
new Audio("/error.mp3").play();
|
||||||
@ -95,7 +92,6 @@
|
|||||||
new Audio("/error.mp3").play();
|
new Audio("/error.mp3").play();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
@ -214,7 +210,6 @@
|
|||||||
e.detail.decodedText.length - 1
|
e.detail.decodedText.length - 1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
scannerActive = false;
|
|
||||||
console.log({ type: "DETECT", code: e.detail.decodedText });
|
console.log({ type: "DETECT", code: e.detail.decodedText });
|
||||||
handleInput(e.detail.decodedText);
|
handleInput(e.detail.decodedText);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user