class 使用 QRCODE 出席的步骤

Steps for class attendance by using QRCODE

我必须为我的最后一年项目使用 QRCODE 创建一个供 class 出勤的项目。

我的项目是这样的:

Students in the class will scan the QR CODE(using their own smartphone) that will be displayed by lecturers on the projector screen.

据我了解,Web 服务器会从智能手机的 IMEI 中获取秘密 ID 并保存在服务器数据库中。

其实我不知道如何入手,因为我不了解项目的框架。

我知道的事情是:

1) Develop a system using PHP and XAMPP that acts as a server.

2) Develop an app using Ionic Framework

3) Beginner in Java network programming.

你们能帮我弄清楚吗我该怎么办?或者帮助我逐步理解这个概念。我真的需要你的帮助。

提前谢谢你。

所以,如果我对你的理解正确的话,你想实现这个:

  1. 用户将打开 Ionic 应用程序并扫描二维码。
  2. 在此之后,Ionic 会将讲座 ID 和移动设备 IMEI 发送到您的 API。

这是可能的,而且很容易。你可以使用这个插件:

Ionic Native Barcode Scanner(支持二维码):

ionic cordova plugin add phonegap-plugin-barcodescanner
npm install --save @ionic-native/barcode-scanner

Ionic Native Uid(支持 IMEI 号码)

ionic cordova plugin add https://github.com/hygieiasoft/cordova-plugin-uid
npm install --save @ionic-native/uid

然后创建用于扫描二维码(并从二维码获取数据)并将数据发送到您的 api 的函数(使用来自二维码的数据和设备 IMEI 数据)。 像这样:

scanQrCode() {
    this.barcodeScanner.scan().then((data) => {
        console.log('scanned data from qr ' + data.text);
        let imei = this.getImei();
        this.sendDataToApi(data.text, imei);
    }, (err) => {
        console.log('scanning error');
    })
}

getImei() {
    // handle permissions
    return this.uid.imei;
}

您可以在此处找到有关插件的更多信息:

https://ionicframework.com/docs/native/barcode-scanner/ https://ionicframework.com/docs/native/uid/