pin reset
This commit is contained in:
parent
cf07341ebb
commit
422e3829fb
@ -66,7 +66,7 @@
|
||||
<h4>PIN</h4>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-row>
|
||||
<ion-col text-center>
|
||||
<mat-form-field>
|
||||
<input matInput type="number"
|
||||
|
||||
@ -9,8 +9,9 @@ import { FingerprintAIO } from '@ionic-native/fingerprint-aio';
|
||||
import { AwsServiceProvider } from '../../providers/aws-service/aws-service';
|
||||
|
||||
import { LoadingProvider } from '../../providers/common-provider/loading';
|
||||
import { ConstantsProvider } from '../../providers/constants/constants';
|
||||
import { ConstantsProvider } from '../../providers/constants/constants';
|
||||
import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
||||
import { LoginPage } from '../login/login';
|
||||
/**
|
||||
* Generated class for the AuthPage page.
|
||||
*
|
||||
@ -28,11 +29,16 @@ export class AuthPage {
|
||||
pinAccess: any;
|
||||
newpindetails: any;
|
||||
userDetails: any;
|
||||
pin:any;
|
||||
|
||||
resetlogin:any;
|
||||
pinreset: Boolean=true;
|
||||
|
||||
pin:any;
|
||||
mpinaccess:boolean =false;
|
||||
newpassword:any;
|
||||
ConfirmPassword:any;
|
||||
isPinReset: boolean;
|
||||
resetpin:boolean;
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,public Menu:MenuController,public fb:FormBuilder,public shared:CognitoServiceProvider,public toast:ToastProvider,public faio:FingerprintAIO,public aws:AwsServiceProvider,public loadingCtrl:LoadingProvider,public commonconstant:ConstantsProvider) {
|
||||
let pinLockImage = localStorage.getItem('pinLockImage')
|
||||
@ -66,15 +72,26 @@ pin:any;
|
||||
}
|
||||
getuserDetails()
|
||||
{
|
||||
this.loadingCtrl.pdloader('loading...');
|
||||
|
||||
|
||||
this.loadingCtrl.pdloader('loading...');
|
||||
let userid = this.aws.getlocale();
|
||||
this.aws.getuserprofile(userid).subscribe(res=>{
|
||||
this.userDetails = res;
|
||||
if(this.userDetails.dataStatus == true)
|
||||
{
|
||||
|
||||
this.loadingCtrl.loading.dismiss();
|
||||
this.userDetails = this.userDetails.records;
|
||||
|
||||
this.resetpin=this.navParams.get('resetpin');
|
||||
|
||||
if(this.resetpin==true)
|
||||
{
|
||||
|
||||
this.mpinaccess = true
|
||||
this.isPinReset = true
|
||||
return
|
||||
}
|
||||
//localStorage.setItem('userDetails',JSON.stringify(this.userDetails[0]));
|
||||
if(this.userDetails[0].mpin ==null)
|
||||
{
|
||||
@ -93,12 +110,23 @@ pin:any;
|
||||
|
||||
//console.log(this.mpinaccess);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(){
|
||||
|
||||
//this.mpinaccess = true
|
||||
// this.isPinReset = true
|
||||
|
||||
}
|
||||
|
||||
resetPin() {
|
||||
this.isPinReset = true
|
||||
this.mpinaccess = true
|
||||
|
||||
this.navCtrl.setRoot(LoginPage,{'resetlogin':this.pinreset});
|
||||
|
||||
}
|
||||
goBack() {
|
||||
|
||||
this.isPinReset = false
|
||||
this.mpinaccess = false
|
||||
}
|
||||
@ -135,11 +163,13 @@ pin:any;
|
||||
this.toast.lenderappmessage("Pin Reset Successfully")
|
||||
this.userDetails[0].mpin = newpin.value
|
||||
this.mpinaccess = false
|
||||
// alert('gotologinpage');
|
||||
// this.navCtrl.setRoot(LoginPage,{'resetlogin':this.pinreset});
|
||||
}
|
||||
else{
|
||||
let role=this.commonconstant.takeDecisionRouting(this.userDetails[0])
|
||||
if(role == 'sales'){
|
||||
this.navCtrl.setRoot(SalesPDlistPage);
|
||||
this.navCtrl.setRoot(SalesPDlistPage,{'userDetails':this.userDetails});
|
||||
}
|
||||
else{
|
||||
this.navCtrl.setRoot(PdListPage,{'userDetails':this.userDetails});
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let person of sales_and_credit_person.sales_person" [value]="person.userid">{{person.user_name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Lender Credit Person" formControlName="lender_credit_person">
|
||||
<mat-option>Select</mat-option>
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
</mat-form-field>
|
||||
<ion-row>
|
||||
<ion-col text-center>
|
||||
<button color="primary" mat-raised-button>SIGN IN</button><br/>
|
||||
<button color="primary" mat-raised-button>SIGN IN</button><br/>
|
||||
<br/></ion-col>
|
||||
</ion-row>
|
||||
<!-- <div (click)="fingerprint()" style="font-size:20px;"><ion-icon name="md-finger-print"></ion-icon></div> -->
|
||||
|
||||
@ -22,6 +22,7 @@ import { ConstantsProvider } from '../../providers/constants/constants';
|
||||
import { SalesPDlistPage } from '../sales_pd/pages/sales-p-dlist/sales-p-dlist';
|
||||
import { PdtriggerProvider } from '../../providers/pdtrigger/pdtrigger';
|
||||
import { SalesPdProvider } from '../sales_pd/providers/sales-pd/sales-pd';
|
||||
import { AuthPage } from '../auth/auth';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -50,12 +51,14 @@ config: MatDialogConfig = {
|
||||
};
|
||||
userDetails: any;
|
||||
commonDetails: any;
|
||||
constructor( public aws: AwsServiceProvider, public dialog: MatDialog,
|
||||
forgetpin: boolean = false;
|
||||
constructor( public aws: AwsServiceProvider, public dialog: MatDialog, public navParams: NavParams,
|
||||
public shared:CognitoServiceProvider,public navCtrl:NavController,public Menu:MenuController
|
||||
,public toast:ToastProvider,public load:LoadingController,private events:Events,private constantProvider:ConstantsProvider,private pdtrigger:PdtriggerProvider,private salesPDProvider:SalesPdProvider) {
|
||||
|
||||
}
|
||||
ngOnInit(){
|
||||
|
||||
//this.loggedInCheck();
|
||||
|
||||
}
|
||||
@ -77,8 +80,9 @@ presentLoading() {
|
||||
dismissOnPageChange: true
|
||||
}).present();
|
||||
}
|
||||
login() {
|
||||
// console.log(this.email);
|
||||
login()
|
||||
{
|
||||
|
||||
if(this.email !==undefined && this.password !==undefined && this.email !='' && this.password !='' && this.email !=null && this.password !=null ){
|
||||
let auth = { 'Username': this.email, 'Password': this.password };
|
||||
|
||||
@ -92,7 +96,7 @@ login() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}, err => {
|
||||
console.log(JSON.stringify(err.message));
|
||||
@ -139,7 +143,12 @@ getlenderpddetails()
|
||||
localStorage.setItem("user_details",JSON.stringify( this.userDetails));
|
||||
this.events.publish(('len_user_name'),this.userDetails);
|
||||
let role= this.constantProvider.takeDecisionRouting(this.userDetails)
|
||||
if(role == 'sales'){
|
||||
this.forgetpin=this.navParams.get('resetlogin');
|
||||
if( this.forgetpin==true)
|
||||
{
|
||||
this.navCtrl.setRoot(AuthPage,{'resetpin':this.forgetpin});
|
||||
}
|
||||
else if(role == 'sales'){
|
||||
this.pdtrigger.initiateMasterApis('sales')
|
||||
this.navCtrl.setRoot(SalesPDlistPage);
|
||||
|
||||
@ -181,10 +190,10 @@ forgotopen() {
|
||||
|
||||
|
||||
forgotpassword() {
|
||||
|
||||
alert('rets');
|
||||
let auth = { 'Username': this.email };
|
||||
console.log(auth);
|
||||
this.aws.userforgotpass(auth).subscribe(res => {
|
||||
this.aws.userforgotpass(auth).subscribe(res => {
|
||||
|
||||
|
||||
})
|
||||
|
||||
@ -60,7 +60,7 @@ export class PasswordPage {
|
||||
let userid = this.aws.getlocale();
|
||||
this.aws.getuserprofile(userid).subscribe(res=>
|
||||
{
|
||||
this.userDetails = res;
|
||||
this.userDetails = res;
|
||||
if(this.userDetails.dataStatus == true){
|
||||
this.userDetails = this.userDetails.records[0];
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div *ngIf="parent_ques.get('is_repeatable').value != '1'">
|
||||
|
||||
<mat-form-field style="width: 100%" *ngIf="parent_ques.get('type').value == '1'" [ngStyle]="{'margin-bottom':parent_ques.get('field_type').value == 'numtoword' ? '5%' : '0' }">
|
||||
|
||||
|
||||
<mat-label>{{parent_ques.get('question').value}}</mat-label>
|
||||
<input matInput [type]="parent_ques.get('field_type').value == 'num' || parent_ques.get('field_type').value == 'numtoword' ? 'number' : parent_ques.get('field_type').value == 'string' ? 'text' : parent_ques.get('field_type').value" formControlName="answer_value"
|
||||
[placeholder]="parent_ques.value.hasOwnProperty('place_holder') ? parent_ques.get('place_holder').value : ''"
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
<ion-navbar color="optblue">
|
||||
<button ion-button menuToggle>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title>{{question_data.section_name}}</ion-title>
|
||||
<!-- <ion-buttons end>
|
||||
|
||||
@ -307,6 +307,7 @@ export class SectionListPage {
|
||||
|
||||
}
|
||||
goto(section_id){
|
||||
alert(section_id);
|
||||
// this.SalesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj.sales_pd_id).then(()=>{
|
||||
// localStorage.setItem('product_id_salesPD',value_obj.product_id)
|
||||
if(this.sales_pd_id == null && section_id != '1'){
|
||||
|
||||
@ -43,13 +43,13 @@ current_section:any;
|
||||
console.log(this.platform.is('cordova'))
|
||||
let api_properties = {method:'post', api_name:this.apiUrl+'loadSalesPDTemplate',params : params}
|
||||
if(!this.platform.is('cordova')) {
|
||||
// api_properties = {method:'get', api_name:`assets/data/sales_pd_templates/${product_id}.json`,params : params}
|
||||
api_properties = {method:'get', api_name:`assets/data/sales_pd_templates/${product_id}.json`,params : params}
|
||||
}
|
||||
return this.http[api_properties.method](api_properties.api_name,api_properties.params).subscribe(result=>{
|
||||
if(!this.platform.is('cordova') && !result.hasOwnProperty('dataStatus')) {
|
||||
result = {dataStatus:true,status:200,records:{template:JSON.stringify(result)}}
|
||||
}
|
||||
if(result['dataStatus']) {
|
||||
if(result['dataStatus']) {
|
||||
return this.ionicStorageProvider.checkAndInsertApiDataLocally(result,params,'loadSalesPDTemplate',true).then(res=>{
|
||||
observer.next(result)
|
||||
observer.complete();
|
||||
|
||||
@ -101,7 +101,8 @@ apiurl:any;
|
||||
});
|
||||
}
|
||||
userforgotpass(auth) {
|
||||
////(auth);
|
||||
////(auth);
|
||||
alert('test');
|
||||
const userData = {
|
||||
Username: auth.Username,
|
||||
Pool: lenderUserPool
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<script data-ionic="inject">
|
||||
(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='5.0.3';i.staticDir='build/';})(window);
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ionic App</title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user