diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index b60232e..2a59d02 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -3,98 +3,159 @@ -
-
+
+
+
- + -
- - - - - - - - - - +
+ + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - Login to continue - - - - + Login to continue + + + + - - - - + + + + -
- - Remember me -
- - - Login - - - Forgot your password ? - -
- Or Continue With -
- - - - - - - - - - - - - - - - - +
+ + Remember me
+ + + Login + + + Forgot your password ? + +
+ Or Continue With +
+ + + + + + + + + + + + + + + + + +
+
+
+
+ Don't have an account? Register +
-
- Don't have an account? Register -
+
+
+
+
+ + +
+ + Complete your signup + + + Country + {{signup_country}} + + + Username + {{signup_username}} + + + Enter Confirmation Received In Email + + + + + + + + + + + + + + + + + + + + + + + Complete Signup + + + + +
+ +
+ Have an account? Login +
+
+ +
diff --git a/src/app/pages/login/login.page.scss b/src/app/pages/login/login.page.scss index 0f67eeb..80c1523 100644 --- a/src/app/pages/login/login.page.scss +++ b/src/app/pages/login/login.page.scss @@ -3,6 +3,9 @@ ion-content { margin-bottom: 20px; } + .pending-buttom{ + padding-top: 25px; + } .simp_lbl { margin-top: 20px; font-size: 30px; diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3c85bcc..e1ab615 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -27,6 +27,11 @@ import { GoogleAuth, User } from '@codetrix-studio/capacitor-google-auth'; export class LoginPage implements OnInit { @ViewChild('username') username; @ViewChild('password') password; + + // @ViewChild('signup_username') signup_username; + @ViewChild('random_text') random_text; + @ViewChild('signup_password') signup_password; + loginResult: any; blogResult:any; showSocial:boolean = true; @@ -36,6 +41,11 @@ export class LoginPage implements OnInit { ios: boolean; android: boolean; isDisabled:boolean=true; + isPendingDisabled:boolean=true; + loginType:string='normal'; + pending_uid:string=''; + signup_country:string=''; + signup_username:string=''; constructor( private router: Router, @@ -125,7 +135,17 @@ getBlogData(){ this.router.navigate(['tabs/tab1']); } else{ - this.showAlert("Error","Invalid username/password"); + //debugger; + if (loginResult != null && loginResult.pending_uid != undefined){ + this.loginType='pending'; + this.pending_uid = loginResult.pending_uid; + this.signup_username = loginResult.username; + this.signup_country = loginResult.country; + } + else{ + this.showAlert("Error","Invalid username/password"); + } + // this.showAlert("Error","Invalid username/password"); } } ); @@ -143,6 +163,66 @@ getBlogData(){ this.router.navigate(['startscan']); } + //************************************************* + // Start Pending Account set up + //************************************************* + completeSignupData: { + action:11010, + username: string, + random_text: string, + password: string, + pending_uid:string, + mobile: string, + sessionid: string + }; + signUpResult:any; + onCompleteProfile(){ + this.completeSignupData = { + action:11010, + username: this.signup_username, + random_text: this.random_text, + password: this.signup_password, + pending_uid: this.pending_uid, + mobile: "MOBILE", + sessionid: "ABOUT-TO_START" + }; + console.log("COMPLETE SIGNUP ",this.completeSignupData); + + this.wrenchService.completeMobileSignup(this.completeSignupData).subscribe( + signUpResult => { + this.signUpResult = signUpResult; + if (signUpResult != null && signUpResult.internal_return == 100 && this.sessionDataProviderService.ConstructGlobalSessionData(this.signUpResult) == true) { + // this.getBlogData(); + this.router.navigate(['tabs/tab1']); + } + else{ + this.showAlert("Sign up error","Unable to complete the sign up, please try again"); + } + } + + ); + } + //************************************************* + // End Pending Account set up + //************************************************* + onReturnToLogin(){ + this.loginType='normal'; + } + + signupVerify(){ + this.isPendingDisabled = true; + if ( + this.signup_username != undefined + && this.signup_password !=undefined + && this.random_text != undefined + && String(this.signup_password).length > 7 + && String(this.signup_password).length < 15 + && String(this.random_text).length > 3 + && String(this.random_text).length < 10 + ){ + this.isPendingDisabled = false; + } + } onLoginGoogle() { GoogleAuth.signIn().then((user: User) => { //const credential = auth.GoogleAuthProvider.credential(user.authentication.idToken); @@ -177,7 +257,14 @@ getBlogData(){ this.router.navigate(['tabs/tab1']); } else{ - this.showAlert("Error","Invalid username/password"); + this.showAlert("Error","Invalid username/password"); + // debugger; + // if (loginResult != null && loginResult.pending_uid != undefined){ + // this.loginType='pending'; + // } + // else{ + // this.showAlert("Error","Invalid username/password"); + // } } } ); diff --git a/src/app/pages/register/register.page.html b/src/app/pages/register/register.page.html index e0e68db..9b025d5 100644 --- a/src/app/pages/register/register.page.html +++ b/src/app/pages/register/register.page.html @@ -97,12 +97,12 @@ Enter Confirmation Received In Email - + - + Complete signup diff --git a/src/app/pages/register/register.page.ts b/src/app/pages/register/register.page.ts index ee2fc58..37bebed 100644 --- a/src/app/pages/register/register.page.ts +++ b/src/app/pages/register/register.page.ts @@ -176,14 +176,11 @@ export class RegisterPage implements OnInit { this.router.navigate(['tabs/tab1']); } else{ - alert("SOME FAILURE"); + this.showAlert("Sign up error","Unable to complete the sign up, please try again"); } } ); - - // - // alert(100); } showAlert(mtitle: string, amessage: string) { /* let alert = this.alertCtrl.create({