Recipient
This commit is contained in:
+3
-1
@@ -68,4 +68,6 @@ $ ionic generate component contact/form
|
||||
$ ionic generate component login-form --change-detection=OnPush
|
||||
$ ionic generate directive ripple --skip-import
|
||||
$ ionic generate service user-wallet
|
||||
ionic generate service loc-trc
|
||||
ionic generate service loc-trc
|
||||
|
||||
ionic generate service recipients
|
||||
@@ -3,6 +3,7 @@ import {AlertController, NavController, ToastController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {RecipientsService} from "../../store/recipients.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-addbank',
|
||||
@@ -24,7 +25,8 @@ export class AddbankPage implements OnInit {
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private alertController: AlertController,
|
||||
private toastController: ToastController
|
||||
private toastController: ToastController,
|
||||
public recipientsService: RecipientsService
|
||||
)
|
||||
{
|
||||
|
||||
@@ -141,6 +143,7 @@ export class AddbankPage implements OnInit {
|
||||
if ( this.accountAddResult.internal_return != undefined && this.accountAddResult.internal_return > 0 ){
|
||||
this.presentToast("Recipient Accound Added",'middle');
|
||||
setTimeout(() => {
|
||||
this.recipientsService.getMyRecipientsData();
|
||||
this.onBack();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import {AlertController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {RecipientsService} from "../../store/recipients.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-redeem',
|
||||
@@ -55,7 +56,8 @@ wallet_uid
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private alertController: AlertController
|
||||
private alertController: AlertController,
|
||||
public recipientsService: RecipientsService
|
||||
) {
|
||||
this.walletData = this.router.getCurrentNavigation().extras.state;
|
||||
if ( this.walletData != undefined ){
|
||||
@@ -69,9 +71,12 @@ wallet_uid
|
||||
}
|
||||
}
|
||||
|
||||
myRecipientsData:any;
|
||||
ngOnInit() {
|
||||
this.getMyRecipientsData();
|
||||
this.myRecipientsData = this.recipientsService.getMyRecipientsData();
|
||||
this.getPaymentHxData();
|
||||
//this.getMyRecipientsData();
|
||||
this.myRecipientsData = this.recipientsService.myRecipientsData;
|
||||
}
|
||||
|
||||
onBack() {
|
||||
@@ -275,7 +280,7 @@ this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_
|
||||
}
|
||||
|
||||
myRecipientsTotalData:any;
|
||||
myRecipientsData:any;
|
||||
|
||||
getMyRecipientsData(){
|
||||
this.usrData = {action:11175,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RecipientsService } from './recipients.service';
|
||||
|
||||
describe('RecipientsService', () => {
|
||||
let service: RecipientsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(RecipientsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {WrenchService} from "../services/wrench.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RecipientsService {
|
||||
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService) { }
|
||||
|
||||
usrData: {
|
||||
action:number, member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
limit:20, page:1,
|
||||
offset: 0,
|
||||
amount: number
|
||||
};
|
||||
|
||||
myRecipientsTotalData:any;
|
||||
myRecipientsData:any;
|
||||
async getMyRecipientsData(){
|
||||
this.usrData = {action:11175,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
limit:20, page:1,
|
||||
offset: 0, amount: 0}
|
||||
|
||||
this.wrenchService.recipientAccount(this.usrData).subscribe(
|
||||
myRecipientsTotalData => {
|
||||
this.myRecipientsTotalData = myRecipientsTotalData;
|
||||
console.log("myRecipientsTotalData RETURN->", this.myRecipientsTotalData);
|
||||
this.myRecipientsData = this.myRecipientsTotalData.result_list;
|
||||
console.log("myRecipientsData RETURN DATA->", this.myRecipientsData);
|
||||
return this.myRecipientsData;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user