diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index 49e9607..9db46cd 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -1,230 +1,228 @@ - - - - - - - Profile - + + + + + + + Profile + - - - - - - - + + + + + + + + + + {{firstname}} {{lastname}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Privacy Policy + + + + + + My Files + + + + + + + + + + + + Logout + + + - - {{firstname}} {{lastname}} - - - + + + + + + + + + {{firstname}} {{lastname}} + {{email}} + + - - - - - - + + + + + + - - - - - + + + Pending Offers Received + + + + + Invite Friends + + + + + Coupons & Rewards + + + + + Notifications + + - - - - - - - - - - - - - - - - - - - + + + Family Profile + + - + + + Card & Accounts + + + + + + My Jobs + + - - - Privacy Policy - - + - - - My Files - - - - - - - + + + + + My Files + + + + + + Preferences + + + + + + + History + + + + + + Security + + + + + + Privacy Policy + + + + + + + Help + + + + + + + Logout + + + + + ID: {{app_user_id}} + + - - - Logout - - - - - - - - - - - - {{firstname}} {{lastname}} - {{email}} - - - - - - - - - - - - - Family Profile - - - - - - Coupons & Rewards - - - - - - Invite Friends - - - - - - Notifications - - - - - - Card & Accounts - - - - - - - - My Jobs - - - - - - - - - - - - - - My Files - - - - - - Preferences - - - - - - - History - - - - - - Security - - - - - - Privacy Policy - - - - - - - Help - - - - - - - - - Logout - - - - - ID: {{app_user_id}} - - - - - + - + Help @@ -256,5 +254,4 @@ - \ No newline at end of file diff --git a/src/app/pages/profile/profile.page.ts b/src/app/pages/profile/profile.page.ts index 03d08e9..e55dd79 100644 --- a/src/app/pages/profile/profile.page.ts +++ b/src/app/pages/profile/profile.page.ts @@ -1,182 +1,197 @@ -import { Router } from '@angular/router'; -import { Component, OnInit } from '@angular/core'; -import { SessionDataProviderService } from 'src/app/store/session-data-provider.service'; +import {Router} from '@angular/router'; +import {Component, OnInit} from '@angular/core'; +import {SessionDataProviderService} from 'src/app/store/session-data-provider.service'; import {AlertController} from "@ionic/angular"; import {HelpDataService} from "../../store/help-data.service"; @Component({ - selector: 'app-profile', - templateUrl: './profile.page.html', - styleUrls: ['./profile.page.scss'], + selector: 'app-profile', + templateUrl: './profile.page.html', + styleUrls: ['./profile.page.scss'], }) export class ProfilePage implements OnInit { - firstname:string=''; - lastname:string=''; - email:string=''; - profilePicture:string=''; - accountType:string="FULL"; - etag:string=''; - app_user_id:string=''; + firstname: string = ''; + lastname: string = ''; + email: string = ''; + profilePicture: string = ''; + accountType: string = "FULL"; + etag: string = ''; + app_user_id: string = ''; - constructor( - private router: Router, - private alertController:AlertController, - public sessionDataProviderService:SessionDataProviderService, - public helpDataService:HelpDataService - ) { - this.etag = '' + Date.now(); - this.accountType = this.sessionDataProviderService.account_type; - this.setProfilePicture(); - addEventListener('profile_picture_updated', () => { - this.setProfilePicture(); - }); - this.app_user_id = this.sessionDataProviderService.member_uid.substring(0,8); - } - - ngOnInit() { - this.accountType = this.sessionDataProviderService.account_type; - this.firstname = this.sessionDataProviderService.firstname; - this.lastname = this.sessionDataProviderService.lastname; - this.email = this.sessionDataProviderService.username; - this.setProfilePicture(); - - // if (this.accountType == 'FULL'){ - // // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); - // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid)+'?'+this.etag; - // debugger; - // } - // - // if (this.accountType == 'FAMILY'){ - // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.family_uid)+'?'+this.etag; - // } - //this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); - } - ionViewWillEnter() { - this.setProfilePicture(); - } - ionViewDidEnter(){ - this.setProfilePicture(); - } - setProfilePicture(){ - this.accountType = this.sessionDataProviderService.account_type; - this.etag = '' + Date.now(); - if (this.accountType == 'FULL'){ - // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); - this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid)+'?'+this.etag; - /// debugger; + constructor( + private router: Router, + private alertController: AlertController, + public sessionDataProviderService: SessionDataProviderService, + public helpDataService: HelpDataService + ) { + this.etag = '' + Date.now(); + this.accountType = this.sessionDataProviderService.account_type; + this.setProfilePicture(); + addEventListener('profile_picture_updated', () => { + this.setProfilePicture(); + }); + this.app_user_id = this.sessionDataProviderService.member_uid.substring(0, 8); } - if (this.accountType == 'FAMILY'){ - this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.family_uid)+'?'+this.etag; + ngOnInit() { + this.accountType = this.sessionDataProviderService.account_type; + this.firstname = this.sessionDataProviderService.firstname; + this.lastname = this.sessionDataProviderService.lastname; + this.email = this.sessionDataProviderService.username; + this.setProfilePicture(); + + // if (this.accountType == 'FULL'){ + // // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); + // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid)+'?'+this.etag; + // debugger; + // } + // + // if (this.accountType == 'FAMILY'){ + // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.family_uid)+'?'+this.etag; + // } + //this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); } - } - onFamily() { - this.router.navigate(['family']); - } - onProfile() { - this.router.navigate(['edit-profile']); - } - onSecurity() { - this.router.navigate(['security']); - } + ionViewWillEnter() { + this.setProfilePicture(); + } - onNotification() { - this.router.navigate(['notification']); - } + ionViewDidEnter() { + this.setProfilePicture(); + } - onRewards(){ - this.router.navigate(['mycoupons']); - } + setProfilePicture() { + this.accountType = this.sessionDataProviderService.account_type; + this.etag = '' + Date.now(); + if (this.accountType == 'FULL') { + // this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid); + this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid) + '?' + this.etag; + /// debugger; + } - onMyJobs(){ - this.router.navigate(['jobmanager']); - } - onLanguage() { - this.router.navigate(['language']); - } + if (this.accountType == 'FAMILY') { + this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.family_uid) + '?' + this.etag; + } + } - onPrivacy() { - this.router.navigate(['privacy']); - } + onFamily() { + this.router.navigate(['family']); + } - onPayment() { - this.router.navigate(['payment']); - } + onProfile() { + this.router.navigate(['edit-profile']); + } - onPreferences(){ - this.router.navigate(['preferences']); - } - onHistory(){ - this.router.navigate(['history']); - } + onSecurity() { + this.router.navigate(['security']); + } - onInvite() { - this.router.navigate(['invite']); - } + onNotification() { + this.router.navigate(['notification']); + } - onMyFiles() { - this.router.navigate(['myfiles']); - } - async onLogout() { - // this.sessionDataProviderService.DestroySessionOnLogout(); - // this.router.navigate(['login']); - //this.requestLogout(); + onRewards() { + this.router.navigate(['mycoupons']); + } - const alert = await this.alertController.create({ - header: "Log out", - message: "Confirm you are ready to log out now.", - buttons: [ - { - text: "Cancel", - role: "cancel", - handler: () => { - // this.getMyOffersData(); - }, - }, - { - text: "Log out", - handler: () => { - this.sessionDataProviderService.DestroySessionOnLogout(); - this.router.navigate(['logout']); - }, - }, - ], - }); - await alert.present(); - } - isModalOpen:boolean=false; - onHelp() { - this.helpDataService.getHelpData(); + onMyJobs() { + this.router.navigate(['jobmanager']); + } - this.isModalOpen = true; - } + onMyOffers() { + this.router.navigate(['joboffers']); + } - setCloseModal(){ - // debugger; - this.isModalOpen = false; - } - // async requestLogout() { - // const alert = await this.alertController.create({ - // header: "Log out", - // message: "Confirm you are ready to log out now.", - // buttons: [ - // { - // text: "Cancel", - // role: "cancel", - // handler: () => { - // // this.getMyOffersData(); - // }, - // }, - // { - // text: "Log out", - // handler: () => { - // this.sessionDataProviderService.DestroySessionOnLogout(); - // this.router.navigate(['logout']); - // }, - // }, - // ], - // }); - // await alert.present(); - // } + onLanguage() { + this.router.navigate(['language']); + } + + onPrivacy() { + this.router.navigate(['privacy']); + } + + onPayment() { + this.router.navigate(['payment']); + } + + onPreferences() { + this.router.navigate(['preferences']); + } + + onHistory() { + this.router.navigate(['history']); + } + + onInvite() { + this.router.navigate(['invite']); + } + + onMyFiles() { + this.router.navigate(['myfiles']); + } + + async onLogout() { + // this.sessionDataProviderService.DestroySessionOnLogout(); + // this.router.navigate(['login']); + //this.requestLogout(); + + const alert = await this.alertController.create({ + header: "Log out", + message: "Confirm you are ready to log out now.", + buttons: [ + { + text: "Cancel", + role: "cancel", + handler: () => { + // this.getMyOffersData(); + }, + }, + { + text: "Log out", + handler: () => { + this.sessionDataProviderService.DestroySessionOnLogout(); + this.router.navigate(['logout']); + }, + }, + ], + }); + await alert.present(); + } + + isModalOpen: boolean = false; + + onHelp() { + this.helpDataService.getHelpData(); + + this.isModalOpen = true; + } + + setCloseModal() { + // debugger; + this.isModalOpen = false; + } + + // async requestLogout() { + // const alert = await this.alertController.create({ + // header: "Log out", + // message: "Confirm you are ready to log out now.", + // buttons: [ + // { + // text: "Cancel", + // role: "cancel", + // handler: () => { + // // this.getMyOffersData(); + // }, + // }, + // { + // text: "Log out", + // handler: () => { + // this.sessionDataProviderService.DestroySessionOnLogout(); + // this.router.navigate(['logout']); + // }, + // }, + // ], + // }); + // await alert.present(); + // } }