Browse Source

Pay now button replaced with payment gateway button, get malls by location first implementation

master
kj1352 5 years ago
parent
commit
2e576e444d
6 changed files with 1280 additions and 1285 deletions
  1. +1248
    -1275
      package-lock.json
  2. +1
    -1
      package.json
  3. +2
    -4
      src/app/cart/cart.page.html
  4. +1
    -1
      src/app/mall-details/mall-details.page.html
  5. +27
    -3
      src/app/malls/malls.page.ts
  6. +1
    -1
      src/app/services/mall.service.ts

+ 1248
- 1275
package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

@@ -43,7 +43,7 @@
},
"devDependencies": {
"@angular-devkit/architect": "~0.801.2",
"@angular-devkit/build-angular": "^0.803.24",
"@angular-devkit/build-angular": "^0.803.25",
"@angular-devkit/core": "~8.1.2",
"@angular-devkit/schematics": "~8.1.2",
"@angular/cli": "~8.1.2",


+ 2
- 4
src/app/cart/cart.page.html View File

@@ -77,10 +77,8 @@
</div>
</div>

<ion-button shape="round" expand="block" class="pay-button" (click)="placeOrder()"
[disabled]="userCart.orderedlist.length === 0"> Pay Now </ion-button>

<ion-button shape="round" expand="block" class="pay-button" (click)="requestInvoice()"> Testing Payment gateway </ion-button>
<ion-button shape="round" [disabled]="userCart.orderedlist.length === 0" expand="block"
class="pay-button" (click)="requestInvoice()"> Pay Now </ion-button>

<div class="common-semi-modal filter-holder with-border" [ngClass]="{'active' : show_promocodes }">
<header>


+ 1
- 1
src/app/mall-details/mall-details.page.html View File

@@ -81,7 +81,7 @@
<div class="offer">
<span *ngIf="outlet.outlet_type"> <ion-icon name="restaurant"></ion-icon> Food </span>
<span *ngIf="!outlet.outlet_type"> <ion-icon name="basket"></ion-icon> Shopping </span>
Offers: <strong> {{ outlet.offers.length }} </strong>
Offers: <strong> {{ outlet.offers ? outlet.offers.length : 0 }} </strong>
</div>
</div>
</ion-label>


+ 27
- 3
src/app/malls/malls.page.ts View File

@@ -1,5 +1,6 @@
import { Component, OnInit, ViewChild,ElementRef } from '@angular/core';
import { MallService } from '../services/mall.service';
import { ToastService } from '../services/toast.service';
import { Router } from '@angular/router';

@Component({
@@ -19,11 +20,12 @@ export class MallsPage implements OnInit {

constructor(
private mallService: MallService,
private router: Router
private router: Router,
private toastService: ToastService
) { }

ngOnInit() {
this.storeAllMalls();
this.getMallsByLocation();
}

toggleSearchBar() {
@@ -48,7 +50,29 @@ export class MallsPage implements OnInit {
}
}

storeAllMalls() {
getMallsByLocation() {
if (navigator.geolocation) {
this.toastService.presentToast("Getting malls based on your location...", "dark");
navigator.geolocation.getCurrentPosition((position) => {
this.mallService.mallsByLocation(position.coords.latitude, position.coords.longitude).then((response: any) => {
if (response.length > 0) {
localStorage.allMalls = JSON.stringify(response);
this.allMalls = JSON.parse(localStorage.allMalls);
this.tempMalls = JSON.parse(localStorage.allMalls);
} else {
this.toastService.presentToast("No malls near you your location, Getting all the malls...", "warning");
this.getAllMalls();
}
}, () => {
this.toastService.presentToast("Failed to fetch malls for your location", "danger");
});
});
} else {
this.getAllMalls();
}
}

getAllMalls() {
this.mallService.allMalls().then((response) => {
localStorage.allMalls = JSON.stringify(response);
this.allMalls = JSON.parse(localStorage.allMalls);


+ 1
- 1
src/app/services/mall.service.ts View File

@@ -21,7 +21,7 @@ export class MallService {
})
};

return await this.http.get(URL + '/api/maioraservice/mall/v1/latitude/28.6569551/longitude/77.2122032/check/', httpOptions).toPromise();
return await this.http.get(URL + '/api/maioraservice/mall/v1/latitude/' + latitude + '/longitude/' + longitude + '/check/', httpOptions).toPromise();
}

async allMalls() {


Loading…
Cancel
Save