kIDS LOGIN
@@ -25,7 +25,7 @@
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="start" name="lock-closed-outline"></ion-icon>
|
||||
<ion-input type="password" placeholder="PIN" [(ngModel)]='password'></ion-input>
|
||||
<ion-input type="password" placeholder="PIN" [(ngModel)]='pin'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<div class="check">
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Router} from "@angular/router";
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-familylogin',
|
||||
@@ -7,12 +10,87 @@ import {Router} from "@angular/router";
|
||||
styleUrls: ['./familylogin.page.scss'],
|
||||
})
|
||||
export class FamilyloginPage implements OnInit {
|
||||
//Y7P0WW9B05
|
||||
// 1234
|
||||
|
||||
constructor( private router: Router) { }
|
||||
@ViewChild('username') username;
|
||||
@ViewChild('pin') pin;
|
||||
loginResult: any;
|
||||
blogResult:any;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private wrenchService: WrenchService,
|
||||
public sessionDataProviderService:SessionDataProviderService,
|
||||
public blogDataService:BlogDataService
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
/*
|
||||
action
|
||||
:
|
||||
11025
|
||||
login_mode
|
||||
:
|
||||
1105
|
||||
pin
|
||||
:
|
||||
"1234"
|
||||
sessionid
|
||||
:
|
||||
"20067A92714"
|
||||
username
|
||||
:
|
||||
"Y7P0WW9B05"
|
||||
*/
|
||||
|
||||
loginData: {
|
||||
username: string, pin: string, sessionid: string, action: '11025',login_mode: '1105'
|
||||
};
|
||||
startLogin() {
|
||||
this.username='Y7P0WW9B05';
|
||||
this.pin='1234';
|
||||
if (this.username == null || this.username == '' || this.pin == null || this.pin == '') {
|
||||
this.showAlert('Invalid Login', 'Enter username(email) and pin to login');
|
||||
return;
|
||||
}
|
||||
this.loginData = { username: this.username, pin: this.pin, sessionid: 'DUMMY-APP-SESSION-STARTER', action: '11025',login_mode: '1105' }
|
||||
this.wrenchService.loginUser(this.loginData).subscribe(
|
||||
loginResult => {
|
||||
this.loginResult = loginResult;
|
||||
console.log("INTERNAL RETURN->" + this.loginResult.internal_return);
|
||||
if (loginResult != null && loginResult.internal_return == 100 && this.sessionDataProviderService.ConstructGlobalSessionData(this.loginResult) == true) {
|
||||
this.getBlogData();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
showAlert(mtitle: string, amessage: string) {
|
||||
/* let alert = this.alertCtrl.create({
|
||||
title: mtitle,
|
||||
subTitle: amessage,
|
||||
buttons: ['OK']
|
||||
});
|
||||
alert.present();*/
|
||||
alert(amessage);
|
||||
}
|
||||
|
||||
getBlogData(){
|
||||
this.wrenchService.getBlogData().subscribe(
|
||||
blogResult => {
|
||||
this.blogResult = blogResult;
|
||||
console.log("BLOG RETURN->", this.blogResult);
|
||||
this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
userLogin(){
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 14 KiB |