sign up
This commit is contained in:
@@ -16,11 +16,7 @@
|
||||
<ion-item lines="none">
|
||||
<ion-select (ionChange)="verReg()" label="Select Country" placeholder="Select Country" [(ngModel)]='country'>
|
||||
<ion-select-option *ngFor="let item of signupCountry" value="{{item.code}}">{{item.country}}</ion-select-option>
|
||||
<!-- <ion-select-option value="NG">Nigeria</ion-select-option>-->
|
||||
<!-- <ion-select-option value="US">United States</ion-select-option>-->
|
||||
</ion-select>
|
||||
<!-- <ion-label>Nigeria</ion-label>-->
|
||||
<!-- <ion-icon name="caret-down-outline"></ion-icon>-->
|
||||
</ion-item>
|
||||
|
||||
|
||||
@@ -46,11 +42,6 @@
|
||||
<ion-input (ionChange)="verReg()" type="password" placeholder="Password" maxlength="15" [(ngModel)]='password'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<!-- <ion-item lines="none">-->
|
||||
<!-- <ion-icon slot="start" name="lock-closed-outline"></ion-icon>-->
|
||||
<!-- <ion-input type="password" placeholder="Confirm Password"></ion-input>-->
|
||||
<!-- </ion-item>-->
|
||||
|
||||
<ion-button expand="block" [disabled]="isDisabled" (click)="onFillProfile()">
|
||||
Register
|
||||
</ion-button>
|
||||
@@ -100,18 +91,27 @@
|
||||
<ion-col size-md="9">{{signup_username}}</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
<ion-label class="or">Enter Confirmation Received In Email</ion-label>
|
||||
<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-item lines="none">
|
||||
<ion-icon slot="start" name="mail-outline"></ion-icon>
|
||||
<ion-input type="username" placeholder="Random text" maxlength="8" [(ngModel)]='random_text'></ion-input>
|
||||
<ion-input type="text"
|
||||
autocomplete="false"
|
||||
(ionChange)="verReg2()"
|
||||
placeholder="Random text"
|
||||
maxlength="8" [(ngModel)]='random_text'></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-icon slot="start" name="lock-closed-outline"></ion-icon>
|
||||
<ion-input type="password" placeholder="Password" maxlength="15" [(ngModel)]='password'></ion-input>
|
||||
<ion-input type="password" (ionChange)="verReg2()" placeholder="Password" maxlength="15" [(ngModel)]='password'></ion-input>
|
||||
</ion-item>
|
||||
<ion-button expand="block" (click)="onCompleteProfile()">
|
||||
Complete signup
|
||||
|
||||
<ion-button
|
||||
expand="block"
|
||||
[disabled]="isDisabled2"
|
||||
(click)="onCompleteProfile()">
|
||||
Complete Signup
|
||||
</ion-button>
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Router } from '@angular/router';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {ToastController} from "@ionic/angular";
|
||||
import {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";
|
||||
import { environment} from "../../../environments/environment";
|
||||
import {FamilyDataService} from "../../store/family-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-register',
|
||||
@@ -21,6 +22,7 @@ export class RegisterPage implements OnInit {
|
||||
@ViewChild('random_text') random_text;
|
||||
|
||||
isDisabled:boolean=true;
|
||||
isDisabled2:boolean=true;
|
||||
|
||||
pending_uid:string = '';
|
||||
signup_state:number = 1;
|
||||
@@ -55,6 +57,7 @@ export class RegisterPage implements OnInit {
|
||||
private router: Router,
|
||||
private toastController: ToastController,
|
||||
private navctr: NavController,
|
||||
private loadingCtrl: LoadingController,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService
|
||||
) {
|
||||
@@ -104,7 +107,19 @@ export class RegisterPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
onFillProfile() {
|
||||
|
||||
verReg2(){
|
||||
this.isDisabled2= true;
|
||||
if (this.password != null && this.password != '' && this.password.length> 6
|
||||
&& this.random_text != null && this.random_text != '' && this.random_text.length>4
|
||||
) {
|
||||
this.isDisabled2= false;
|
||||
}else{
|
||||
this.isDisabled2=true;
|
||||
}
|
||||
}
|
||||
|
||||
async onFillProfile() {
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false
|
||||
|| this.password == null || this.password == ''
|
||||
|| this.firstname == null || this.firstname == ''
|
||||
@@ -114,6 +129,10 @@ export class RegisterPage implements OnInit {
|
||||
this.presentToast('Missing Required Inputs', 'middle');
|
||||
return;
|
||||
}
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Registering...',
|
||||
duration: 7500,
|
||||
});
|
||||
|
||||
this.signupData= {
|
||||
action:11010,
|
||||
@@ -128,9 +147,10 @@ export class RegisterPage implements OnInit {
|
||||
sessionid: "SSSSS-SSSSSS-SSSSSS"
|
||||
};
|
||||
this.pending_uid = "";
|
||||
|
||||
loading.present();
|
||||
this.wrenchService.createUser(this.signupData).subscribe(
|
||||
signUpResult => {
|
||||
loading.dismiss();
|
||||
this.signUpResult = signUpResult;
|
||||
console.log("signUpResult RETURN->", this.signUpResult);
|
||||
|
||||
@@ -140,39 +160,9 @@ export class RegisterPage implements OnInit {
|
||||
this.signup_username = this.signUpResult.username;
|
||||
this.random_text = '';
|
||||
this.signup_state =2;
|
||||
|
||||
/*
|
||||
{
|
||||
"action": "11010",
|
||||
"added": "2023-08-22 19:28:05.991937",
|
||||
"country": "NG",
|
||||
"email": "ses66181+x1234@gmail.com",
|
||||
"expire": "2023-09-21 19:28:05.991937",
|
||||
"firstname": "Olu",
|
||||
"id": "610",
|
||||
"lastname": "Ameye",
|
||||
"loc": "10.10.33.15",
|
||||
"mobile": "MOBILE",
|
||||
"news": "1",
|
||||
"password": "d0fbea2563b377ea7074bced45c88dcb",
|
||||
"pending_id": "610",
|
||||
"phone": "",
|
||||
"pid": "100",
|
||||
"sessionid": "SSSSS-SSSSSS-SSSSSS",
|
||||
"signup_random": "13635",
|
||||
"status": "1",
|
||||
"street1": "",
|
||||
"terms": "1",
|
||||
"uid": "07529070-79a6-4e34-835d-a3a50283e93d",
|
||||
"username": "ses66181+x1234@gmail.com",
|
||||
"verify_link": "WRENCHB-1176229640-1742094704-417159648",
|
||||
"zipcode": "",
|
||||
"internal_return": 610
|
||||
}
|
||||
*/
|
||||
}
|
||||
else {
|
||||
this.presentToast('Unable to continue with this params', 'middle');
|
||||
this.presentToast('Unable to continue with this parameters', 'middle');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user