|
@@ -4,9 +4,8 @@ import { HTTP } from '@ionic-native/http/ngx';
|
|
import { from } from 'rxjs';
|
|
import { from } from 'rxjs';
|
|
import { finalize } from 'rxjs/operators';
|
|
import { finalize } from 'rxjs/operators';
|
|
import { Storage } from '@ionic/storage'
|
|
import { Storage } from '@ionic/storage'
|
|
-import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
|
|
|
-import { PhotoService, Photo } from '../../services/photo.service';
|
|
|
|
import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
|
|
+import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-drawTab',
|
|
selector: 'app-drawTab',
|
|
@@ -14,15 +13,13 @@ import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
styleUrls: ['drawTab.page.scss']
|
|
styleUrls: ['drawTab.page.scss']
|
|
})
|
|
})
|
|
export class drawTabPage {
|
|
export class drawTabPage {
|
|
- // public photos: Photo[] = [];
|
|
|
|
private currentCode: string
|
|
private currentCode: string
|
|
private ssfCode: string
|
|
private ssfCode: string
|
|
private access_token: string
|
|
private access_token: string
|
|
constructor(private nativeHttp: HTTP,
|
|
constructor(private nativeHttp: HTTP,
|
|
- // public photoService: PhotoService,
|
|
|
|
|
|
+ private barcodeScanner: BarcodeScanner,
|
|
private storage: Storage,
|
|
private storage: Storage,
|
|
private keyboard: Keyboard,
|
|
private keyboard: Keyboard,
|
|
- private camera: Camera,
|
|
|
|
private toastCtrl: ToastController) { }
|
|
private toastCtrl: ToastController) { }
|
|
|
|
|
|
@ViewChild('drawInput') drawInput;
|
|
@ViewChild('drawInput') drawInput;
|
|
@@ -53,22 +50,6 @@ export class drawTabPage {
|
|
|
|
|
|
console.log(this.keyboard)
|
|
console.log(this.keyboard)
|
|
}
|
|
}
|
|
- // takePicture() {
|
|
|
|
- // const options: CameraOptions = {
|
|
|
|
- // quality: 100,
|
|
|
|
- // destinationType: this.camera.DestinationType.DATA_URL,
|
|
|
|
- // encodingType: this.camera.EncodingType.JPEG,
|
|
|
|
- // mediaType: this.camera.MediaType.PICTURE
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // this.camera.getPicture(options).then((imageData) => {
|
|
|
|
- // this.photos.unshift({
|
|
|
|
- // data: 'data:image/jpeg;base64,' + imageData
|
|
|
|
- // }); }, (err) => {
|
|
|
|
- // // Handle error
|
|
|
|
- // console.log("Camera issue: " + err);
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
// 获取扫描信息
|
|
// 获取扫描信息
|
|
async getInfo() {
|
|
async getInfo() {
|
|
// let loading = await this.loadingCtrl.create();
|
|
// let loading = await this.loadingCtrl.create();
|
|
@@ -91,4 +72,11 @@ export class drawTabPage {
|
|
await toast.present();
|
|
await toast.present();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ qrscan() {
|
|
|
|
+ this.barcodeScanner.scan().then(barcodeData => {
|
|
|
|
+ this.ssfCode = barcodeData.text
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log('Error', err);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|