| @@ -21,7 +21,7 @@ | |||
| Reset Password | |||
| </header> | |||
| <p class="description"> | |||
| Please verify the OTP | |||
| Please enter the otp sent <br> to your registered email id | |||
| </p> | |||
| <div class="input-holder"> | |||
| @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; | |||
| import { ActivatedRoute, Router } from '@angular/router'; | |||
| import { Location } from '@angular/common'; | |||
| import { MallService } from '../services/mall.service'; | |||
| import { ToastService } from '../services/toast.service'; | |||
| @Component({ | |||
| selector: 'app-mall-details', | |||
| @@ -19,7 +20,8 @@ export class MallDetailsPage implements OnInit { | |||
| private route: ActivatedRoute, | |||
| private router: Router, | |||
| private location: Location, | |||
| private mallService: MallService | |||
| private mallService: MallService, | |||
| private toastService: ToastService | |||
| ) { } | |||
| ngOnInit() { | |||
| @@ -78,15 +80,19 @@ export class MallDetailsPage implements OnInit { | |||
| } | |||
| outletDetails(outlet: any) { | |||
| this.router.navigate(['/outlet-details', { | |||
| outlet: JSON.stringify(outlet), | |||
| mallId: this.mallDetails.mall.mall_id, | |||
| mallData: JSON.stringify({ | |||
| title: this.mallDetails.mall.mall_name, | |||
| text: this.mallDetails.mall.description, | |||
| url: 'https://maps.google.com/?q=' + this.mallDetails.latitude + ',' + this.mallDetails.longitude | |||
| }) | |||
| }]); | |||
| if (outlet.menuitems && outlet.menuitems.length > 0) { | |||
| this.router.navigate(['/outlet-details', { | |||
| outlet: JSON.stringify(outlet), | |||
| mallId: this.mallDetails.mall.mall_id, | |||
| mallData: JSON.stringify({ | |||
| title: this.mallDetails.mall.mall_name, | |||
| text: this.mallDetails.mall.description, | |||
| url: 'https://maps.google.com/?q=' + this.mallDetails.latitude + ',' + this.mallDetails.longitude | |||
| }) | |||
| }]); | |||
| } else { | |||
| this.toastService.presentToast("No menu present in this outlet", "dark"); | |||
| } | |||
| } | |||
| sortBy(type: string) { | |||
| @@ -50,43 +50,45 @@ | |||
| </div> | |||
| <ion-list lines="none" class="result-list"> | |||
| <ion-item *ngFor="let mallData of tempMalls; let index = index"> | |||
| <img src="{{ mallData.mall.image_url }}" slot="start"> | |||
| <ion-label> | |||
| <h3> | |||
| <span (click)="showMallDetails(mallData)"> {{ mallData.mall.mall_name }} </span> | |||
| <ion-icon (click)="toggleMallBookmark(index)" name="bookmark" | |||
| [ngClass]="{'active' : mallData.mall.is_bookmarked }"></ion-icon> | |||
| </h3> | |||
| <p class="description" (click)="showMallDetails(mallData)"> {{ mallData.mall.description }} </p> | |||
| <div class="offers-holder"> | |||
| <div class="offer"> | |||
| <ion-icon src="assets/custom/restaurant.svg"></ion-icon> | |||
| Food Offers: <strong> {{ mallData.mall.offers_count }} </strong> | |||
| <ng-container *ngFor="let mallData of tempMalls;"> | |||
| <ion-item *ngIf="mallData.mall.outlet && mallData.mall.outlet.length > 0"> | |||
| <img src="{{ mallData.mall.image_url }}" slot="start"> | |||
| <ion-label> | |||
| <h3> | |||
| <span (click)="showMallDetails(mallData)"> {{ mallData.mall.mall_name }} </span> | |||
| <ion-icon (click)="toggleMallBookmark(mallData)" name="bookmark" | |||
| [ngClass]="{'active' : mallData.mall.is_bookmarked }"></ion-icon> | |||
| </h3> | |||
| <p class="description" (click)="showMallDetails(mallData)"> {{ mallData.mall.description }} </p> | |||
| <div class="offers-holder"> | |||
| <div class="offer"> | |||
| <ion-icon src="assets/custom/restaurant.svg"></ion-icon> | |||
| Food Offers: <strong> {{ mallData.mall.offers_count }} </strong> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="utilities-holder"> | |||
| <div class="container"> | |||
| <div class="utility"> | |||
| <ion-icon name="star"></ion-icon> {{ mallData.mall.rating }} | |||
| <div class="utilities-holder"> | |||
| <div class="container"> | |||
| <div class="utility"> | |||
| <ion-icon name="star"></ion-icon> {{ mallData.mall.rating }} | |||
| </div> | |||
| <div class="utility"> | |||
| <ion-icon name="pin"></ion-icon> {{ mallData.mall.mall_distance }} km | |||
| </div> | |||
| </div> | |||
| <div class="utility"> | |||
| <ion-icon name="pin"></ion-icon> {{ mallData.mall.mall_distance }} km | |||
| <div class="container"> | |||
| <button class="utility-button" (click)="shareMallDetails(mallData)"> | |||
| <ion-icon name="share"></ion-icon> | |||
| </button> | |||
| <a class="utility-button" target="_blank" | |||
| href="https://maps.google.com/?q={{ mallData.latitude }},{{ mallData.longitude }}"> | |||
| <ion-icon name="navigate"></ion-icon> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="container"> | |||
| <button class="utility-button" (click)="shareMallDetails(mallData)"> | |||
| <ion-icon name="share"></ion-icon> | |||
| </button> | |||
| <a class="utility-button" target="_blank" | |||
| href="https://maps.google.com/?q={{ mallData.latitude }},{{ mallData.longitude }}"> | |||
| <ion-icon name="navigate"></ion-icon> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </ion-label> | |||
| </ion-item> | |||
| </ion-label> | |||
| </ion-item> | |||
| </ng-container> | |||
| </ion-list> | |||
| <div class="common-semi-modal sort-holder" [ngClass]="{'active' : show_sort_popup }"> | |||
| @@ -3,6 +3,7 @@ import { MallService } from '../services/mall.service'; | |||
| import { ToastService } from '../services/toast.service'; | |||
| import { Router } from '@angular/router'; | |||
| import { LoadingController } from '@ionic/angular'; | |||
| import { AlertController } from '@ionic/angular'; | |||
| @Component({ | |||
| selector: 'app-malls', | |||
| @@ -25,7 +26,8 @@ export class MallsPage implements OnInit { | |||
| private mallService: MallService, | |||
| private router: Router, | |||
| private toastService: ToastService, | |||
| public loadingController: LoadingController | |||
| public loadingController: LoadingController, | |||
| public alertController: AlertController | |||
| ) { } | |||
| async presentLoading() { | |||
| @@ -36,6 +38,16 @@ export class MallsPage implements OnInit { | |||
| }); | |||
| await this.loader.present(); | |||
| } | |||
| async presentAlert(message: string) { | |||
| const alert = await this.alertController.create({ | |||
| message: message, | |||
| mode: 'ios', | |||
| buttons: ['OK'] | |||
| }); | |||
| await alert.present(); | |||
| } | |||
| getMallsByFoodType(type: string) { | |||
| this.selectedFoodType = type; | |||
| @@ -66,10 +78,9 @@ export class MallsPage implements OnInit { | |||
| this.getMallsByLocation(); | |||
| } | |||
| toggleMallBookmark(index: number) { | |||
| this.tempMalls[index].mall.is_bookmarked = !this.tempMalls[index].mall.is_bookmarked; | |||
| console.log(this.tempMalls[index].mall); | |||
| this.mallService.updateMallData(this.tempMalls[index]); | |||
| toggleMallBookmark(mallData: any) { | |||
| mallData.mall.is_bookmarked = !mallData.mall.is_bookmarked; | |||
| this.mallService.updateMallData(mallData); | |||
| } | |||
| doRefresh(e: any) { | |||
| @@ -112,25 +123,30 @@ export class MallsPage implements OnInit { | |||
| } | |||
| getMallsByLocation() { | |||
| if (navigator.geolocation) { | |||
| this.toastService.presentToast("Getting malls based on your location...", "dark"); | |||
| this.presentLoading(); | |||
| if (navigator.geolocation) { | |||
| navigator.geolocation.getCurrentPosition((position) => { | |||
| this.presentLoading(); | |||
| this.mallService.mallsByLocation(position.coords.latitude, position.coords.longitude).then((response: any) => { | |||
| if (response.length > 0) { | |||
| this.allMalls = response; | |||
| this.tempMalls = response; | |||
| this.loader.dismiss(); | |||
| this.loader ? this.loader.dismiss() : null; | |||
| } else { | |||
| this.toastService.presentToast("No malls near you your location, Getting all the malls...", "warning"); | |||
| this.getAllMalls(); | |||
| } | |||
| }, () => { | |||
| this.loader.dismiss(); | |||
| this.loader ? this.loader.dismiss() : null; | |||
| this.toastService.presentToast("Failed to fetch malls for your location", "danger"); | |||
| }); | |||
| }, () => { | |||
| this.loader ? this.loader.dismiss() : null; | |||
| this.toastService.presentToast("Location access is mandatory", "danger"); | |||
| this.presentAlert("Settings > Site Settings > Location > Blocked > Change permission"); | |||
| // this.getAllMalls(); | |||
| }); | |||
| } else { | |||
| this.presentLoading(); | |||
| this.getAllMalls(); | |||
| } | |||
| } | |||
| @@ -139,9 +155,9 @@ export class MallsPage implements OnInit { | |||
| this.mallService.allMalls().then((response) => { | |||
| this.allMalls = response; | |||
| this.tempMalls = response; | |||
| this.loader.dismiss(); | |||
| this.loader ? this.loader.dismiss() : null; | |||
| }, (error) => { | |||
| this.loader.dismiss(); | |||
| this.loader ? this.loader.dismiss() : null; | |||
| console.log(error); | |||
| }); | |||
| } | |||
| @@ -132,7 +132,7 @@ | |||
| <img src="assets/custom/logo.svg"> | |||
| </figure> | |||
| <header> | |||
| We sent you a code to <br> verify your email | |||
| Please enter the otp sent <br> to your registered email id | |||
| </header> | |||
| <div class="input-holder"> | |||