Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
scanQrCode() {
BarcodeScanner.scan().then((barcodeData) => {
let toast = this.toastCtrl.create({
message: "Processing QR Code",
duration: 1000
});
toast.present();
this.attendeesService.checkInOut(this.event.id, barcodeData.text, true).subscribe(
attendeeResult => {
let toast = this.toastCtrl.create({
message: attendeeResult.lastname + ", " + attendeeResult.firstname + " has been checked in.",
duration: 500
});
toast.present();
},
err => {
console.log(err);
let toast = this.toastCtrl.create({
public scanQrCode() {
BarcodeScanner.scan().then((barcodeData) => {
const identifier = barcodeData.text.replace("/", "-");
if (this.qrRe.test(identifier)) {
var orderIdentifier: string = identifier.substr(0, 36);
var attendeeId: number = +identifier.substring(37);
for (let attendee of this.attendees) {
if (orderIdentifier == attendee.order.identifier && attendeeId == attendee.id) {
if (attendee.checked_in) {
this.presentToastCtrl("Already Checked In!");
return;
}
let confirm = this.alertCtrl.create({
title: "Checking In",
subTitle: attendee.firstname + " " + attendee.lastname,
message: "Ticket: " + attendee.ticket.name,
buttons: [
{
.create((observer: Observer) => {
BarcodeScanner.scan()
.then((barcodeData) => {
if (!barcodeData.cancelled) {
observer.next(barcodeData.text);
}
observer.complete();
}, (err) => {
observer.error(err);
observer.complete();
});
});
}
loginForQR(){
BarcodeScanner.scan().then((barcodeData) => {
this.accesstoken=barcodeData.text;
this.login();
}, (err) => {
alert("调用本地相机失败!");
});
}
barcodescanner () : void {
BarcodeScanner.scan().then(
barcodeData => this.updateOutput(barcodeData),
error => this.updateOutput(error, true)
)
}