Profile page

This commit is contained in:
CHIEFSOFT\ameye
2023-08-15 11:39:02 -04:00
parent 242d6323f1
commit 61f5f1cbb4
5 changed files with 146 additions and 14 deletions
@@ -12,10 +12,10 @@
<ion-content class="ion-padding">
<div class="profile">
<div class="bg_image back_image" [style.backgroundImage]="'url(assets/images/profile.jpg)'">
<div class="icon">
<ion-icon name="pencil"></ion-icon>
</div>
<div class="bg_image back_image" [style.backgroundImage]="'url(https://www.wrenchboard.com/assets/images/profile.jpg)'">
<!-- <div class="icon">-->
<!-- <ion-icon name="pencil"></ion-icon>-->
<!-- </div>-->
</div>
<div class="title">
<ion-label style="font-size: 17px; font-family: 'bold';">{{firstname}} {{lastname}}</ion-label>
@@ -28,11 +28,15 @@
</ion-item>
<ion-item lines="none">
<ion-input type="text" maxlength="25" placeholder="lastname" [(ngModel)]='lastname' ></ion-input>
<ion-input type="text" maxlength="15" placeholder="lastname" [(ngModel)]='lastname' ></ion-input>
</ion-item>
<ion-item lines="none">
<ion-input type="text" maxlength="25" placeholder="email" [(ngModel)]='email' ></ion-input>
<ion-input type="text" maxlength="35" placeholder="Email" [(ngModel)]='email' ></ion-input>
</ion-item>
<ion-item lines="none">
<ion-input type="text" maxlength="25" placeholder="Online Name" [(ngModel)]='online_name' ></ion-input>
</ion-item>
<!-- <ion-item lines="none">-->
@@ -1,7 +1,7 @@
import { NavController } from '@ionic/angular';
import {Component, OnInit, ViewChild} from '@angular/core';
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
import { WrenchService } from 'src/app/services/wrench.service';
@Component({
selector: 'app-edit-profile',
@@ -12,25 +12,92 @@ export class EditProfilePage implements OnInit {
// @ViewChild('firstname') firstname;
// @ViewChild('lastname') lastname;
// @ViewChild('reset_pin') reset_pin;
// //@ViewChild('lastname') lastname;
// @ViewChild('email') email;
// @ViewChild('online_name') online_name;
constructor(
private navctr: NavController,
public sessionDataProviderService:SessionDataProviderService
) { }
public sessionDataProviderService:SessionDataProviderService,
private wrenchService: WrenchService,
) {
// this.firstname = this.sessionDataProviderService.firstname;
// this.lastname = this.sessionDataProviderService.lastname;
// this.email = this.sessionDataProviderService.email;
// this.online_name = this.sessionDataProviderService.online_name;
}
firstname:string='';
lastname:string='';
email:string='';
online_name:string='';
ngOnInit() {
this.firstname = this.sessionDataProviderService.firstname;
this.lastname = this.sessionDataProviderService.lastname;
this.email = this.sessionDataProviderService.username;
this.email = this.sessionDataProviderService.email;
this.online_name = this.sessionDataProviderService.online_name;
}
onBack() {
this.sendUpdateProfile();
this.navctr.back();
}
/*
'member_id' => int 1
'sessionid' => string '936571FD2E081B667930E7FFDF4D819938171883CA0CC951DC6C4FB184280EB3' (length=64)
'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36)
'action' => int 15031
'firstname' => string 'First68' (length=7)
'lastname' => string 'Last32' (length=6)
'email' => string 'ses66181+new39@gmail.com' (length=24)
'state' => string 'Georgia' (length=7)
'city' => string 'Atlanta3' (length=8)
'online_name' => string 'Online Name61' (length=13)
'pref_email' => int 1
'pref_phone' => int 1
'promo' => int 1
*/
profileData: {
action:number,
member_id: number,
uid: string,
sessionid: string,
firstname: string,
lastname: string,
email: string,
state: string,
city: string,
online_name: string,
pref_email: number,
pref_phone: number,
promo: number,
};
profileResult:any;
sendUpdateProfile(){
this.profileData = {action:15031,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session ,
firstname: this.firstname,
lastname: this.lastname,
email: this.email,
state: this.sessionDataProviderService.user_state,
city: this.sessionDataProviderService.city,
online_name: this.sessionDataProviderService.online_name,
pref_email: this.sessionDataProviderService.pref_email,
pref_phone: this.sessionDataProviderService.pref_phone,
promo: this.sessionDataProviderService.promo,
}
this.wrenchService.updateProfile(this.profileData).subscribe(
profileResult => {
this.profileResult = profileResult;
console.log("profileResult RETURN->", this.profileResult);
}
);
}
}
+1 -1
View File
@@ -13,7 +13,7 @@
<div class="profile">
<div class="bg_image back_image" [style.backgroundImage]="'url(https://www.wrenchboard.com/assets/images/profile.jpg)'">
<div class="icon">
<ion-icon name="pencil"></ion-icon>
<ion-icon name="pencil" (click)="onProfile()"></ion-icon>
</div>
</div>
<div class="title">
+4
View File
@@ -117,6 +117,10 @@ export class WrenchService {
requestDelete(usrData){
return this.getPostData("reqdel", usrData);
}
updateProfile(profileData) {
return this.getPostData("updateprofile", profileData);
}
/*
+58 -1
View File
@@ -8,7 +8,50 @@ export class SessionDataProviderService {
constructor() {
console.log('Hello SessionDataProvider Store');
}
/*
"account_type": "FULL",
"added": "2016-09-22 23:26:29.916445",
"balance": "93468334",
"ccard": "0",
"city": "Atlanta3",
"country": "NG",
"email": "ses66181+new39@gmail.com",
"external_idp_provider": "",
"external_idp_provider_id": "",
"family_level": "0",
"firstname": "First68",
"id": "1",
"last_login": "2023-08-15 12:58:19.879022",
"last_login2": "Tuesday Aug 15, 2023 12:58 PM",
"lastname": "Last32",
"loc": "10.10.33.15",
"member_id": "1",
"news": "0",
"online_name": "Online Name61",
"password": "",
"phone": "",
"post_jobs": "2017-07-24 08:33:35.599175",
"pref_email": "1",
"pref_phone": "1",
"profile_pic": "1.jpg",
"profile_pic_url": "https:\/\/www.wrenchboard.com\/assets\/images\/profile.jpg",
"promo": "0",
"refer": "2017-10-30 12:44:06.660273",
"result": "YES I GET TO BACK END",
"server_name": "https:\/\/dev-users.wrenchboard.com",
"session": "0BDEDDAE493E93BD4F4E6F8EB3BC710C1679D66444C4534D3369E54DB63A390A",
"state": "Georgia",
"stats_show": "0",
"status": "1",
"stauts": "OK",
"stripe_customer_id": "cus_O6QmTGCmEilwW6",
"uid": "3119b744-42ad-4834-bb83-b737588754ca",
"username": "ses66181+1@gmail.com",
"verify_link": "",
"zip_code": "30127",
"internal_return": 100
*/
email: string = "";
firstname: string = "";
lastname:string = "";
session: string = "";
@@ -21,6 +64,13 @@ export class SessionDataProviderService {
isOfferJob: number = 0;
profile_pic:string='';
member_uid:string;
user_state:string;
city:string;
online_name:string;
pref_email:number=0;
pref_phone:number=0;
promo:number=0;
session_contructed:boolean = false;
@@ -36,6 +86,7 @@ export class SessionDataProviderService {
this.lastname = loginResult.lastname;
this.session = loginResult.session;
this.session_contructed=loginResult.balance;
this.email = loginResult.email;
this.username=loginResult.username;
this.last_login = loginResult.last_login2;
this.member_id = loginResult.member_id;
@@ -45,6 +96,12 @@ export class SessionDataProviderService {
this.profile_pic=loginResult.profile_pic;
this.isPedningJob = loginResult.pedningjob;
this.isOfferJob = loginResult.offerjob;
this.user_state=loginResult.state;
this.city = loginResult.city;
this.online_name = loginResult.online_name;
this.pref_email= loginResult.pref_email;
this.pref_phone = loginResult.pref_phone;
this.promo=loginResult.promo;
//this.pushNotificationProvider.tagUser(this.session);