regisyer page

This commit is contained in:
CHIEFSOFT\ameye
2023-12-31 15:43:56 -05:00
parent d37628eeaa
commit 38f545c176
2 changed files with 30 additions and 14 deletions
+4 -3
View File
@@ -34,7 +34,7 @@
<ion-item lines="none">
<ion-icon slot="start" name="mail-outline"></ion-icon>
<ion-input (ionChange)="verReg()" type="username" maxlength="35" placeholder="Email (your username)" [(ngModel)]='username'></ion-input>
<ion-input (ionChange)="verReg()" type="username" maxlength="35" placeholder="Email (Your Username)" [(ngModel)]='username'></ion-input>
</ion-item>
<ion-item lines="none">
@@ -91,8 +91,9 @@
<ion-col size-md="9">{{signup_username}}</ion-col>
</ion-row>
</ion-grid>
<ion-label class="or" style="width: 100%; background-color: lightseagreen; color: white; font-weight: bolder; height: 25px; margin: 5px;">Enter Confirmation Received In Email</ion-label>
<ion-label class="or" style="width: 100%;
background-color: #b220a2;
color: white; font-weight: bolder; height: 45px; margin: 5px; padding: 10px; border-radius: 10px;">Enter Confirmation Received In Email</ion-label>
<ion-item lines="none">
<ion-icon slot="start" name="mail-outline"></ion-icon>
<ion-input type="text"
+26 -11
View File
@@ -1,6 +1,6 @@
import { Router } from '@angular/router';
import {Component, OnInit, ViewChild} from '@angular/core';
import {LoadingController, ToastController} from "@ionic/angular";
import {AlertController, LoadingController, ToastController} from "@ionic/angular";
import {NavController} from "@ionic/angular";
import { WrenchService } from 'src/app/services/wrench.service';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
@@ -57,6 +57,7 @@ export class RegisterPage implements OnInit {
private router: Router,
private toastController: ToastController,
private navctr: NavController,
private alertController: AlertController,
private loadingCtrl: LoadingController,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService
@@ -168,7 +169,7 @@ export class RegisterPage implements OnInit {
);
}
completeSignupData: {
completeSignupData: {
action:11010,
username: string,
random_text: string,
@@ -178,7 +179,11 @@ export class RegisterPage implements OnInit {
sessionid: string
};
onCompleteProfile(){
async onCompleteProfile(){
const loading = await this.loadingCtrl.create({
message: 'Verifying...',
duration: 7500,
});
this.completeSignupData = {
action:11010,
username: this.signup_username,
@@ -188,30 +193,40 @@ export class RegisterPage implements OnInit {
mobile: "MOBILE",
sessionid: "ABOUT-TO_START"
};
console.log("COMPLETE SIGNUP ",this.completeSignupData);
loading.present();
this.wrenchService.completeMobileSignup(this.completeSignupData).subscribe(
signUpResult => {
loading.dismiss();
this.signUpResult = signUpResult;
if (signUpResult != null && signUpResult.internal_return == 100 && this.sessionDataProviderService.ConstructGlobalSessionData(this.signUpResult) == true) {
// this.getBlogData();
this.router.navigate(['tabs/tab1']);
if (signUpResult != null
&& signUpResult.internal_return == 100
&& this.sessionDataProviderService.ConstructGlobalSessionData(this.signUpResult) == true) {
this.router.navigate(['tabs/tab1']);
}
else{
this.signup_state =2; // maintain this
this.showAlert("Sign up error","Unable to complete the sign up, please try again");
}
}
);
}
showAlert(mtitle: string, amessage: string) {
async showAlert(mtitle: string, amessage: string) {
/* let alert = this.alertCtrl.create({
title: mtitle,
subTitle: amessage,
buttons: ['OK']
});
alert.present();*/
alert(amessage);
// alert(amessage);
const alert = await this.alertController.create({
header: 'WrenchBoard',
subHeader: mtitle,
message: amessage,
buttons: ['OK'],
});
await alert.present();
}
validateEmail(email) {
var re = /\S+@\S+\.\S+/;