# Conflicts:
#	Mohem/package.json
production
haroon amjad 6 years ago
commit 8b6259723f

@ -99,6 +99,9 @@
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" /> <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" /> <plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" /> <plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>
<engine name="browser" spec="5.0.4" /> <engine name="browser" spec="5.0.4" />
<engine name="android" spec="7.1.4" /> <engine name="android" spec="7.1.4" />
<engine name="ios" spec="4.5.5" /> <engine name="ios" spec="4.5.5" />

@ -790,11 +790,18 @@
} }
}, },
"@ionic-native/barcode-scanner": { "@ionic-native/barcode-scanner": {
"version": "5.8.0", "version": "5.14.0",
"resolved": "https://registry.npmjs.org/@ionic-native/barcode-scanner/-/barcode-scanner-5.8.0.tgz", "resolved": "https://registry.npmjs.org/@ionic-native/barcode-scanner/-/barcode-scanner-5.14.0.tgz",
"integrity": "sha512-fypCb/8MikdTPaUl+oAtK+abrdgWnsYk3FtN3HPcNU4VB53QtBrx4LFC0l9xXD9rW8S7S0Xr2uHogtzhbh1bdg==", "integrity": "sha512-FwTHQD5TUaR441V76IoXQmrSdz7AZ/qBfrfh/rDaXWgYHg7iJA3prOlBPCW+YGfLV3qvlRJeq/ASub/JkTBDrg==",
"requires": { "requires": {
"@types/cordova": "^0.0.34" "@types/cordova": "^0.0.34"
},
"dependencies": {
"@types/cordova": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
}
} }
}, },
"@ionic-native/ble": { "@ionic-native/ble": {
@ -1454,9 +1461,7 @@
"abbrev": { "abbrev": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
"dev": true,
"optional": true
}, },
"accepts": { "accepts": {
"version": "1.3.7", "version": "1.3.7",
@ -7435,8 +7440,7 @@
"interpret": { "interpret": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw=="
"dev": true
}, },
"invariant": { "invariant": {
"version": "2.2.4", "version": "2.2.4",
@ -9566,8 +9570,7 @@
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
"dev": true
}, },
"os-locale": { "os-locale": {
"version": "1.4.0", "version": "1.4.0",
@ -9582,14 +9585,12 @@
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
"dev": true
}, },
"osenv": { "osenv": {
"version": "0.1.5", "version": "0.1.5",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true,
"requires": { "requires": {
"os-homedir": "^1.0.0", "os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0" "os-tmpdir": "^1.0.0"
@ -9907,8 +9908,7 @@
"path-parse": { "path-parse": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
"dev": true
}, },
"path-to-regexp": { "path-to-regexp": {
"version": "0.1.7", "version": "0.1.7",
@ -9958,6 +9958,26 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true "dev": true
}, },
"phonegap-plugin-barcodescanner": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/phonegap-plugin-barcodescanner/-/phonegap-plugin-barcodescanner-8.1.0.tgz",
"integrity": "sha512-WQCDCoH9EQ9WEn2bce+B95jbNJduilAn2Vtske8KfcYAeGu7bdFqRD7zGCLCQao62VwoEwlX0cUvbQ/am12Jwg==",
"requires": {
"nopt": "^4.0.1",
"shelljs": "^0.8.3"
},
"dependencies": {
"nopt": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"requires": {
"abbrev": "1",
"osenv": "^0.1.4"
}
}
}
},
"phonegap-plugin-multidex": { "phonegap-plugin-multidex": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/phonegap-plugin-multidex/-/phonegap-plugin-multidex-1.0.0.tgz", "resolved": "https://registry.npmjs.org/phonegap-plugin-multidex/-/phonegap-plugin-multidex-1.0.0.tgz",
@ -10539,7 +10559,6 @@
"version": "0.6.2", "version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"dev": true,
"requires": { "requires": {
"resolve": "^1.1.6" "resolve": "^1.1.6"
} }
@ -10724,7 +10743,6 @@
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
"integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
"dev": true,
"requires": { "requires": {
"path-parse": "^1.0.6" "path-parse": "^1.0.6"
} }
@ -11184,7 +11202,6 @@
"version": "0.8.3", "version": "0.8.3",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz",
"integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==",
"dev": true,
"requires": { "requires": {
"glob": "^7.0.0", "glob": "^7.0.0",
"interpret": "^1.0.0", "interpret": "^1.0.0",

@ -26,7 +26,7 @@
"@ionic-native/app-rate": "^5.8.0", "@ionic-native/app-rate": "^5.8.0",
"@ionic-native/background-geolocation": "^5.4.0", "@ionic-native/background-geolocation": "^5.4.0",
"@ionic-native/badge": "^5.8.0", "@ionic-native/badge": "^5.8.0",
"@ionic-native/barcode-scanner": "^5.8.0", "@ionic-native/barcode-scanner": "^5.14.0",
"@ionic-native/ble": "^5.8.0", "@ionic-native/ble": "^5.8.0",
"@ionic-native/call-number": "^5.8.0", "@ionic-native/call-number": "^5.8.0",
"@ionic-native/camera": "^5.8.0", "@ionic-native/camera": "^5.8.0",
@ -83,6 +83,7 @@
"mx.ferreyra.callnumber": "0.0.2", "mx.ferreyra.callnumber": "0.0.2",
"ng2-file-upload": "^1.3.0", "ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2", "ng2-pdf-viewer": "^5.3.2",
"phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-multidex": "^1.0.0", "phonegap-plugin-multidex": "^1.0.0",
"primeicons": "^1.0.0", "primeicons": "^1.0.0",
"primeng": "^7.1.3", "primeng": "^7.1.3",
@ -141,7 +142,10 @@
"call-number": {}, "call-number": {},
"cordova-sms-plugin": {}, "cordova-sms-plugin": {},
"cordova-plugin-datepicker": {}, "cordova-plugin-datepicker": {},
"cordova-plugin-geolocation": {} "cordova-plugin-geolocation": {},
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
}, },
"platforms": [ "platforms": [
"browser", "browser",

@ -5,6 +5,7 @@ import { Routes, RouterModule } from '@angular/router';
import { HmgCommonModule } from '../hmg-common/hmg-common.module'; import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { HomePage } from './home.page'; import { HomePage } from './home.page';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
const routes: Routes = [ const routes: Routes = [
{ {
@ -23,6 +24,9 @@ const routes: Routes = [
], ],
declarations: [ declarations: [
HomePage HomePage
],
providers:[
BarcodeScanner
] ]
}) })
export class HomePageModule { } export class HomePageModule { }

@ -9,6 +9,7 @@ import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-respo
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { Geolocation } from "@ionic-native/geolocation/ngx"; import { Geolocation } from "@ionic-native/geolocation/ngx";
import { ZBar, ZBarOptions } from "@ionic-native/zbar/ngx"; import { ZBar, ZBarOptions } from "@ionic-native/zbar/ngx";
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { Device } from "@ionic-native/device/ngx"; import { Device } from "@ionic-native/device/ngx";
import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request"; import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request";
import { Response } from "src/app/hmg-common/services/models/response"; import { Response } from "src/app/hmg-common/services/models/response";
@ -41,7 +42,8 @@ export class HomePage implements OnInit {
private zbar: ZBar, private zbar: ZBar,
private geolocation: Geolocation, private geolocation: Geolocation,
private attendance_service: AttendanceService, private attendance_service: AttendanceService,
private eitService: EitService private eitService: EitService,
private barcodeScanner: BarcodeScanner
) { } ) { }
ngOnInit() { ngOnInit() {
@ -225,10 +227,10 @@ export class HomePage implements OnInit {
this.common.openChangePassword(); this.common.openChangePassword();
} }
private attendance() { private attendance() {
this.zbarOptions = { // this.zbarOptions = {
flash: "off", // flash: "off",
drawSight: false // drawSight: false
}; // };
//console.log("your currnt location is"); //console.log("your currnt location is");
//console.log("Loc"); //console.log("Loc");
@ -236,26 +238,37 @@ export class HomePage implements OnInit {
} }
scanCode() { scanCode() {
this.zbar // this.zbar
.scan(this.zbarOptions) // .scan(this.zbarOptions)
.then(result => { // .then(result => {
console.log(result); // Scanned code // console.log(result); // Scanned code
let strResult = JSON.parse(result); // let strResult = JSON.parse(result);
console.log(strResult.QRValue); // console.log(strResult.QRValue);
this.scannedResult = result; // this.scannedResult = result;
// this.deviceID = this.device.uuid;
// this.swipeAttendance();
// })
// .catch(error => {
// alert(error); // Error message
// });
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
// let strResult = JSON.parse(barcodeData);
// console.log(strResult.QRValue);
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid; this.deviceID = this.device.uuid;
this.swipeAttendance(); this.swipeAttendance();
}) }).catch(err => {
.catch(error => { console.log('Error', err);
alert(error); // Error message });
});
} }
swipeAttendance() { swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat; request.Latitude = this.lat;
request.Longitude = this.longt; request.Longitude = this.longt;
request.QRValue = this.scannedResult; request.QRValue = this.scannedResult.text;
request.UID = this.deviceID; request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER; request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request"); console.log("request");

Loading…
Cancel
Save