This commit is contained in:
CHIEFSOFT\ameye
2023-12-06 11:54:16 -05:00
parent 43af4cccf4
commit 60d381a483
4 changed files with 78 additions and 7 deletions
+21 -2
View File
@@ -63,8 +63,27 @@
<ion-label>Invite from Contacts</ion-label>
</ion-item>
<div class="ion-padding" slot="content" style="background-color: white; padding: 5px">
<div style="margin-top: 10px; background-color: aliceblue; min-height: 150px;">
<ion-button (click)="refreshContacts()">Refresh Contacts</ion-button>
<div style="margin-top: 10px; background-color: aliceblue; min-height: 150px; border-radius: 10px;">
<ion-grid>
<ion-row style="padding: 0px; margin: 0px;">
<ion-col style="padding: 0px; margin: 0px;">
<ion-searchbar animated="true" placeholder="Search Contacts" style="margin: 0px;"></ion-searchbar>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div style="padding: 0px 10px 0px 10px;">
<ion-button (click)="refreshContacts()"
shape="round"
expand="block"
size="small">Refresh Contacts</ion-button>
</div>
+15 -4
View File
@@ -1,5 +1,5 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {NavController} from "@ionic/angular";
import {LoadingController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import { WrenchService } from 'src/app/services/wrench.service';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
@@ -25,7 +25,8 @@ export class InvitePage implements OnInit {
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService,
private alertController: AlertController,
private contactsDataService:ContactsDataService
private contactsDataService:ContactsDataService,
private loadingCtrl: LoadingController,
) {
}
/*
@@ -41,7 +42,11 @@ export class InvitePage implements OnInit {
action:number, member_id: number, uid: string, sessionid: string, ref_firstname:string, ref_lastname:string,ref_email: string
};
sendReferResult:any;
sendRefer(){
async sendRefer(){
const loading = await this.loadingCtrl.create({
message: 'Sending ... ',
duration: 3500,
});
if (this.ref_firstname=="" || this.lastname=="" || !this.validateEmail(this.email) ){
this.showAlert('Refer Error', 'Email and names required');
@@ -57,8 +62,10 @@ export class InvitePage implements OnInit {
ref_lastname:this.lastname,
ref_email:this.email
};
loading.present();
this.wrenchService.sendRefer(this.referSendData).subscribe(
sendReferResult => {
loading.dismiss();
this.sendReferResult = sendReferResult;
if ( this.sendReferResult.internal_return == 0 ){
this.showAlert('Refer Sent', 'Message sent to '+ this.email);
@@ -130,7 +137,11 @@ export class InvitePage implements OnInit {
// alert.present();
// // alert(amessage);
}
refreshContacts(){
async refreshContacts(){
const loading = await this.loadingCtrl.create({
message: 'Please wait ... ',
duration: 3500,
});
this.contactsDataService.refeshContacts();
}
}