add bank account
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<ion-col>
|
||||
<ion-select placeholder="Select Bank" [(ngModel)]='sel_bank' size="block">
|
||||
<!-- <ion-select-option value="" >Select Recipient</ion-select-option>-->
|
||||
<ion-select-option value="{{item.bank_uid}}" *ngFor="let item of countryBanksData">{{item.name}} - ({{item.code}})</ion-select-option>
|
||||
<ion-select-option value="{{item.code}}" *ngFor="let item of countryBanksData">{{item.name}} - ({{item.code}})</ion-select-option>
|
||||
</ion-select>
|
||||
<!-- <ion-label>{{recipient_name}}</ion-label>-->
|
||||
</ion-col>
|
||||
@@ -46,13 +46,13 @@
|
||||
<ion-row>
|
||||
<ion-col class="intr">Account No </ion-col>
|
||||
<ion-col>
|
||||
<ion-input (ionChange)="refreshFee()" type="number" label="Amount(ggg)" placeholder="Enter Account No" [(ngModel)]='amount'></ion-input>
|
||||
<ion-input (ionChange)="refreshAccNo()" type="number" label="Amount(ggg)" placeholder="Enter Account No" [(ngModel)]='account_no'></ion-input>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col class="intr">Confirm Acc </ion-col>
|
||||
<ion-col>
|
||||
<ion-input (ionChange)="refreshFee()" type="number" label="Amount(ggg)" placeholder="Confirm No" [(ngModel)]='amount'></ion-input>
|
||||
<ion-input (ionChange)="refreshAccNo()" type="number" label="Amount(ggg)" placeholder="Confirm No" [(ngModel)]='confirm_account_no'></ion-input>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -62,7 +62,10 @@
|
||||
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-button expand="block" shape="round" color="secondary" (click)="contineAdd()">Add Account</ion-button>
|
||||
<ion-button expand="block" shape="round" color="secondary"
|
||||
(click)="addRecipientAccount()"
|
||||
[disabled]="isDisabled"
|
||||
>Add Account</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {AlertController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
@@ -11,11 +11,19 @@ import {WrenchService} from "../../services/wrench.service";
|
||||
})
|
||||
export class AddbankPage implements OnInit {
|
||||
|
||||
constructor( private navctr: NavController,
|
||||
@ViewChild('acc_type') acc_type;
|
||||
@ViewChild('sel_bank') sel_bank;
|
||||
@ViewChild('account_no') account_no;
|
||||
@ViewChild('confirm_account_no') confirm_account_no;
|
||||
isDisabled:boolean = true;
|
||||
constructor( private navctr: NavController,
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private alertController: AlertController) { }
|
||||
private alertController: AlertController) {
|
||||
|
||||
this.isDisabled = true;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getcountryBanksData();
|
||||
@@ -24,15 +32,23 @@ export class AddbankPage implements OnInit {
|
||||
onBack() {
|
||||
this.navctr.back();
|
||||
}
|
||||
contineAdd(){
|
||||
|
||||
}
|
||||
//
|
||||
refreshAccNo(){
|
||||
console.log("ACCCC -> " , String(this.account_no).length, this.confirm_account_no, this.confirm_account_no );
|
||||
this.isDisabled = true;
|
||||
if(String(this.account_no).length >6 && this.confirm_account_no === this.account_no){
|
||||
this.isDisabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
countryBanksResult:any;
|
||||
countryBanksData: [];
|
||||
countryBanksData: any;
|
||||
usrData: {
|
||||
action:number, member_id: number, uid: string, sessionid: string, limit:20, page:1
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
limit:20, page:1
|
||||
};
|
||||
getcountryBanksData(){
|
||||
this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session, limit:20, page:1 }
|
||||
@@ -63,4 +79,54 @@ export class AddbankPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
reqData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
firstname: string,
|
||||
lastname: string,
|
||||
bank_code: string,
|
||||
account_no: string,
|
||||
account_type: number,
|
||||
country: string,
|
||||
state: string,
|
||||
city: string,
|
||||
};
|
||||
|
||||
addRecipientAccount(){
|
||||
|
||||
this.reqData = {
|
||||
action:11176,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
firstname: this.sessionDataProviderService.firstname,
|
||||
lastname: this.sessionDataProviderService.lastname,
|
||||
bank_code: this.sel_bank,
|
||||
account_no: this.account_no,
|
||||
account_type: this.acc_type,
|
||||
country: this.sessionDataProviderService.account_country,
|
||||
state: this.sessionDataProviderService.account_state,
|
||||
city: this.sessionDataProviderService.city,
|
||||
};
|
||||
|
||||
|
||||
|
||||
this.wrenchService.addRecipientAccount(this.reqData).subscribe(
|
||||
accountTypesResult => {
|
||||
this.accountTypesResult = accountTypesResult;
|
||||
console.log("accountTypes RETURN->", this.accountTypesResult);
|
||||
this.accountTypesData = this.accountTypesResult.result_list;
|
||||
// debugger;
|
||||
console.log("accountTypes RETURN DATA->", this.accountTypesData);
|
||||
}
|
||||
);
|
||||
|
||||
// return this.getPostData("addrecipient", reqData);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -159,7 +159,10 @@ export class WrenchService {
|
||||
return this.getPostData("activetaskslist", usrData);
|
||||
}
|
||||
|
||||
//
|
||||
addRecipientAccount(reqData){
|
||||
return this.getPostData("addrecipient", reqData);
|
||||
}
|
||||
|
||||
accountTypes(reqData){
|
||||
return this.getPostData("accounttypes", reqData);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ export class SessionDataProviderService {
|
||||
"zip_code": "30127",
|
||||
"internal_return": 100
|
||||
*/
|
||||
account_country:string="NG";
|
||||
account_type:string="";
|
||||
email: string = "";
|
||||
firstname: string = "";
|
||||
@@ -67,6 +68,7 @@ export class SessionDataProviderService {
|
||||
member_uid:string;
|
||||
user_state:string;
|
||||
city:string;
|
||||
account_state:string;
|
||||
online_name:string;
|
||||
pref_email:number=0;
|
||||
pref_phone:number=0;
|
||||
|
||||
Reference in New Issue
Block a user