| @@ -0,0 +1,45 @@ | |||||
| <div class="heading-holder"> | |||||
| <div class="name"> NOTIFICATIONS </div> | |||||
| <ion-button fill="clear"> MARK AS READ </ion-button> | |||||
| </div> | |||||
| <ul> | |||||
| <li> | |||||
| <figure></figure> | |||||
| <label> | |||||
| <p> | |||||
| You order has been placed. Please wait until you get notified to pick up the order | |||||
| </p> | |||||
| <div class="time"> 10 mins ago </div> | |||||
| </label> | |||||
| </li> | |||||
| <li> | |||||
| <figure></figure> | |||||
| <label> | |||||
| <p> | |||||
| You order has been placed. Please wait until you get notified to pick up the order | |||||
| </p> | |||||
| <div class="time"> 10 mins ago </div> | |||||
| </label> | |||||
| </li> | |||||
| <li> | |||||
| <figure></figure> | |||||
| <label> | |||||
| <p> | |||||
| You order has been placed. Please wait until you get notified to pick up the order | |||||
| </p> | |||||
| <div class="time"> 10 mins ago </div> | |||||
| </label> | |||||
| </li> | |||||
| <li> | |||||
| <figure></figure> | |||||
| <label> | |||||
| <p> | |||||
| You order has been placed. Please wait until you get notified to pick up the order | |||||
| </p> | |||||
| <div class="time"> 10 mins ago </div> | |||||
| </label> | |||||
| </li> | |||||
| </ul> | |||||
| @@ -0,0 +1,63 @@ | |||||
| .heading-holder { | |||||
| background-color: #efefef; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: space-between; | |||||
| padding: 10px 5%; | |||||
| .name { | |||||
| color: var(--brand-dark-grey); | |||||
| font-size: 12px; | |||||
| font-weight: 500; | |||||
| letter-spacing: 0.5px; | |||||
| } | |||||
| ion-button { | |||||
| margin: 0; | |||||
| --color: var(--brand-blue); | |||||
| font-size: 12px; | |||||
| --padding-end: 0; | |||||
| } | |||||
| } | |||||
| ul { | |||||
| margin: 0; | |||||
| padding: 0; | |||||
| li { | |||||
| list-style: none; | |||||
| display: flex; | |||||
| align-items: flex-start; | |||||
| justify-content: space-between; | |||||
| margin: 0 auto; | |||||
| padding: 10px 5%; | |||||
| border-bottom: 1px solid #efefef; | |||||
| figure { | |||||
| width: 70px; | |||||
| height: 70px; | |||||
| background-color: #efefef; | |||||
| border-radius: 50%; | |||||
| } | |||||
| label { | |||||
| width: calc(100% - 90px); | |||||
| } | |||||
| p { | |||||
| font-size: 13px; | |||||
| color: var(--brand-grey); | |||||
| font-weight: 500; | |||||
| line-height: 1.5; | |||||
| } | |||||
| .time { | |||||
| opacity: 0.8; | |||||
| font-size: 11px; | |||||
| color: var(--brand-grey); | |||||
| line-height: 1.5; | |||||
| margin-top: 5px; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,27 @@ | |||||
| import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | |||||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { NotificationsComponent } from './notifications.component'; | |||||
| describe('NotificationsComponent', () => { | |||||
| let component: NotificationsComponent; | |||||
| let fixture: ComponentFixture<NotificationsComponent>; | |||||
| beforeEach(async(() => { | |||||
| TestBed.configureTestingModule({ | |||||
| declarations: [ NotificationsComponent ], | |||||
| schemas: [CUSTOM_ELEMENTS_SCHEMA], | |||||
| }) | |||||
| .compileComponents(); | |||||
| })); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(NotificationsComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,14 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-notifications', | |||||
| templateUrl: './notifications.component.html', | |||||
| styleUrls: ['./notifications.component.scss'], | |||||
| }) | |||||
| export class NotificationsComponent implements OnInit { | |||||
| constructor() { } | |||||
| ngOnInit() {} | |||||
| } | |||||
| @@ -1,10 +1,4 @@ | |||||
| <div class="tab-utilities-holder"> | |||||
| <h5> MY ORDERS </h5> | |||||
| <ion-button fill="clear"> | |||||
| SORT / FILTER | |||||
| </ion-button> | |||||
| <div class="heading-holder"> | |||||
| <div class="name"> MY ORDERS </div> | |||||
| <ion-button fill="clear"> FILTER </ion-button> | |||||
| </div> | </div> | ||||
| <p> | |||||
| orders works! | |||||
| </p> | |||||
| @@ -0,0 +1,21 @@ | |||||
| .heading-holder { | |||||
| background-color: #efefef; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: space-between; | |||||
| padding: 10px 5%; | |||||
| .name { | |||||
| color: var(--brand-dark-grey); | |||||
| font-size: 12px; | |||||
| font-weight: 500; | |||||
| letter-spacing: 0.5px; | |||||
| } | |||||
| ion-button { | |||||
| margin: 0; | |||||
| --color: var(--brand-blue); | |||||
| font-size: 12px; | |||||
| --padding-end: 0; | |||||
| } | |||||
| } | |||||
| @@ -1,5 +1,9 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||
| import { UserDataService } from '../services/user-data.service'; | |||||
| import { IMall } from '../models/mall'; | |||||
| import { MallService } from '../services/mall.service'; | |||||
| import { CartItemService } from '../services/cart-item.service'; | |||||
| import CartItem from '../models/cart-item'; | |||||
| import * as moment from 'moment'; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-orders', | selector: 'app-orders', | ||||
| @@ -7,11 +11,32 @@ import { UserDataService } from '../services/user-data.service'; | |||||
| styleUrls: ['./orders.component.scss'], | styleUrls: ['./orders.component.scss'], | ||||
| }) | }) | ||||
| export class OrdersComponent implements OnInit { | export class OrdersComponent implements OnInit { | ||||
| cart_items: any = []; | |||||
| all_malls: Array<IMall> = []; | |||||
| constructor( | constructor( | ||||
| private userDataService: UserDataService | |||||
| private mallService: MallService, | |||||
| private cartService: CartItemService, | |||||
| ) { } | ) { } | ||||
| ngOnInit() { } | |||||
| ngOnInit() { | |||||
| this.mallService.getAllMalls().then((malls: Array<IMall>) => { | |||||
| this.all_malls = malls; | |||||
| }); | |||||
| this.cartService.getAllCartItems().then((cart_items: Array<CartItem>) => { | |||||
| this.cart_items = cart_items; | |||||
| let i: number; | |||||
| for (i = 0; i < this.cart_items.length; i += 1) { | |||||
| let mall = this.all_malls.find(mall => mall.id === this.cart_items[i].mall_id); | |||||
| let outlet = mall.outlets.find(outlet => outlet.id === this.cart_items[i].outlet_id); | |||||
| this.cart_items[i].menu_details = outlet.menu_items.find(item => item.id === this.cart_items[i].menu_item); | |||||
| } | |||||
| console.log(this.cart_items); | |||||
| }); | |||||
| } | |||||
| } | } | ||||
| @@ -8,6 +8,8 @@ import { IonicModule } from '@ionic/angular'; | |||||
| import { ProfilePage } from './profile.page'; | import { ProfilePage } from './profile.page'; | ||||
| import { OrdersComponent } from '../orders/orders.component'; | import { OrdersComponent } from '../orders/orders.component'; | ||||
| import { NotificationsComponent } from '../notifications/notifications.component'; | |||||
| import { ReferComponent } from '../refer/refer.component'; | |||||
| const routes: Routes = [ | const routes: Routes = [ | ||||
| { | { | ||||
| @@ -23,6 +25,6 @@ const routes: Routes = [ | |||||
| IonicModule, | IonicModule, | ||||
| RouterModule.forChild(routes) | RouterModule.forChild(routes) | ||||
| ], | ], | ||||
| declarations: [ProfilePage, OrdersComponent] | |||||
| declarations: [ProfilePage, OrdersComponent, NotificationsComponent, ReferComponent] | |||||
| }) | }) | ||||
| export class ProfilePageModule {} | export class ProfilePageModule {} | ||||
| @@ -42,7 +42,7 @@ | |||||
| </figure> | </figure> | ||||
| <span> NOTIFICATION </span> | <span> NOTIFICATION </span> | ||||
| </div> | </div> | ||||
| <div class="tab"> | |||||
| <div class="tab" (click)="logout()"> | |||||
| <figure> | <figure> | ||||
| <img src="assets/custom/logout.svg"> | <img src="assets/custom/logout.svg"> | ||||
| </figure> | </figure> | ||||
| @@ -50,6 +50,8 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <app-orders *ngIf="selected_tab === 'MY ORDERS'"></app-orders> | |||||
| <app-notifications *ngIf="selected_tab === 'NOTIFICATION'"></app-notifications> | |||||
| <app-refer *ngIf="selected_tab === 'REFER AND EARN'"></app-refer> | |||||
| <app-orders *ngIf="selected_tab === 'MY ORDERS'"></app-orders> | |||||
| </ion-content> | </ion-content> | ||||
| @@ -126,26 +126,3 @@ | |||||
| transition: color 0.4s; | transition: color 0.4s; | ||||
| } | } | ||||
| } | } | ||||
| .tab-utilities-holder { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: space-between; | |||||
| width: 100%; | |||||
| padding: 0 15px; | |||||
| margin: 0 auto; | |||||
| background-color: #efefef; | |||||
| h5 { | |||||
| color: var(--brand-dark-grey); | |||||
| font-size: 12px; | |||||
| margin: 0; | |||||
| } | |||||
| ion-button { | |||||
| --padding-end: 0; | |||||
| --color: var(--brand-blue); | |||||
| font-size: 10px; | |||||
| margin: 0; | |||||
| } | |||||
| } | |||||
| @@ -1,5 +1,6 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||
| import { Location } from '@angular/common'; | import { Location } from '@angular/common'; | ||||
| import { Router } from '@angular/router'; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-profile', | selector: 'app-profile', | ||||
| @@ -11,6 +12,7 @@ export class ProfilePage implements OnInit { | |||||
| constructor( | constructor( | ||||
| private location: Location, | private location: Location, | ||||
| private router: Router | |||||
| ) { } | ) { } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| @@ -20,4 +22,9 @@ export class ProfilePage implements OnInit { | |||||
| this.location.back(); | this.location.back(); | ||||
| } | } | ||||
| logout() { | |||||
| localStorage.clear(); | |||||
| this.router.navigate(['login']); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,11 @@ | |||||
| <div class="heading-holder"> | |||||
| <div class="name"> REFER & EARN </div> | |||||
| </div> | |||||
| <section class="code-sharing-options"> | |||||
| <div> | |||||
| <input class="code" type="text" value="KSH322VD" id="clipboard" contenteditable="false"> | |||||
| <ion-button (click)="copy()"> COPY TO CLIPBOARD </ion-button> | |||||
| <p> Share this with your friends and earn upto <span> ₹ 1000 </span> </p> | |||||
| </div> | |||||
| </section> | |||||
| @@ -0,0 +1,60 @@ | |||||
| .heading-holder { | |||||
| background-color: #efefef; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: space-between; | |||||
| padding: 10px 5%; | |||||
| .name { | |||||
| color: var(--brand-dark-grey); | |||||
| font-size: 12px; | |||||
| font-weight: 500; | |||||
| letter-spacing: 0.5px; | |||||
| } | |||||
| ion-button { | |||||
| margin: 0; | |||||
| --color: var(--brand-blue); | |||||
| font-size: 12px; | |||||
| --padding-end: 0; | |||||
| } | |||||
| } | |||||
| .code-sharing-options { | |||||
| width: 100%; | |||||
| padding: 50px; | |||||
| text-align: center; | |||||
| background-color: white; | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| .code { | |||||
| background-color: #efefef; | |||||
| padding: 10px; | |||||
| color: var(--brand-grey); | |||||
| font-size: 16px; | |||||
| border: 0px; | |||||
| text-align: center; | |||||
| } | |||||
| ion-button { | |||||
| font-size: 12px; | |||||
| display: block; | |||||
| margin: 10px auto; | |||||
| --background: var(--brand-blue); | |||||
| } | |||||
| p { | |||||
| font-size: 14px; | |||||
| color: var(--brand-grey); | |||||
| line-height: 1.5; | |||||
| font-weight: 500; | |||||
| letter-spacing: 0.5px; | |||||
| span { | |||||
| color: var(--brand-blue); | |||||
| font-weight: 700; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,27 @@ | |||||
| import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | |||||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { ReferComponent } from './refer.component'; | |||||
| describe('ReferComponent', () => { | |||||
| let component: ReferComponent; | |||||
| let fixture: ComponentFixture<ReferComponent>; | |||||
| beforeEach(async(() => { | |||||
| TestBed.configureTestingModule({ | |||||
| declarations: [ ReferComponent ], | |||||
| schemas: [CUSTOM_ELEMENTS_SCHEMA], | |||||
| }) | |||||
| .compileComponents(); | |||||
| })); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(ReferComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,44 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | |||||
| import { ToastController } from '@ionic/angular'; | |||||
| @Component({ | |||||
| selector: 'app-refer', | |||||
| templateUrl: './refer.component.html', | |||||
| styleUrls: ['./refer.component.scss'], | |||||
| }) | |||||
| export class ReferComponent implements OnInit { | |||||
| constructor( | |||||
| public toastController: ToastController | |||||
| ) { } | |||||
| ngOnInit() { } | |||||
| copy() { | |||||
| var copyText = document.getElementById("clipboard") as HTMLInputElement; | |||||
| copyText.select(); | |||||
| copyText.setSelectionRange(0, 99999); /*For mobile devices*/ | |||||
| /* Copy the text inside the text field */ | |||||
| document.execCommand("copy"); | |||||
| /* Alert the copied text */ | |||||
| this.presentToast("Copied the text: " + copyText.value); | |||||
| } | |||||
| async presentToast(text: string) { | |||||
| const toast = await this.toastController.create({ | |||||
| message: text, | |||||
| position: 'bottom', | |||||
| duration: 2000, | |||||
| color: 'dark', | |||||
| buttons: [ | |||||
| { | |||||
| text: 'Done', | |||||
| } | |||||
| ] | |||||
| }); | |||||
| toast.present(); | |||||
| } | |||||
| } | |||||