Commit 02813e62 by Arjun

android

parent a49fe93e
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
<div class="sub_menu"> <div class="sub_menu">
<ul *ngIf="categoryService.activecategories"> <ul *ngIf="categoryService.activecategories">
<ion-menu-toggle> <ion-menu-toggle>
<li *ngFor="let category of categoryService.activecategories" <li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)">
(click)="goToPage('catstorelist', category)">
{{ category.catName }} {{ category.catName }}
</li> </li>
</ion-menu-toggle> </ion-menu-toggle>
......
...@@ -3,6 +3,7 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -3,6 +3,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Platform, Events } from '@ionic/angular'; import { Platform, Events } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx';
import { import {
AngularFirestore, AngularFirestore,
AngularFirestoreDocument, AngularFirestoreDocument,
...@@ -16,7 +17,7 @@ import { ServiceService } from './../config/service.service'; ...@@ -16,7 +17,7 @@ import { ServiceService } from './../config/service.service';
import { SubjectService } from './../config/subject.service'; import { SubjectService } from './../config/subject.service';
import { CategoriesService } from './../config/category.service'; import { CategoriesService } from './../config/category.service';
import { SearchmodalPage } from './searchmodal/searchmodal.page'; import { SearchmodalPage } from './searchmodal/searchmodal.page';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations'; import { trigger, transition, animate, style } from '@angular/animations';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx'; import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
@Component({ @Component({
...@@ -67,11 +68,14 @@ export class AppComponent { ...@@ -67,11 +68,14 @@ export class AppComponent {
public categoryService: CategoriesService, public categoryService: CategoriesService,
public subjectService: SubjectService, public subjectService: SubjectService,
private route: ActivatedRoute, private route: ActivatedRoute,
private navigationBar: NavigationBar private navigationBar: NavigationBar,
private location: Location,
private events: Events
) { ) {
console.log(this.router.url); setInterval(() => {
console.log(window.location.href);
}, 1000);
this.state = true; this.state = true;
this.initializeApp(); this.initializeApp();
this.subjectService.getLoginData().subscribe(loginData => { this.subjectService.getLoginData().subscribe(loginData => {
this.state = loginData; this.state = loginData;
...@@ -96,9 +100,7 @@ export class AppComponent { ...@@ -96,9 +100,7 @@ export class AppComponent {
}); });
} }
ionViewWillEnter() { ionViewDidEnter() {}
alert('enter');
}
initializeApp() { initializeApp() {
this.platform.ready().then(() => { this.platform.ready().then(() => {
...@@ -144,6 +146,7 @@ export class AppComponent { ...@@ -144,6 +146,7 @@ export class AppComponent {
'review' 'review'
]; ];
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
console.log(currentUrl);
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state); // console.log(currentUrl[1], index, this.state);
if (index > -1 || this.tabData === false) { if (index > -1 || this.tabData === false) {
......
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
<p class="textLeft">Total Price:</p> <p class="textLeft">Total Price:</p>
</ion-col> </ion-col>
<ion-col> <ion-col>
<p class="textRight">A$ <p class="textRight">A$ {{service.formatNumber(cartService.cartTotal.toFixed(2))}}
{{service.formatNumber(cartService.cartTotal.toFixed(2))}}</p> </p>
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
...@@ -104,8 +104,7 @@ ...@@ -104,8 +104,7 @@
<ion-row> <ion-row>
<ion-col class="p0"> <ion-col class="p0">
<h6> <h6>
{{addressService.custAddress.building}},<br /> {{addressService.custAddress.building}},<br /> {{addressService.custAddress.landmark}},
{{addressService.custAddress.landmark}},
<br /> {{addressService.custAddress.address}} <br /> {{addressService.custAddress.address}}
</h6> </h6>
</ion-col> </ion-col>
...@@ -125,8 +124,7 @@ ...@@ -125,8 +124,7 @@
</label> </label>
</div> --> </div> -->
<div class="payment_method"> <div class="payment_method">
<input type="radio" name="payments" id="paypal" name="radio-group" <input type="radio" name="payments" id="paypal" name="radio-group" (click)="getwaypaypal()" checked="true" />
(click)="getwaypaypal()" checked="true" />
<label for="paypal"> <label for="paypal">
<p>PayPal</p> <p>PayPal</p>
</label> </label>
...@@ -135,8 +133,7 @@ ...@@ -135,8 +133,7 @@
<input class="card_no borderNone widthFull" placeholder="PayPal ID" /> <input class="card_no borderNone widthFull" placeholder="PayPal ID" />
</div> --> </div> -->
<div class="payment_method"> <div class="payment_method">
<input type="radio" name="payments" id="afterpay" name="radio-group" <input type="radio" name="payments" id="afterpay" name="radio-group" (click)="getwayafterpay()" />
(click)="getwayafterpay()" />
<label for="afterpay"> <label for="afterpay">
<p>AfterPay</p> <p>AfterPay</p>
</label> </label>
...@@ -146,8 +143,7 @@ ...@@ -146,8 +143,7 @@
<input class="cv_number" placeholder="CVV" /> <input class="cv_number" placeholder="CVV" />
</div> --> </div> -->
<div class="payment_method"> <div class="payment_method">
<input type="radio" name="payments" id="payk" name="radio-group" <input type="radio" name="payments" id="payk" name="radio-group" (click)="getwaypayk()" />
(click)="getwaypayk()" />
<label for="payk"> <label for="payk">
<p>PayK</p> <p>PayK</p>
</label> </label>
...@@ -173,8 +169,7 @@ ...@@ -173,8 +169,7 @@
<hr /> <hr />
<div class="coupon_code"> <div class="coupon_code">
<div class="promo-row"> <div class="promo-row">
<input class="" placeholder="COUPON CODE: GET50" #promo /><button <input class="" placeholder="COUPON CODE: GET50" #promo /><button class="add_btn apply_btn" (click)="promoApply(promo.value)">
class="add_btn apply_btn" (click)="promoApply(promo.value)">
APPLY APPLY
</button> </button>
</div> </div>
...@@ -247,13 +242,10 @@ ...@@ -247,13 +242,10 @@
</div> </div>
<div class="checkout" (click)="next(1)">CHECKOUT</div> <div class="checkout" (click)="next(1)">CHECKOUT</div>
</div> </div>
<div class="footer_btn" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 1" <div class="footer_btn" *ngIf="cartService.carts && cartService.carts.length > 0" [hidden]="currentIndex != 1" (click)="next(2);">
(click)="next(2);">
PAY PAY
</div> </div>
<!-- <div class="footer_btn" [hidden]="currentIndex != 2" (click)="finishpop()">
FINISH
</div> -->
</ion-footer> </ion-footer>
<div class="loader" *ngIf="loader"> <div class="loader" *ngIf="loader">
<div class="lds-ripple"> <div class="lds-ripple">
...@@ -273,8 +265,7 @@ ...@@ -273,8 +265,7 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content class="sort_wrappper"> <ion-content class="sort_wrappper">
<agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false" <agm-map [zoom]="20" [latitude]="lat" [longitude]="lng" [disableDefaultUI]="false" [zoomControl]="false" [backgroundColor]="'rgba(29, 27, 130,0.2)'">
[backgroundColor]="'rgba(29, 27, 130,0.2)'">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker> <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map> </agm-map>
<div class="add_address_wrapper"> <div class="add_address_wrapper">
...@@ -287,9 +278,7 @@ ...@@ -287,9 +278,7 @@
<li *ngFor="let address of addressService.nearestList; let i = index"> <li *ngFor="let address of addressService.nearestList; let i = index">
<div class="floatLeft"> <div class="floatLeft">
{{address.default}} {{address.default}}
<input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio" <input class="styled-checkbox" name="addressId" id="styled-checkbox-{{i}}" type="radio" (click)="setDefault(address.addressId, i)" [value]="address.addressId" #addressType [checked]="address.defaultVal == 1" />
(click)="setDefault(address.addressId, i)" [value]="address.addressId" #addressType
[checked]="address.defaultVal == 1" />
<label for="styled-checkbox-{{i}}"> {{address.addressType}} </label> <label for="styled-checkbox-{{i}}"> {{address.addressType}} </label>
</div> </div>
<div class="floatLeft"> <div class="floatLeft">
...@@ -300,8 +289,7 @@ ...@@ -300,8 +289,7 @@
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
<div class="textCenter" *ngIf="addressService.nearestList && addressService.nearestList.length === 0">No <div class="textCenter" *ngIf="addressService.nearestList && addressService.nearestList.length === 0">No Address Found in the nearest center</div>
Address Found in the nearest center</div>
</div> </div>
<!-- <div class="loader" *ngIf="loader"> <!-- <div class="loader" *ngIf="loader">
......
.cart_wrapper { .cart_wrapper {
width: 100%; width: 100%;
height: 100%;
.cart_head { .cart_head {
width: 100%; width: 100%;
height: 220px; height: 220px;
...@@ -456,7 +457,7 @@ ...@@ -456,7 +457,7 @@
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 18px; font-size: 18px;
padding: 15px; padding: 10px;
font-weight: 300; font-weight: 300;
border-top-left-radius: 15px; border-top-left-radius: 15px;
border-top-right-radius: 15px; border-top-right-radius: 15px;
...@@ -474,7 +475,7 @@ ...@@ -474,7 +475,7 @@
border-top-left-radius: 15px; border-top-left-radius: 15px;
text-align: center; text-align: center;
font-size: 18px; font-size: 18px;
padding: 15px; padding: 10px;
font-weight: 300; font-weight: 300;
float: left; float: left;
border-top: 1px solid #d7d5e4; border-top: 1px solid #d7d5e4;
...@@ -488,7 +489,7 @@ ...@@ -488,7 +489,7 @@
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 18px; font-size: 18px;
padding: 15px; padding: 10px;
font-weight: 300; font-weight: 300;
float: right; float: right;
} }
......
...@@ -10,6 +10,7 @@ import { ServiceService } from './../../config/service.service'; ...@@ -10,6 +10,7 @@ import { ServiceService } from './../../config/service.service';
import { AddressService } from './../../config/address.service'; import { AddressService } from './../../config/address.service';
import { AddressList } from './../../config/services/address'; import { AddressList } from './../../config/services/address';
import { trigger, transition, animate, style } from '@angular/animations'; import { trigger, transition, animate, style } from '@angular/animations';
import { Events } from '@ionic/angular';
import { zip } from 'rxjs'; import { zip } from 'rxjs';
@Component({ @Component({
...@@ -60,7 +61,8 @@ export class CartPage implements OnInit { ...@@ -60,7 +61,8 @@ export class CartPage implements OnInit {
public orderService: OrdersService, public orderService: OrdersService,
public modalController: ModalController, public modalController: ModalController,
public service: ServiceService, public service: ServiceService,
public addressService: AddressService public addressService: AddressService,
private event: Events
) { ) {
console.log('cart loaded'); console.log('cart loaded');
this.bookDate = this.formatDate(); this.bookDate = this.formatDate();
...@@ -95,7 +97,6 @@ export class CartPage implements OnInit { ...@@ -95,7 +97,6 @@ export class CartPage implements OnInit {
setTimeout(() => { setTimeout(() => {
this.setAddress(); this.setAddress();
}, 1000); */ }, 1000); */
} }
ionViewWillEnter() { ionViewWillEnter() {
...@@ -159,6 +160,7 @@ export class CartPage implements OnInit { ...@@ -159,6 +160,7 @@ export class CartPage implements OnInit {
} }
goBack() { goBack() {
this.event.publish('home');
this.location.back(); this.location.back();
} }
...@@ -192,11 +194,15 @@ export class CartPage implements OnInit { ...@@ -192,11 +194,15 @@ export class CartPage implements OnInit {
paymentMethod: this.paymentMethod paymentMethod: this.paymentMethod
}; };
const state = this.orderService const state = this.orderService
.checkOut(this.cartService.carts, otherCharges, this.addressService.centerLoc) .checkOut(
this.cartService.carts,
otherCharges,
this.addressService.centerLoc
)
.then(data => { .then(data => {
this.cartService.cartCenter = ''; this.cartService.cartCenter = '';
const cartCount = this.orderService.cartCount; const cartCount = this.orderService.cartCount;
const timer = ((cartCount - 1) * 20) + 60; const timer = (cartCount - 1) * 20 + 60;
const totalTime = this.add_minutes(timer); const totalTime = this.add_minutes(timer);
console.log('ready for slide'); console.log('ready for slide');
this.timeinterval = setInterval(() => { this.timeinterval = setInterval(() => {
...@@ -232,7 +238,7 @@ export class CartPage implements OnInit { ...@@ -232,7 +238,7 @@ export class CartPage implements OnInit {
getTimeRemaining(endtime, currDate) { getTimeRemaining(endtime, currDate) {
const t = Date.parse(endtime) - Date.parse(currDate); const t = Date.parse(endtime) - Date.parse(currDate);
const hours = Math.floor((((t / 1000) / 60) / 60) % 60); const hours = Math.floor((t / 1000 / 60 / 60) % 60);
const seconds = Math.floor((t / 1000) % 60); const seconds = Math.floor((t / 1000) % 60);
const minutes = Math.floor((t / 1000 / 60) % 60); const minutes = Math.floor((t / 1000 / 60) % 60);
return { return {
...@@ -290,7 +296,9 @@ export class CartPage implements OnInit { ...@@ -290,7 +296,9 @@ export class CartPage implements OnInit {
if (value[0].type === 1) { if (value[0].type === 1) {
const rate = value[0].amount; const rate = value[0].amount;
const upto = value[0].amount; const upto = value[0].amount;
const percentage = Math.round((this.cartService.cartTotal * rate) / 100).toFixed(2); const percentage = Math.round(
(this.cartService.cartTotal * rate) / 100
).toFixed(2);
this.discount = percentage > upto ? upto : percentage; this.discount = percentage > upto ? upto : percentage;
} else { } else {
this.discount = value[0].amount; this.discount = value[0].amount;
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
} }
.ellipse { .ellipse {
white-space: nowrap; white-space: nowrap;
width: 180px; width: 150px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment