new add relative

This commit is contained in:
CHIEFSOFT\ameye
2024-01-10 09:52:28 -05:00
parent 8d2c5485a2
commit bf3d991f69
8 changed files with 70 additions and 18 deletions
+2
View File
@@ -90,6 +90,8 @@ ionic generate interface interfaces/location
ionic generate interface interfaces/marker
ionic generate service commonfunc
ionic generate service interval-refresh
ionic generate service family-data
ionic generate service market-data
@@ -4,11 +4,14 @@
</div>
<div *ngIf="isModalOpenBackdrop==true">
<div style="background-color: aliceblue; border-radius: 10px; padding: 10px; margin-top: 10px;">
<ion-item lines="none">
<div class="head-title">Invite a Family</div>
</ion-item>
<ion-item lines="none">
<ion-input type="text"
maxlength="15"
placeholder="Firstname"
style="background-color: aliceblue; border-radius: 10px; padding-left: 1px;"
class="input-item"
(ionChange)="verifyEntry()"
[(ngModel)]='firstname' ></ion-input>
</ion-item>
@@ -16,17 +19,17 @@
<ion-item lines="none">
<ion-input type="text"
maxlength="15"
placeholder="lastname"
style="background-color: aliceblue; border-radius: 10px; padding-left: 1px;"
placeholder="Lastname"
class="input-item"
(ionChange)="verifyEntry()"
[(ngModel)]='lastname' ></ion-input>
</ion-item>
<ion-item lines="none">
<ion-input type="text"
maxlength="15"
maxlength="55"
placeholder="Email"
style="background-color: aliceblue; border-radius: 10px; padding-left: 1px;"
class="input-item"
(ionChange)="verifyEntry()"
[(ngModel)]='email' ></ion-input>
</ion-item>
@@ -0,0 +1,9 @@
.input-item{
background-color: #fbf9f4;
border-radius: 10px;
padding-left: 5px;
}
.head-title{
font-weight: bolder;
padding: 5px 0px 10px 0px;
}
@@ -2,6 +2,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
import {LoadingController} from "@ionic/angular";
import {CommonfuncService} from "../../services/commonfunc.service";
@Component({
selector: 'app-add-relatives',
@@ -24,7 +25,8 @@ export class AddRelativesComponent implements OnInit {
constructor(
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService,
private loadingCtrl: LoadingController
private loadingCtrl: LoadingController,
private commonfuncService: CommonfuncService
) { }
regMonth:any;
@@ -53,7 +55,7 @@ export class AddRelativesComponent implements OnInit {
isDisabled:boolean= true;
verifyEntry(){
this.isDisabled= true;
if ( this.firstname.length> 1 && this.lastname.length> 1 && this.month> 0 && this.year> 0 ){
if ( this.firstname.length> 1 && this.lastname.length> 1 && this.commonfuncService.validateEmail(this.email)== true ){
this.isDisabled= false;
}
}
@@ -74,8 +76,7 @@ export class AddRelativesComponent implements OnInit {
sessionid: string,
firstname:string,
lastname: string,
month: number,
year: number
email: number,
};
createFamilyResult:any;
@@ -83,22 +84,20 @@ export class AddRelativesComponent implements OnInit {
async inviteFamily(){
const loading = await this.loadingCtrl.create({
message: 'Sending Invite...',
duration: 5000,
duration: 6500,
});
this.reqData={
action:22015,
action:22031,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session ,
firstname: this.firstname,
lastname: this.lastname,
month: this.month,
year: this.year
email: this.email,
}
loading.present();
return;
this.wrenchService.familyAdd(this.reqData).subscribe(
this.wrenchService.familyInvite(this.reqData).subscribe(
createFamilyResult => {
loading.dismiss();
this.createFamilyResult = createFamilyResult;
@@ -106,8 +105,8 @@ return;
if (this.createFamilyResult.internal_return> 0){
this.firstname='';
this.lastname='';
this.createFamilyResult = "Family Added";
this.email='';
this.createFamilyResult = "Invite Sent.";
setTimeout(()=>{
this.createFamilyResult="";
this.setCloseModal();
@@ -118,5 +117,4 @@ return;
}
}
@@ -10,6 +10,10 @@
<ion-icon aria-hidden="true" name="time" slot="start"></ion-icon>
<ion-label>Member Since : {{intData.client_added | date}}</ion-label>
</ion-item>
<ion-item>
<ion-icon aria-hidden="true" name="chatbox-ellipses" slot="start"></ion-icon>
<ion-label>Interest Date : {{intData.sent | date}}</ion-label>
</ion-item>
</ion-list>
</ion-col>
</ion-row>
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { CommonfuncService } from './commonfunc.service';
describe('CommonfuncService', () => {
let service: CommonfuncService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(CommonfuncService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
+15
View File
@@ -0,0 +1,15 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class CommonfuncService {
constructor() { }
validateEmail(email) {
var re = /\S+@\S+\.\S+/;
return re.test(email);
}
}
+5
View File
@@ -85,6 +85,11 @@ export class WrenchService {
return this.getPostData('familyadd', reqData);
}
familyInvite(reqData) {
return this.getPostData('familyrelinvite', reqData);
}
referHx(reqData) {
return this.getPostData('refferhx', reqData);
}